A lightweight, cost-effective Retrieval-Augmented Generation (RAG) API built for efficient document search and context-aware LLM responses.
- Framework: FastAPI
- Orchestration: LlamaIndex
- Database: PostgreSQL with
pgvectorextension - Dependency Management:
uv - Tests: Pytest
-
Clone the repository:
git clone https://github.com/dalentri/drag.git cd drag -
Install dependencies using
uv:uv sync
-
Configure environment variables: Create a
.envfile in the root directory and add your credentials:OPEN_API_KEY=your_open_api_key_here DATABASE_URL=postgresql://user:password@localhost:5432/dbname MODEL=model_name
-
Add custom documents to
data/raw_docsdirectory (optional) -
Run the development server:
uv run fastapi dev app/main.py
To begin running evaluations, ensure that the backend is running using the uv run fastapi dev app/main.py command.
To then run the evaluations:
PYTHONPATH=. uv run evals/run_evals.pyDrag comes equipped with unit tests for the API's functionality.
To run tests with Pytest:
pytest tests/test_api.py