How siddu-nandula/dia works
This is a document intelligence and analytics application: users upload PDF, CSV, or XLSX documents, then ask questions, request summaries or numerical analysis, and generate charts. The documented interface is Streamlit, with a FastAPI backend and an agent routing requests among document QA, analytics, and chart tools. The shown QA pipeline builds and searches a FAISS index before generating a grounded answer with Ollama. Some API and tool implementation details were not excerpted, so those links are documented or marked unverified rather than presented as inspected call paths.
Main entry points: agent_tools.py Tool execution · api.py REST API · llm_client.py Local model client · agent.py Intent router
Components 16
User interfaces
- Streamlit interface
frontend.py - REST API
app/api.py
Request orchestration
- Intent router
app/agent.py - Tool execution
app/agent_tools.py - Runtime settings
app/config.py
Document intelligence
- Document ingestion
app/document_loader.py - PDF data extraction
app/pdf_data_extractor.py - Grounded QA
app/qa_pipeline.py - Passage retrieval
app/retrieval.py - Local model client
app/llm_client.py
Analytics and visualization
- Numerical Q&A
app/analytics_qa.py - Data analysis
app/data_analytics.py - Chart generation
app/chart_generator.py
Other components
- User
- Ollama / Qwen
- FAISS index
Connections 21
- User → Streamlit interface: uploads and asks
README.md - Streamlit interface → REST API: uses backend
README.md - User → REST API: calls endpoints
README.md - REST API → Intent router: dispatches requests
app/api.py - Intent router → Tool execution: routes tool requests
app/agent.py - Intent router → Grounded QA: routes document questions
app/agent.py - Tool execution → Document ingestion: uses loaded documents
app/agent_tools.py - Tool execution → Numerical Q&A: delegates numerical Q&A
app/agent_tools.py - Tool execution → Chart generation: requests charts
app/agent_tools.py - Tool execution → PDF data extraction: extracts PDF tables
app/agent_tools.py - Grounded QA → Passage retrieval: builds index and searches
app/qa_pipeline.py - Passage retrieval → FAISS index: indexes passages
- Grounded QA → Local model client: generates grounded answer
app/qa_pipeline.py - Local model client → Ollama / Qwen: sends prompts
README.md - PDF data extraction → Local model client: structures extracted data
app/pdf_data_extractor.py - Numerical Q&A → Data analysis: calculates statistics
app/analytics_qa.py - Chart generation → Data analysis: uses tabular data
app/chart_generator.py - REST API → Document ingestion: accepts documents
app/api.py - REST API → Runtime settings: reads settings
app/api.py - Local model client → Runtime settings: reads model configuration
app/llm_client.py - Document ingestion → Runtime settings: reads upload settings
app/document_loader.py