How builtbyprashant/genai-doc-assistant works
This is an agentic document Q&A product: users upload files, the backend parses and indexes them, then returns grounded answers with citations and pipeline traces. The principal query path supports a deterministic custom pipeline, a ReAct-style search loop, and side-by-side comparison. The README documents the major capabilities; several implementation details were not sampled, so uncertain internal links are omitted or marked unverified.
Main entry points: pipeline.py Pipeline orchestrator · llm.py LLM client · main.py FastAPI API · llama_agent.py ReAct agent
Components 17
User experience
- Streamlit UI
frontend/app.py - FastAPI API
app/api/main.py
Document ingestion
- Document loader
app/services/document_loader.py - Chunk service
app/services/chunk_service.py
Query orchestration
- Pipeline orchestrator
app/agents/pipeline.py - Similarity threshold
app/agents/pipeline.py - Compare results
app/agents/pipeline.py
Agents and models
- Safety guard
app/agents/safety.py - Planner agent
app/agents/planner.py - Reasoner agent
app/agents/reasoner.py - Validator agent
app/agents/validator.py - ReAct agent
app/agents/llama_agent.py - LLM client
app/agents/llm.py
Retrieval and state
- Vector store
app/services/vector_store.py - Cross-encoder reranker
app/agents/ranker.py
Other components
- Browser user
- Anthropic API
Connections 21
- Browser user → Streamlit UI: asks and uploads
README.md - Streamlit UI → FastAPI API: sends HTTP
README.md - FastAPI API → Document loader: parses uploads
app/api/main.py - FastAPI API → Vector store: indexes and manages
app/api/main.py - FastAPI API → Pipeline orchestrator: runs queries
app/api/main.py - Pipeline orchestrator → Safety guard: checks input
README.md - Pipeline orchestrator → Planner agent: plans query
README.md - Pipeline orchestrator → Vector store: retrieves chunks
app/agents/pipeline.py - Pipeline orchestrator → Similarity threshold: checks similarity
README.md - Pipeline orchestrator → Cross-encoder reranker: reranks chunks
README.md - Pipeline orchestrator → Reasoner agent: generates answer
README.md - Pipeline orchestrator → Validator agent: validates answer
README.md - Pipeline orchestrator → ReAct agent: runs alternate mode
app/agents/pipeline.py - Pipeline orchestrator → Compare results: combines modes
app/agents/pipeline.py - Planner agent → LLM client: requests completion
app/agents/planner.py - Reasoner agent → LLM client: requests completion
app/agents/reasoner.py - Validator agent → LLM client: requests completion
app/agents/validator.py - ReAct agent → Vector store: searches iteratively
app/agents/llama_agent.py - ReAct agent → LLM client: reasons each turn
app/agents/llama_agent.py - LLM client → Anthropic API: calls model
README.md - Document loader → Chunk service: chunks parsed text