RAGgyBot is a Retrieval-Augmented Generation (RAG) chatbot built using FastAPI, Streamlit, and AWS services. It combines the power of embeddings, Chroma database retrieval, and Together AI for generating intelligent, context-aware responses. The application allows users to query a knowledge base and receive detailed, human-like answers.
- Interactive Chatbot: Engages users with accurate, contextually relevant responses.
- RAG Integration: Utilizes retrieval-augmented generation to combine document retrieval and generative AI.
- Chroma Database: Stores and retrieves documents for query resolution.
- AWS S3 Integration: Downloads and manages Chroma databases from an S3 bucket.
- Streamlit Frontend: A user-friendly web interface for interacting with the chatbot.
- Dockerized Deployment: Streamlined deployment using Docker and Docker Compose.
RAG1_langchain/
├── app/
│ ├── main.py # FastAPI backend for processing queries
│ ├── Dockerfile # Dockerfile for the FastAPI service
├── streamlit/
│ ├── streamlit_app.py # Streamlit frontend for user interaction
│ ├── Dockerfile # Dockerfile for the Streamlit service
├── docker-compose.yml # Docker Compose configuration
└── README.md # Project documentation
- Python 3.8 or higher
- Docker and Docker Compose
- AWS credentials with access to the specified S3 bucket
git clone https://github.com/OppoTrain/RAG1_langchain.git
cd RAG1_langchainCreate a .env file in the root directory and add the following variables:
TOGETHER_API_KEY=<your_together_api_key>
AWS_ACCESS_KEY_ID=<your_aws_access_key>
AWS_SECRET_ACCESS_KEY=<your_aws_secret_key>
AWS_REGION=<your_aws_region>
S3_BUCKET_NAME=<your_s3_bucket_name>docker-compose up --build- FastAPI service will run on
http://localhost:8000 - Streamlit frontend will run on
http://localhost:8501
- Open the Streamlit app at
http://localhost:8501. - Enter your query in the input box and click Get Answer.
- View responses in the chat and refer to the conversation history.
- Hosts the API endpoint
/synthesize/to process user queries. - Retrieves documents from Chroma database and generates responses using Together AI.
- Provides an intuitive web-based interface for user interaction.
- Displays conversation history and allows seamless communication with the backend.
- Stores embeddings for document retrieval.
- Managed locally and synchronized with AWS S3.
- Ensure AWS credentials are correctly configured for accessing the S3 bucket.
- Run
docker-compose upto deploy both the backend and frontend. - Access the application via
http://localhost:8501.
pip install -r requirements.txtuvicorn app.main:app --reloadstreamlit run streamlit/streamlit_app.py- FastAPI: Backend framework for API creation.
- Streamlit: Web application framework for the frontend.
- LangChain: Provides retrieval and embedding functionality.
- Chroma: Vector database for storing document embeddings.
- AWS S3: Cloud storage for managing Chroma database files.
- Docker Compose: Orchestrates multi-container deployment.
- Add support for additional retrieval methods (e.g., hybrid retrieval).
- Implement user authentication for personalized sessions.
- Extend the chatbot’s knowledge base with additional data sources.
This project is licensed under the MIT License.