How nirmalkumar31/agentic-analytics-engine works
Agentic Analytics Engine accepts a demo or uploaded CSV/Parquet table, maps a business question to a constrained analytical plan, computes it, and returns an answer with SQL, rows, and an MCP trace. The principal path runs from browser/API through session setup and LangGraph interpretation, MCP aggregation, guarded DuckDB execution, and evidence verification. Distinct capabilities include optional AI disambiguation and correlation. Source excerpts establish the main calls; documented capabilities without sampled callers are shown without inferred links.
Main entry points: workflow.py LangGraph Workflow · mcp_server.py MCP Tool Server · app.py FastAPI Sessions · engine.py Guarded SQL
Components 18
User Interface
- Browser UI
static/index.html - FastAPI Sessions
app.py - Session Dataset
engine.py
Question Workflow
- LangGraph Workflow
workflow.py - AI Planner
workflow.py - Evidence Check
workflow.py
Analytics Engine
- Rule Resolver
engine.py - Plan Validator
engine.py - Guarded SQL
engine.py - DuckDB Results
engine.py - Result Snapshot
engine.py
MCP Tools
- MCP Tool Server
mcp_server.py - Aggregate Tool
mcp_server.py - Correlation Tool
mcp_server.py - Dataset Profile
mcp_server.py - Result Retrieval
mcp_server.py
Other components
- Analyst
- AI Provider
Connections 18
- Analyst → Browser UI: asks question
README.md - Browser UI → FastAPI Sessions: sends requests
- FastAPI Sessions → Session Dataset: loads data
app.py - FastAPI Sessions → LangGraph Workflow: invokes analysis
app.py - LangGraph Workflow → Rule Resolver: resolves question
workflow.py - LangGraph Workflow → AI Planner: requests proposal
workflow.py - AI Planner → AI Provider: requests mapping
workflow.py - LangGraph Workflow → Plan Validator: validates proposal
workflow.py - LangGraph Workflow → MCP Tool Server: builds server
workflow.py - LangGraph Workflow → Aggregate Tool: calls tool
workflow.py - Aggregate Tool → Guarded SQL: executes plan
mcp_server.py - Guarded SQL → DuckDB Results: runs query
engine.py - Guarded SQL → Result Snapshot: records result
engine.py - LangGraph Workflow → Evidence Check: checks result
workflow.py - Evidence Check → Result Snapshot: verifies values
workflow.py - MCP Tool Server → Correlation Tool: registers tool
mcp_server.py - MCP Tool Server → Dataset Profile: registers tool
mcp_server.py - MCP Tool Server → Result Retrieval: registers tool
mcp_server.py