How yuvarajakkole/multi_agent_decision_ai works
RA Agent is an interactive business-decision system: a user submits a query through the React chat, the FastAPI backend runs a coordinated multi-agent analysis, and the UI presents a structured recommendation, confidence, and progress. The README documents specialist research, financial, knowledge, strategy, and communication stages, with quality retries and outcome learning. The graph runner, supervisor, and decision graph form the orchestration layer. The repository also contains a separate, smaller app/ decision workflow. Backend internals beyond the cited excerpts are represented at their exact directory paths; their detailed call wiring is not inferred.
Main entry points: supervisor_graph.py Supervisor · main.py FastAPI endpoints · graph_runner.py Graph runner · graph.py Earlier decision graph
Components 34
Decision UI
- Query form
ra_agent/frontend/src/components/chat/QueryForm.jsx - Chat page
ra_agent/frontend/src/pages/ChatPage.jsx - Decision hook
ra_agent/frontend/src/hooks/useDecision.js - Agent state
ra_agent/frontend/src/store/useAgentStore.js - Agent timeline
ra_agent/frontend/src/components/timeline/AgentTimeline.jsx - Decision display
ra_agent/frontend/src/components/decision/DecisionCard.jsx - HTTP client
ra_agent/frontend/src/services/apiService.js - WebSocket client
ra_agent/frontend/src/services/wsService.js
API and delivery
- FastAPI endpoints
ra_agent/backend/main.py - API schemas
ra_agent/backend/schemas/api_models.py - Event streamer
ra_agent/backend/streaming/streamer.py - Earlier decision API
app/main.py
Execution orchestration
- Graph runner
ra_agent/backend/graph/graph_runner.py - Execution manager
ra_agent/backend/graph/execution_manager.py - Decision graph
ra_agent/backend/graph/decision_graph.py - Supervisor
ra_agent/backend/supervisor/supervisor_graph.py - Graph state
ra_agent/backend/schemas/graph_state.py - Earlier decision graph
app/graph.py - Earlier shared state
app/models.py
Decision analysis
- Market analysis
ra_agent/backend/agents/market_agent - Financial analysis
ra_agent/backend/agents/financial_agent - Knowledge analysis
ra_agent/backend/agents/knowledge_agent - Strategy decision
ra_agent/backend/agents/strategy_agent/graph.py - Final report
ra_agent/backend/agents/communication_agent - Financial calculations
ra_agent/backend/core/calculations/financial.py - Advisory agent
ra_agent/backend/agents/advisory_agent/agent.py - Market research
app/nodes/market_research.py - Financial risk
app/nodes/financial_risk.py - Knowledge research
app/nodes/knowledge_agent.py - Strategy planning
app/nodes/strategy_planning.py
Confidence and learning
- Market data reliability
ra_agent/backend/core/reliability/market_data.py - Confidence scoring
ra_agent/backend/core/reliability/confidence.py - Outcome tracker
ra_agent/backend/memory/outcome_tracker.py
Other components
- Business user
Connections 40
- Business user → Query form: enters query
ra_agent/frontend/src/components/chat/QueryForm.jsx - Query form → Chat page: submits input
ra_agent/frontend/src/pages/ChatPage.jsx - Chat page → Decision hook: invokes
ra_agent/frontend/src/pages/ChatPage.jsx - Decision hook → Agent state: updates state
ra_agent/frontend/src/hooks/useDecision.js - Chat page → Agent timeline: renders
ra_agent/frontend/src/pages/ChatPage.jsx - Chat page → Decision display: renders messages
- Decision hook → HTTP client: requests result
ra_agent/frontend/src/hooks/useDecision.js - Decision hook → WebSocket client: sends query
ra_agent/frontend/src/hooks/useDecision.js - HTTP client → FastAPI endpoints: HTTP request
- WebSocket client → FastAPI endpoints: WebSocket events
- FastAPI endpoints → API schemas: validates requests
ra_agent/backend/main.py - FastAPI endpoints → Graph runner: runs decision
ra_agent/backend/main.py - FastAPI endpoints → Event streamer: registers socket
ra_agent/backend/main.py - FastAPI endpoints → Outcome tracker: records outcomes
ra_agent/backend/main.py - Graph runner → Execution manager: deduplicates and caches
ra_agent/backend/graph/graph_runner.py - Graph runner → Decision graph: executes graph
ra_agent/backend/graph/graph_runner.py - Graph runner → Confidence scoring: uses confidence
ra_agent/backend/graph/graph_runner.py - Graph runner → Outcome tracker: reads learning data
ra_agent/backend/graph/graph_runner.py - Graph runner → Supervisor: runs supervisor
- Decision graph → Supervisor: routes analysis
- Supervisor → Market analysis: dispatches
- Supervisor → Financial analysis: dispatches
- Supervisor → Knowledge analysis: dispatches
- Supervisor → Strategy decision: routes strategy
- Supervisor → Final report: routes reporting
- Strategy decision → Financial calculations: uses calculations
- Supervisor → Market data reliability: uses market checks
ra_agent/backend/supervisor/supervisor_graph.py - Supervisor → Event streamer: streams progress
ra_agent/backend/supervisor/supervisor_graph.py - Decision graph → Graph state: uses state
- Strategy decision → Confidence scoring: uses confidence
ra_agent/backend/agents/strategy_agent/graph.py - Strategy decision → Event streamer: streams progress
ra_agent/backend/agents/strategy_agent/graph.py - FastAPI endpoints → Earlier decision API: separate implementation
- Earlier decision API → Earlier decision graph: runs graph
app/main.py - Earlier decision API → Earlier shared state: validates and returns
app/main.py - Earlier decision graph → Market research: fans out
app/graph.py - Earlier decision graph → Financial risk: fans out
app/graph.py - Earlier decision graph → Knowledge research: fans out
app/graph.py - Earlier decision graph → Strategy planning: routes results
app/graph.py - Earlier decision graph → Earlier shared state: uses state
app/graph.py - Business user → Advisory agent: requests advice