How shashankkrishnav/researchrag works
ResearchRAG is a local research-paper RAG app. Users upload papers in the Library, where the API extracts page-aware text, chunks it, embeds it, and stores the index; in Ask, a question triggers hybrid retrieval and reranking, then optionally streams a grounded answer with citations from local Ollama. The graph preserves the documented rebuild and library-management capabilities. Some API and UI wiring is shown only in the README, so those edges cite it; unsampled implementation details are not inferred.
Main entry points: main.py FastAPI routes · retriever.py Hybrid retrieval · reindex.py Index rebuild · store.py Persistent index
Components 15
Web interface
- Library page
web/library.html - Library controls
web/library.js - Ask page
web/ask.html - Ask controls
web/ask.js
Application API
- FastAPI routes
app/main.py - Runtime settings
app/config.py
Document and retrieval pipeline
- Parse and chunk
app/ingest.py - Embedding and reranking
app/models.py - Hybrid retrieval
app/retriever.py - BM25 search
app/bm25.py - Grounded generation
app/llm.py
Index and maintenance
- Persistent index
app/store.py - Index rebuild
app/reindex.py
Other components
- Researcher
- Ollama service
Connections 22
- Researcher → Library page: uploads papers
README.md - Researcher → Ask page: asks questions
README.md - Library page → Library controls: loads controls
README.md - Ask page → Ask controls: loads controls
README.md - Library controls → FastAPI routes: manages library
README.md - Ask controls → FastAPI routes: searches and asks
README.md - FastAPI routes → Parse and chunk: parses uploads
app/main.py - FastAPI routes → Embedding and reranking: embeds documents
app/main.py - FastAPI routes → Persistent index: stores documents
app/main.py - FastAPI routes → Hybrid retrieval: retrieves passages
app/main.py - Hybrid retrieval → Persistent index: reads index
app/retriever.py - Hybrid retrieval → BM25 search: scores keywords
app/retriever.py - Hybrid retrieval → Embedding and reranking: embeds and reranks
app/retriever.py - Persistent index → BM25 search: builds keyword index
app/store.py - FastAPI routes → Grounded generation: streams answer
app/main.py - Grounded generation → Ollama service: requests generation
app/llm.py - FastAPI routes → Index rebuild: starts rebuild
app/main.py - Index rebuild → Parse and chunk: reparses papers
app/reindex.py - Index rebuild → Embedding and reranking: re-embeds chunks
app/reindex.py - Index rebuild → Persistent index: rebuilds index
app/reindex.py - FastAPI routes → Runtime settings: uses settings
app/main.py - Grounded generation → Runtime settings: reads model settings
app/llm.py