A production-ready Retrieval-Augmented Generation (RAG) API built with FastAPI and ChromaDB. This project provides a scalable, asynchronous interface for storing, retrieving, and querying document embeddings with seamless LLM integration.
- FastAPI Framework – High-performance asynchronous API with automatic documentation
- ChromaDB Integration – Persistent vector database for managing embeddings at scale
- LLM Ready – Designed to integrate with local or cloud-based language models
- Persistent Storage – Vector database stored in
./dbfor easy deployment - Production-Ready – Kubernetes-ready configuration included
| Component | Technology |
|---|---|
| Language | Python 3.10+ |
| Web Framework | FastAPI |
| Vector Database | ChromaDB |
| ASGI Server | Uvicorn |
| Package Management | pip & venv |
- Python 3.10 or higher
- pip (Python package manager)
- Git
git clone https://github.com/Jimuelle07/RAG-API.git
cd RAG-APIWindows:
python -m venv venv
venv\Scripts\activatemacOS/Linux:
python -m venv venv
source venv/bin/activatepip install -r requirements.txtLoad and process documents into the vector database:
python embed.pyThis script will process documents and store their embeddings in ChromaDB.
Launch the FastAPI server:
uvicorn app:app --reloadThe API will be available at http://127.0.0.1:8000
- Interactive API Documentation: http://127.0.0.1:8000/docs
- Alternative Documentation: http://127.0.0.1:8000/redoc
RAG-API/
├── app.py # FastAPI application
├── embed.py # Document embedding pipeline
├── k8s.txt # Sample knowledge base
├── requirements.txt # Python dependencies
├── k8s.txt # Kubernetes configuration
├── db/ # Persistent ChromaDB storage
├── venv/ # Python virtual environment (excluded from git)
├── .gitignore # Git ignore rules
└── README.md # This file
Update the following variables in app.py as needed:
- Vector database path
- Collection names
- API endpoints
| Issue | Solution |
|---|---|
| Import errors in VS Code | Ensure your interpreter points to ./venv/Scripts/python.exe |
| Module not found errors | Run pip install -r requirements.txt to ensure all dependencies are installed |
| ChromaDB connection issues | Verify the ./db directory exists and has proper read/write permissions |
This project is open source and available under the MIT License.
For issues, questions, or contributions, please open an issue on GitHub.