How nilesh07g/askmydocs works
AskMyDocs is a Streamlit PDF question-answering app. A user uploads a PDF, which is extracted into page-tagged chunks and indexed; questions are routed, retrieved with hybrid search, reranked, and answered with page citations. The UI also streams responses and displays retrieved sources. The graph captures the documented caching and LangSmith tracing capabilities. Evaluation is a separate harness, not part of the runtime product map. Relationships involving unsampled app sections rely on the SOURCE INDEX or README; uncertain links are omitted.
Main entry points: app.py Streamlit chat · router.py Intent and query routing · answer.py Grounded answer generation · config.py Pipeline settings
Components 15
User interface
- Streamlit chat
app.py
Document preparation
- PDF extraction and chunking
rag/ingest.py - Embedding and FAISS index
rag/embed.py - Embedding cache
rag/cache.py - Pipeline settings
rag/config.py
Question retrieval
- Intent and query routing
rag/router.py - BM25 and vector fusion
rag/hybrid.py - Vector search
rag/retrieve.py - Cross-encoder reranking
rag/rerank.py
Answer generation
- Grounded answer generation
rag/answer.py - Router and answer prompts
rag/prompts.py
Other components
- PDF user
- Groq API
- Gemini API
- LangSmith tracing
Connections 18
- PDF user → Streamlit chat: uploads and asks
README.md - Streamlit chat → PDF extraction and chunking: extracts and chunks
app.py - Streamlit chat → Embedding and FAISS index: builds index
app.py - Streamlit chat → Embedding cache: loads or saves
app.py - Streamlit chat → Intent and query routing: routes query
app.py - Streamlit chat → BM25 and vector fusion: retrieves candidates
app.py - Streamlit chat → Cross-encoder reranking: reranks candidates
app.py - Streamlit chat → Grounded answer generation: streams answer
app.py - Intent and query routing → Groq API: classifies intent
rag/router.py - Intent and query routing → Router and answer prompts: uses router prompt
rag/router.py - BM25 and vector fusion → Vector search: runs vector search
rag/hybrid.py - Grounded answer generation → Router and answer prompts: uses answer prompt
rag/answer.py - Grounded answer generation → Gemini API: generates response
rag/answer.py - Intent and query routing → Pipeline settings: uses model setting
rag/router.py - Grounded answer generation → Pipeline settings: uses model setting
rag/answer.py - PDF extraction and chunking → Pipeline settings: uses chunk settings
rag/ingest.py - Embedding and FAISS index → Pipeline settings: uses model setting
rag/embed.py - Streamlit chat → LangSmith tracing: traces pipeline
README.md