How sanduniudissanayake/agentic-rag-copilot works
Annual Report Copilot answers questions about four company reports through a Streamlit chat UI and FastAPI endpoint. The request path delegates to an agent that can search a shared index, perform company-filtered searches, and invoke safe arithmetic; it returns an answer, tool trace, provider details, and separately retrieved source passages. Ingestion builds the on-disk index, while Groq/Gemini fallback and RAGAS evaluation are documented or represented in the repository. Edges reflect shown calls or README wiring; evaluation is a separate product-support capability, not part of each query.
Main entry points: core.py Agent orchestration · ingest.py PDF ingestion · app.py Streamlit chat · api.py Query API
Components 17
User interface and API
- Streamlit chat
app.py - Query API
api.py
Agent and retrieval
- Agent orchestration
core.py - All-report search
core.py - Company-filtered search
core.py - Source passages
core.py
Report knowledge base
- Index loader
core.py - Persisted vector index
- PDF ingestion
ingest.py - Annual report PDFs
Models and arithmetic
- Safe calculator
tools.py - LLM selection and fallback
core.py
Answer evaluation
- Evaluation questions
eval/testset.py - RAGAS evaluation
evaluate.py
Other components
- Report questioner
- Groq
- Gemini
Connections 18
- Report questioner → Streamlit chat: asks
README.md - Streamlit chat → Query API: sends query
README.md - Query API → Agent orchestration: calls
api.py - Agent orchestration → LLM selection and fallback: selects provider
core.py - Agent orchestration → All-report search: registers tool
core.py - Agent orchestration → Company-filtered search: registers tool
core.py - Agent orchestration → Safe calculator: registers tool
core.py - Agent orchestration → Source passages: retrieves separately
core.py - All-report search → Index loader: queries
core.py - Company-filtered search → Index loader: queries filtered
core.py - Source passages → Index loader: retrieves passages
core.py - Index loader → Persisted vector index: loads
core.py - PDF ingestion → Annual report PDFs: extracts text
README.md - PDF ingestion → Persisted vector index: builds and saves
ingest.py - LLM selection and fallback → Groq: connects
core.py - LLM selection and fallback → Gemini: fallback
core.py - Evaluation questions → RAGAS evaluation: scores
evaluate.py - RAGAS evaluation → Persisted vector index: loads for queries
evaluate.py