How vishwanath-06/offline_rag works
This is an offline document-question-answering app: users add PDFs or text/Markdown files, ingest them into a local Chroma vector database, then ask questions through a browser interface and receive answers with source snippets. Ingestion loads and chunks documents before embedding and storage; the API retrieves relevant chunks and uses a local Ollama model to generate answers. Model caching prepares local dependencies, while diagnostics check offline readiness. The main runtime and ingestion sources were sampled; the browser-to-API connection is documented only indirectly, so that edge is marked unverified.
Main entry points: ingest.py Ingestion Runner · main.py Query API · interface.html Browser Interface · cache_models.py Model Caching
Components 15
Document Ingestion
- Ingestion Runner
ingest.py - Document Loaders
ingest.py - Chunking
ingest.py - Ingest Embeddings
ingest.py
Question Answering
- Chroma Database
ingest.py - Browser Interface
interface.html - Query API
main.py - Query Embeddings
main.py - Similarity Retriever
main.py - Prompt Chain
main.py - Ollama Model
Offline Readiness
- Model Caching
cache_models.py - Cache Verification
verify_cache.py - Offline Diagnostics
offline_test.py
Other components
- Document User
Connections 16
- Document User → Browser Interface: asks questions
README.md - Document User → Ingestion Runner: provides documents
README.md - Ingestion Runner → Document Loaders: loads files
ingest.py - Ingestion Runner → Chunking: splits documents
ingest.py - Ingestion Runner → Ingest Embeddings: initializes embeddings
ingest.py - Ingestion Runner → Chroma Database: writes chunks
ingest.py - Browser Interface → Query API: submits query
- Query API → Query Embeddings: initializes model
main.py - Query API → Similarity Retriever: retrieves context
main.py - Similarity Retriever → Chroma Database: searches vectors
main.py - Query API → Prompt Chain: generates answer
main.py - Prompt Chain → Ollama Model: invokes model
main.py - Query API → Browser Interface: returns answer
- Model Caching → Ollama Model: checks or pulls
cache_models.py - Model Caching → Query Embeddings: caches model
cache_models.py - Cache Verification → Query Embeddings: checks cache
verify_cache.py