RAGnamok
A privacy-first, fully local Retrieval-Augmented Generation system designed for scalable document intelligence.

Overview
Designed and developed a modular Retrieval-Augmented Generation (RAG) system capable of ingesting multimodal PDF documents, generating structured knowledge representations, and answering user queries using local language models.
Problem
Most RAG solutions rely on external cloud APIs, making them unsuitable for privacy-sensitive documents while also limiting customization of the retrieval pipeline.
Solution
Built a fully local, modular RAG pipeline using FastAPI, PostgreSQL with pgvector, LangChain, and Ollama. The system supports asynchronous document ingestion, multi-vector retrieval, configurable pipelines, and REST APIs for seamless integration.
Architecture
Engineering Decisions
- Adopted PostgreSQL with pgvector to leverage relational storage alongside vector search in a single database.
- Implemented asynchronous processing to decouple document ingestion from user interactions.
- Used a modular architecture to allow independent experimentation with parsers, retrievers, embeddings, and language models.
- Designed the retrieval pipeline around Multi-Vector Retrieval to improve semantic recall beyond conventional chunk-based approaches.
Challenges
- Designing a flexible pipeline that supports multiple document processing strategies.
- Balancing retrieval quality with indexing performance.
- Maintaining modularity without sacrificing system simplicity.
Lessons Learned
- Retrieval quality often has a greater impact than model size.
- Well-designed system architecture accelerates experimentation significantly.
- Local AI systems require careful engineering beyond model implementation.
Future Improvements
- Hybrid Search
- Reranking Pipeline
- Knowledge Graph Integration
- Agentic Workflow
- Vision-Language Model Support
Technology
Gallery



Results
Accuracy
Relevance: 5.00/5 | Correctness: 4.46/5 | Hallucination: 4.36/5 (higher=better)
Performance
Gen Time: 0.9s avg | Refusal (neg. queries): 4.45/5
Dataset
50/50 CV queries
Users
Evaluated by gemma4:31b-cloud as LLM Judge