Skip to content

mahmoudm13/mini-rag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini-RAG

FastAPI OpenAI Cohere PostgreSQL PgVector Qdrant Nginx Prometheus Grafana

License

Mini-RAG is a streamlined, scalable implementation of a Retrieval-Augmented Generation pipeline. It bridges the gap between static LLMs and dynamic private data by integrating high-performance vector databases (Qdrant & PgVector) with a robust FastAPI backend. Designed with observability in mind, it includes a full monitoring stack to track performance and system health in real-time.

Requirements

  • Python 3.8 or later

Install Dependencies

sudo apt update
sudo apt install libpq-dev gcc python3-dev

Install Python using MiniConda

  1. Download and install MiniConda from here.
  2. Create a new environment using the following command:
$ conda create -n mini-rag python=3.8
  1. Activate the environment:
$ conda activate mini-rag

(Optional) Setup your command line for better readability

export PS1="\[\033[01;32m\]\u@\h:\w\n\[\033[00m\]\$ "

Installation

Install the required packages

$ cd src/
$ pip install -r requirements.txt

Setup the environment variables and Run Docker Compose Services

$ cd ../docker/env
$ cp .env.example.app .env.app
$ cp .env.example.postgres .env.postgres
$ cp .env.example.grafana .env.grafana
$ cp .env.example.postgres-exporter .env.postgres-exporter

update .env files with your credientials

$ cd ..
$ sudo docker compose up --build -d

Access Services

Run the FastAPI server (Development Mode)

$ uvicorn main:app --reload --host 0.0.0.0 --port 5000

POSTMAN Collection

Download the POSTMAN collection from /src/assets/mini-rag-app.postman_collection.json

Packages

 
 
 

Contributors

Languages