Artificial intelligence (AI) has increasingly marked its presence in enterprises. More organizations leverage and customize digital assistants to answer domain-specific queries using a process called Retrieval Augmented Generation (RAG). As companies shift from concepts to production workloads, the focus turns to minimizing operational overhead while optimizing costs and implementing proper security measures.
This article covers the creation of a digital assistant through a serverless architecture. As the solution’s components primarily rely on serverless technologies, benefits abound. These include automatic scaling, inbuilt high availability, and a pay-per-use billing model for cost optimization. An added bonus is the inclusion of a security layer for managing identity and permissions.
This system uses Amazon Bedrock’s hybrid search feature to increase the relevance of the retrieved results using RAG. A hybrid search combines semantic search, which provides results based on the query’s meaning and intent, and keyword search, which is based on specified entities in the query.
Amazon Bedrock is a fully managed service that provides a wide range of foundation models via an API without requiring infrastructure management. Other utilized services include an Amazon OpenSearch Serverless vector engine, AWS Amplify to deploy the web application, Amazon API Gateway, AWS Lambda, Amazon Cognito for identity platform implementation, and Amazon S3 to store enterprise data and app-related assets.
The workflow allows the user to authenticate, submit inquiries, and triggers relevant actions throughout the system architecture, eventually generating responses that return to the end-user. The article provides a detailed instruction path, from setting up the necessary prerequisites and creating a knowledge base on Amazon Bedrock, to uploading relevant documents.
One main focal point is setting up an API and backend to strategically manage and protect resources. Amazon Cognito manages end-user directory, while AWS Lambda functions call the knowledge base for actions and API security.
The guide explains the step-by-step measures to create the API and backend structures and suggests tools and scripts for the process. Systems are set up for scalability, accessibility, and enhanced security.
The latter sections of the article cover the needed steps to create an Amplify application that forms the foundation for the web application, with authentication, hosting, and manual deployment being fundamentally configured. After validation and relevant configurations, the application is tested live, with the testing methods and expected responses detailed.
The article concludes with a clean-up procedure to evade additional costs. It suggests a cautious approach in deleting the created resources to avoid generation of unintended consequences.
By implementing serverless services and a detailed knowledge base system, organizations can reap multiple benefits. Not only is this a cost-effective method, but it also expedites access to information based on user queries while maintaining a robust and adaptable security layer. AWS Workshop Studios provides a more detailed workshop to dive deeper into this solution.