
A modular, production-style Retrieval-Augmented Generation (RAG) system built from scratch with FastAPI, Qdrant, HuggingFace, Groq, RQ, and Docker. Features asynchronous document indexing, custom vector retrieval, streaming responses, session memory, and an extensible provider architecture.






Mini RAG is a modular, production-style Retrieval-Augmented Generation (RAG) system built from scratch using FastAPI, Qdrant, HuggingFace Embeddings, Groq, RQ, and Docker.
Rather than relying entirely on high-level frameworks, the project implements each stage of the RAG pipeline as an independent, replaceable service—from document ingestion and chunking to embeddings, vector storage, retrieval, prompt construction, conversation memory, and streaming responses. The architecture is designed to be modular, making it easy to swap providers and extend the system with new capabilities.
I originally started this project while building another terminal-based AI assistant. To implement document-based question answering, I needed a deeper understanding of how Retrieval-Augmented Generation works beyond simply using existing libraries.
What began as a small learning exercise gradually evolved into a complete RAG system with asynchronous indexing, custom vector retrieval, conversation-aware prompting, and a modular architecture. The project now serves as both a production-style foundation for future AI applications and a practical exploration of modern RAG system design.
The project follows a service-oriented architecture where major components are independent and replaceable.
Current modular components include:
Because everything is accessed through factories and abstractions, integrating additional providers such as Ollama, OpenAI, Gemini, Anthropic, or alternative vector databases requires minimal changes to the rest of the system.
Upload Document
│
▼
FastAPI API
│
▼
Background Worker
│
▼
Loader → Chunker → Embeddings → Point Builder
│
▼
Qdrant
▲
│
User → CLI/API → Retriever → Prompt Builder → LLM
│
▼
Streaming Response
Some of the key engineering challenges while building this project included:
The current architecture is intentionally designed to support future extensions, including:
Mini RAG has become much more than a learning project. It demonstrates how a modern Retrieval-Augmented Generation system can be designed using modular software engineering principles while remaining flexible enough to evolve with new AI models, retrieval techniques, and backend services.
github link: https://github.com/sayan-dey12/rag-system
See README.md file for more detailed description and Insatallation steps