This application demonstrates how to build a chat application that allows users to interact with a bot knowledgeable about uploaded PDF documents. It utilizes a Retrieval Augmented Generation (RAG) framework.
For a detailed, step-by-step tutorial, please refer to the Couchbase Developer Portal.
The application employs a serverless architecture on AWS, leveraging services like AWS Lambda, API Gateway, and Bedrock, with Couchbase for data storage and eventing.
Before you begin, ensure you have the following installed and configured:
- AWS CLI
- Node.js and npm (for AWS CDK)
- Python (version specified in
.python-version
) - Docker
- An AWS account with appropriate permissions
- A Couchbase Capella cluster
The Detailed tutorial is present here
Deploy the entire AWS backend infrastructure using the AWS CDK:
cdk deploy --all
This command will provision all the necessary AWS resources.
src/
: Contains the application source code.ui/
: Frontend Streamlit application.cb_eventing/
: Couchbase Eventing function(s).lambdas/
: AWS Lambda function code for ingestion and chat functionalities.
chatCDK/
: AWS CDK stack for the chat-related infrastructure.ingestCDK/
: AWS CDK stack for the data ingestion infrastructure.app.py
: Main AWS CDK application file that synthesizes the stacks.cdk.json
: CDK configuration file.
- Upload PDFs: Use the provided mechanism to ingest PDF documents. The ingestion pipeline will process these documents, generate embeddings, and store them.
- Access the Chat UI: Start the Streamlit frontend and navigate to the application URL.
- Interact with the Bot: Ask questions related to the content of the uploaded PDFs!