A runnable Python/FastAPI portfolio project demonstrating the retrieval layer of a Retrieval-Augmented Generation (RAG) system without requiring a proprietary LLM or embedding API.
- FastAPI REST API
- Document ingestion
- Text chunking
- Local vectorization
- Cosine-similarity retrieval
- Top-k search
- Pydantic validation
- Health checks
- Automated API tests
- Modular backend design
- RAG architecture concepts
This project focuses on retrieval infrastructure. It uses a deterministic local bag-of-words vectorizer rather than an external embedding model so the repository is runnable without API keys.
GET /healthPOST /v1/documentsGET /v1/documentsPOST /v1/search
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
uvicorn app.main:app --reloadInteractive API docs are available at /docs.
pytest- Document text is chunked.
- Chunks are tokenized and vectorized locally.
- Query text is vectorized using the same method.
- Cosine similarity ranks chunks.
- The API returns the highest-scoring chunks with metadata.
All sample documents are synthetic. This repository demonstrates RAG retrieval architecture and does not claim production deployment of a generative model.