Skip to content

Jimuelle07/RAG-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG API with FastAPI

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.

Features

  • 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 ./db for easy deployment
  • Production-Ready – Kubernetes-ready configuration included

Tech Stack

Component Technology
Language Python 3.10+
Web Framework FastAPI
Vector Database ChromaDB
ASGI Server Uvicorn
Package Management pip & venv

Prerequisites

  • Python 3.10 or higher
  • pip (Python package manager)
  • Git

Installation

1. Clone the Repository

git clone https://github.com/Jimuelle07/RAG-API.git
cd RAG-API

2. Create and Activate Virtual Environment

Windows:

python -m venv venv
venv\Scripts\activate

macOS/Linux:

python -m venv venv
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

Getting Started

Step 1: Embed Documents

Load and process documents into the vector database:

python embed.py

This script will process documents and store their embeddings in ChromaDB.

Step 2: Start the API

Launch the FastAPI server:

uvicorn app:app --reload

The API will be available at http://127.0.0.1:8000

Project Structure

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

Configuration

Update the following variables in app.py as needed:

  • Vector database path
  • Collection names
  • API endpoints

Troubleshooting

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

License

This project is open source and available under the MIT License.

Support

For issues, questions, or contributions, please open an issue on GitHub.

About

built a RAG system using FastAPI, ChromaDB and Ollama

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages