https://github.com/mahmoudm13/mini-rag
Mini RAG system built with FastAPI, SQLAlchemy, PGVector, and Qdrant
https://github.com/mahmoudm13/mini-rag
cohere docker fastapi grafana mongodb nginx openai pgvector postgres prometheus qdrant sqlalchemy
Last synced: 3 months ago
JSON representation
Mini RAG system built with FastAPI, SQLAlchemy, PGVector, and Qdrant
- Host: GitHub
- URL: https://github.com/mahmoudm13/mini-rag
- Owner: mahmoudm13
- License: apache-2.0
- Created: 2025-12-12T12:12:29.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-16T16:27:38.000Z (6 months ago)
- Last Synced: 2025-12-20T07:24:44.539Z (6 months ago)
- Topics: cohere, docker, fastapi, grafana, mongodb, nginx, openai, pgvector, postgres, prometheus, qdrant, sqlalchemy
- Language: Python
- Homepage:
- Size: 96.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### *Mini-RAG*
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
```bash
sudo apt update
sudo apt install libpq-dev gcc python3-dev
```
### Install Python using MiniConda
1) Download and install MiniConda from [here](https://docs.anaconda.com/free/miniconda/#quick-command-line-install).
2) Create a new environment using the following command:
```bash
$ conda create -n mini-rag python=3.8
```
3) Activate the environment:
```bash
$ conda activate mini-rag
```
### (Optional) Setup your command line for better readability
```bash
export PS1="\[\033[01;32m\]\u@\h:\w\n\[\033[00m\]\$ "
```
## Installation
### Install the required packages
```bash
$ cd src/
$ pip install -r requirements.txt
```
### Setup the environment variables and Run Docker Compose Services
```bash
$ 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
```bash
$ cd ..
$ sudo docker compose up --build -d
```
## Access Services
- FastAPI: http://localhost:8000
- Grafana: http://localhost:3000
- Prometheus: http://localhost:9090
## Run the FastAPI server (Development Mode)
```bash
$ 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](/src/assets/mini-rag-app.postman_collection.json)