How sinapars9/doclens works
DocLens is a Streamlit PDF question-answering assistant. Users upload and select documents, the system parses and indexes them, then resolves the question, retrieves and reranks evidence, streams an answer, and verifies its claims. The graph preserves documented multi-document scope, parent-child retrieval, caching, and human feedback. The pipeline excerpt omits some orchestration calls, so documented links use the README; unsampled implementation details are not inferred.
Main entry points: pipeline.py RAG orchestrator · chunk_pdf.py Semantic chunks · vector_store.py Vector store · query_rewriter.py Query resolution
Components 18
PDF ingestion
- PDF extraction
inspect_pdf.py - Semantic chunks
chunk_pdf.py - ONNX embeddings
embedding.py - Chunk context
contextualizer.py - Model settings
config.py
Search and context
- Vector store
vector_store.py - Hybrid retrieval
retriever.py - Query resolution
query_rewriter.py - Cross-encoder reranking
reranker.py - Semantic cache
semantic_cache.py
Answer and verification
- RAG orchestrator
pipeline.py - Streaming generation
generate.py - Answer verifier
verifier.py
User interface
- Streamlit interface
app.py - Feedback log
app.py
Other components
- Document user
- LLM service
- Disk cache
Connections 22
- Document user → Streamlit interface: uploads and asks
README.md - Streamlit interface → RAG orchestrator: submits questions
README.md - Streamlit interface → Feedback log: logs feedback
app.py - RAG orchestrator → Semantic chunks: builds document index
README.md - Semantic chunks → PDF extraction: loads PDF content
chunk_pdf.py - Semantic chunks → ONNX embeddings: embeds semantic windows
chunk_pdf.py - Semantic chunks → Chunk context: contextualizes chunks
chunk_pdf.py - Semantic chunks → Vector store: stores indexed chunks
README.md - Vector store → Semantic chunks: builds from chunks
vector_store.py - Vector store → ONNX embeddings: embeds stored text
vector_store.py - RAG orchestrator → Query resolution: resolves query
pipeline.py - Query resolution → LLM service: requests query expansion
query_rewriter.py - Query resolution → Disk cache: reads and writes
query_rewriter.py - RAG orchestrator → Semantic cache: checks semantic cache
pipeline.py - RAG orchestrator → Hybrid retrieval: retrieves candidates
README.md - Hybrid retrieval → Vector store: searches vectors
retriever.py - RAG orchestrator → Cross-encoder reranking: reranks candidates
pipeline.py - RAG orchestrator → Streaming generation: streams answer
README.md - Streaming generation → LLM service: requests completion
generate.py - Streaming generation → Disk cache: reads and writes
generate.py - RAG orchestrator → Answer verifier: verifies answer
README.md - ONNX embeddings → Model settings: loads model path
embedding.py