A 100% offline retrieval-augmented generation system indexing 2,000+ pages of Harrison's Principles of Internal Medicine. Every answer is grounded in retrieved document passages with full citation — no cloud API, no data leaves the machine.
The system uses a standard RAG pipeline — ingest, embed, store, retrieve, generate — but runs every component locally. No data is sent to cloud APIs at any stage, making it suitable for sensitive or privacy-constrained environments.
Harrison's Principles of Internal Medicine (2,000+ pages) is parsed, cleaned, and split into approximately 3,000 overlapping chunks using LangChain's text splitters. Chunk boundaries are optimized for medical context preservation.
Chunks are embedded using Mistral 7B running locally via Ollama — no OpenAI API, no cloud embedding service. The embedding model runs on local hardware, ensuring full data privacy during the indexing phase.
All 3,000 embeddings are stored in ChromaDB, an open-source local vector database. At query time, ChromaDB performs approximate nearest neighbor search to retrieve the top-k most semantically relevant chunks in milliseconds.
Six FastMCP servers expose retrieval operations as callable tools: chapter-level retrieval, symptom-based search, drug information lookup, diagnostic criteria retrieval, treatment protocol search, and citation resolution.
The same Mistral 7B model used for embeddings performs generation — ensuring consistent semantic space. Retrieved chunks are provided as context, and the model generates grounded answers without hallucinating content not in the retrieved passages.
Every generated answer includes citations — chapter, section, and passage references — so users can verify the source in the original textbook. Critical for medical use cases where answer provenance must be auditable.
Sanskar Agrawal builds production RAG pipelines — offline or cloud-based — with ChromaDB, Pinecone, LangChain, and custom MCP retrieval tools. Based in Indore, India — available globally.