How sneha-nayak546/agentic-analyst works
Agentic Analyst turns business questions into read-only analytics, then presents results in a React interface. The documented workflow routes intent, enriches context with schema and business knowledge, synthesizes SQL through deterministic or LLM paths, validates it, and executes against the database. Other documented modes provide tutoring, ERDs, dashboards, and narratives. Source excerpts are partial, so links for documented but unsampled internals follow the README architecture; uncertain implementation details are omitted.
Main entry points: sql_agent.py SQL Agent · App.jsx React App · intent_router.py Intent Router · main.py FastAPI Gateway
Components 21
User Experience
- React App
frontend/src/App.jsx - Collaborator Chat
frontend/src/components/CenterChat.jsx - Results and Charts
frontend/src/components/AutoChart.jsx - Dashboard Views
frontend/src/components/DashboardPage.jsx - Reports and Export
app/api/export_router.py
Agent Orchestration
- FastAPI Gateway
app/api/main.py - SQL Agent
app/agent/sql_agent.py - Intent Router
app/agent/intent_router.py - Query Planner
app/agent/query_planner.py - Session Memory
app/agent/memory_manager.py - Analyst Personas
app/agent/collaborator.py
Knowledge Context
- Knowledge Graph
app/knowledge/knowledge_graph.py - Schema Retriever
app/retriever/retriever.py - ChromaDB
app/chroma/retriever.py
SQL Governance
- SQL Synthesizer
app/llm/sql_generator.py - Ollama Qwen
app/llm/qwen.py - SQL Validator
app/validator/query_validator.py
Data and Persistence
- Read Executor
app/database/read_executor.py - MySQL Database
- Query History
app/sql_history/query_history.py
Other components
- Analyst
Connections 22
- Analyst → React App: asks
- React App → Collaborator Chat: shows chat
- Collaborator Chat → FastAPI Gateway: sends question
- FastAPI Gateway → SQL Agent: calls
- SQL Agent → Intent Router: routes intent
- Intent Router → Session Memory: resolves context
- Intent Router → Analyst Personas: dispatches modes
- Intent Router → Query Planner: plans analytics
- Query Planner → Knowledge Graph: resolves entities
- SQL Agent → Schema Retriever: retrieves context
- Schema Retriever → ChromaDB: queries embeddings
- SQL Agent → SQL Synthesizer: generates routine SQL
- SQL Agent → Ollama Qwen: generates complex SQL
- SQL Agent → SQL Validator: validates SQL
- SQL Validator → Read Executor: approves read query
- Read Executor → MySQL Database: executes read
- Read Executor → SQL Agent: returns rows
- SQL Agent → Results and Charts: returns results
- React App → Dashboard Views: opens views
- React App → Reports and Export: requests exports
- FastAPI Gateway → Query History: logs queries
- SQL Agent → Knowledge Graph: enriches successful queries