Building an AWS-Powered AI Chatbot for Real-Time Knowledge Retrieval
As part of our campus hackathon project, we built an AI-powered chatbot that helps members get quick and reliable answers from official documents. The main idea was to make the chatbot useful beyond normal question-answering by connecting it directly to a continuously updated knowledge source.
For example, during an event, information such as room numbers, lunch timings, or demo schedules can change. Instead of updating the chatbot manually every time, an administrator can update the official event document and the chatbot can use the latest information.
Technologies Used
The frontend of the application was developed using React and Tailwind CSS, providing a simple conversational interface. Users can log in, access the chatbot, ask questions, and view responses along with their source documents.
For authentication, we used Amazon Cognito. It handles user registration, login, authentication tokens, and password-related workflows. This ensures that only authorized members can access the chatbot.
The backend is built using AWS Lambda, which handles the application logic without requiring us to maintain a dedicated server. Amazon API Gateway connects the frontend with the Lambda functions through secure HTTPS APIs.
We use Amazon S3 to store the documents that act as the chatbot's knowledge source. These can include event briefings, FAQs, rules, guides, and other organizational documents.
The AI layer is powered by Amazon Bedrock. Instead of asking the AI model to answer purely from its pretrained knowledge, we use Retrieval-Augmented Generation (RAG). The relevant information is retrieved from our documents and provided to the model before generating the response.
Amazon Bedrock Knowledge Bases handles the document indexing and retrieval process. This allows the chatbot to find relevant information even when the user's question does not exactly match the wording in the document.
For application data such as chat sessions and metadata, we use Amazon DynamoDB. We also use Amazon EventBridge and Lambda to support event-driven processing when documents are updated. Amazon CloudWatch is used for monitoring and debugging the application.
API and Data Flow
The basic flow is:
User → React → API Gateway → Lambda → Bedrock Knowledge Base → Amazon Bedrock → Lambda → API Gateway → React
When an administrator updates a document in S3, the update can trigger the backend processing flow. Once the document is indexed, users can access the updated information through the chatbot without changing the application code.
For our demo, the chatbot successfully answers questions such as:
- Where are judging and final demos? Hall B, Room 204
- What time is lunch? 1:30 PM
- What time are final demos? 4:00 PM
Each answer also displays event-day-briefing.md as the source.
The project demonstrates how AWS services and generative AI can be combined to build a practical chatbot that is not only conversational, but also connected to reliable and continuously changing information.
Loading article