RAG DOCUMENT ASSISTANT
Retrieval-Augmented Generation assistant with semantic chunking and grounded citations.
The Problem Space
General LLMs frequently hallucinate facts when queried on proprietary manuals, technical specs, enterprise reports, and dense domain texts.
Systemized Implementation
Constructed a deterministic RAG retrieval pipeline where the LLM is constrained to synthesize exclusively from top-k retrieved vectors.
How It Operates in Production
Built with Python, FastAPI, and ChromaDB. Documents are ingested, normalized, and split using recursive character chunking with 15% overlap. Embeddings are generated using Hugging Face Sentence Transformers and queried via approximate nearest neighbor search.
Engineered chunk overlap strategies to preserve semantic boundaries, optimized embedding dimensionality for rapid cosine similarity queries, and implemented citation mapping.
RAG PIPELINE // DETERMINISTIC RETRIEVAL & GROUNDED CITATIONS
Recursive Text Chunking
PDF document parsing with 15% sliding window overlap preserving semantic boundary clauses across complex sections.
Dense Vector Generation
Hugging Face Sentence Transformers map normalized clauses into 384-dimensional dense metric vector spaces.
ChromaDB Persistent Cosine Search
Hierarchical vector collection querying top-k relevant chunks with strict similarity confidence threshold gates.
Ollama Grounded Generation
Local LLM constrained to generate answers strictly derived from retrieved text, annotating verifiable page references.
Data Flow & Infrastructure
Unstructured documents flow into an ingestion worker that parses text and generates vector embeddings. Vectors are indexed in persistent ChromaDB collections. Query requests trigger semantic vector searches, which feed retrieved text passages into the prompt context of an Ollama LLM.
Pipeline guarantees zero hallucinations by enforcing strict context prompting and returning source page references for every assertion.
Core System Features

Interactive Streamlit Research Console
Deterministic question-answering console highlighting direct verbatim page citations from uploaded documents.

Document Ingestion & Semantic Chunking View
Document chunking inspector with 15% sliding window overlap preserving critical domain clauses.
Deterministic Retrieval Pipeline & Cosine Gate
End-to-end vector pipeline routing queries through ChromaDB collections to local Ollama LLMs.
Local Privacy-Preserving Inference Topology
Offline LLM orchestration ensuring sensitive company documents never touch external third-party cloud APIs.