How leminhohoho/vde-agent-demo works
vdagent is a multi-agent retail-analytics assistant: a user submits a question in the React chat, the backend schedules an invocation for the orchestrator, and agents collaborate through the backend hub. Agents can use the backend’s authenticated MCP tools to query the warehouse and work with analysis artifacts; the UI follows task and message updates and presents datasets, charts, and reports. The README documents five agent roles and remote gRPC sessions. Some subsystem wiring is represented from documentation because its source was not sampled.
Main entry points: hub.py Agent hub · engine.py Invocation engine · agent.py Orchestrator agent · client.ts API client
Components 25
User interface
- React workspace
frontend/src/App.tsx - API client
frontend/src/api/client.ts - Live event stream
frontend/src/events/useEventStream.ts - Results inspector
frontend/src/components/inspector/Inspector.tsx
Backend runtime
- REST API
backend/vdagent_backend/api/rest.py - SSE API
backend/vdagent_backend/api/sse.py - Invocation engine
backend/vdagent_backend/engine/engine.py - Agent hub
backend/vdagent_backend/engine/hub.py - Event bus
backend/vdagent_backend/events.py - Backend repository
backend/vdagent_backend/db/repo.py - Backend SQLite
backend/vdagent_backend/db/database.py - Agent protocol
proto/agent.proto
Agent roles
- Orchestrator agent
agents/orchestrator/vdagent_orchestrator/agent.py - Data agent
agents/data/vdagent_data/agent.py - Compare agent
agents/compare/vdagent_compare/agent.py - Insight agent
agents/insight/vdagent_insight/agent.py - Report agent
agents/report/vdagent_report/agent.py - Agent MCP client
agents/orchestrator/vdagent_orchestrator/mcp_client.py
MCP and data
- MCP server
backend/vdagent_backend/mcp/server.py - MCP tools
backend/vdagent_backend/mcp/tools.py - Warehouse SQL
backend/vdagent_backend/mcp/sql.py - Artifact storage
backend/vdagent_backend/db/artifacts.py
Other components
- Analytics user
- LLM service
- Retail warehouse
Connections 32
- Analytics user → React workspace: asks question
- React workspace → API client: submits message
- API client → REST API: HTTP request
- REST API → Invocation engine: starts invocation
- Invocation engine → Backend repository: records run
- Backend repository → Backend SQLite: reads and writes
- Invocation engine → Agent hub: dispatches turns
- Agent hub → Orchestrator agent: streams gRPC
- Orchestrator agent → LLM service: requests completion
- Orchestrator agent → Agent hub: requests agent call
- Agent hub → Invocation engine: delivers call
- Invocation engine → Agent hub: dispatches child
- Agent hub → Data agent: streams gRPC
- Agent hub → Compare agent: streams gRPC
- Agent hub → Insight agent: streams gRPC
- Agent hub → Report agent: streams gRPC
- Data agent → LLM service: requests completion
- Compare agent → LLM service: requests completion
- Insight agent → LLM service: requests completion
- Report agent → LLM service: requests completion
- Orchestrator agent → Agent MCP client: calls MCP tools
- Agent MCP client → MCP server: HTTP tool requests
- MCP server → MCP tools: dispatches tools
- MCP tools → Warehouse SQL: runs queries
- Warehouse SQL → Retail warehouse: reads warehouse
- MCP tools → Artifact storage: stores artifacts
- Invocation engine → Event bus: publishes events
- Event bus → SSE API: provides events
- SSE API → Live event stream: streams updates
- Live event stream → React workspace: updates workspace
- API client → Results inspector: fetches results
- Invocation engine → Agent protocol: uses messages