How tuanduy35399/ml-research-agent works
This is a web application for multi-agent research: a user submits a question, the backend plans up to three subquestions, embeds and classifies them, runs web-search agents, and produces a sourced Markdown report. The interface also supports workflow monitoring, session history, report access, and an ML dashboard. The graph reflects documented API routes and sampled calls; some unsampled subsystem links are omitted rather than inferred.
Main entry points: main.tsx Application shell · pipeline.py Research pipeline · api.py FastAPI endpoints · ml_service.py ML service
Components 25
Web interface
- Application shell
frontend/src/main.tsx - Research view
frontend/src/components/Research.tsx - Workflow view
frontend/src/components/Workflow.tsx - Session history
frontend/src/components/SessionHistory.tsx - Reports view
frontend/src/components/Reports.tsx - ML dashboard
frontend/src/components/MLDashboard.tsx - Workspace state
frontend/src/state/useWorkspace.ts - Research API client
frontend/src/services/researchService.ts - ML API client
frontend/src/services/mlService.ts
Research backend
- FastAPI endpoints
agent_service/src/api.py - Research session service
agent_service/src/research_service.py - Research pipeline
agent_service/src/pipeline.py - Plan and task preparation
agent_service/src/phases.py - Research agents
agent_service/src/phases.py - Search and report tools
agent_service/src/tools.py - LLM access
agent_service/src/llm.py
ML classification
- ML service
agent_service/src/ml_service.py - Embedding and SVM
ML/topic_classifier.py - Topic search policies
agent_service/src/topics.py
Session and reports
- JSON session store
agent_service/src/store.py - Session and report files
agent_service/src/settings.py
Other components
- Research user
- Jina embeddings
- Tavily search
- LLM provider
Connections 29
- Research user → Research view: submits question
README.md - Application shell → Research view: renders
frontend/src/main.tsx - Application shell → Workflow view: renders
frontend/src/main.tsx - Application shell → Session history: renders
frontend/src/main.tsx - Application shell → Reports view: renders
frontend/src/main.tsx - Application shell → ML dashboard: renders
frontend/src/main.tsx - Application shell → Workspace state: uses state
frontend/src/main.tsx - Workspace state → Research API client: calls
frontend/src/state/useWorkspace.ts - Research view → Research API client: starts research
frontend/src/components/Research.tsx - ML dashboard → ML API client: requests ML data
frontend/src/components/MLDashboard.tsx - Research API client → FastAPI endpoints: calls research routes
README.md - ML API client → FastAPI endpoints: calls ML routes
README.md - FastAPI endpoints → Research session service: dispatches sessions
agent_service/src/api.py - FastAPI endpoints → ML service: serves ML endpoints
agent_service/src/api.py - Research session service → Research pipeline: runs pipeline
agent_service/src/research_service.py - Research session service → JSON session store: persists sessions
agent_service/src/research_service.py - Research pipeline → Plan and task preparation: prepares tasks
agent_service/src/pipeline.py - Research pipeline → ML service: classifies tasks
agent_service/src/pipeline.py - Research pipeline → Research agents: runs task agents
agent_service/src/pipeline.py - Research pipeline → Search and report tools: creates report
agent_service/src/pipeline.py - Plan and task preparation → LLM access: plans questions
agent_service/src/phases.py - Research agents → Search and report tools: uses search tools
agent_service/src/phases.py - ML service → Embedding and SVM: embeds and predicts
agent_service/src/ml_service.py - ML service → Topic search policies: selects policy
agent_service/src/ml_service.py - Research pipeline → Jina embeddings: requests embeddings
agent_service/src/pipeline.py - Search and report tools → Tavily search: searches web
README.md - LLM access → LLM provider: sends prompts
README.md - Embedding and SVM → Jina embeddings: requests vectors
README.md - JSON session store → Session and report files: writes JSON
agent_service/src/store.py