How codefixxx/multiagent_research_assistant works
This repository implements a multi-agent research service: a caller submits a query, background orchestration gathers and reviews evidence, a writer produces a report, and the service validates and returns it. The graph preserves the documented budget-control, durable-run, progress-streaming, and audit capabilities. Some internal connections are based on the README or SOURCE INDEX rather than full source excerpts; unsampled implementation details are not inferred.
Main entry points: builder.py Workflow Graph · job_runner.py Job Service · evidence_collector.py Evidence Collector · llm.py LLM Provider
Components 29
Service API
- FastAPI Service
src/api/main.py - Research Routes
src/api/routes.py - Job Service
src/api/job_runner.py - API Contracts
src/schemas/api.py - SSE Stream
src/api/sse.py
Research Workflow
- Planner
src/agents/planner.py - Researcher
src/agents/researcher.py - Reviewer
src/agents/reviewer.py - Report Writer
src/agents/writer.py - Workflow Graph
src/graph/builder.py - Workflow Supervisor
src/graph/supervisor.py - Budget Guardrails
src/graph/budgets.py - Research State
src/graph/state.py - Citation Validator
src/validators/citation_validator.py - RAG Quality Scorer
src/validators/rag_scorer.py - LLM Provider
src/core/llm.py
Evidence Gathering
- Evidence Collector
src/tools/evidence_collector.py - Web Search
src/tools/search.py - Page Scraper
src/tools/scraper.py - Domain Diversity
src/tools/domain_guard.py - Hacker News
src/tools/hacker_news.py
Run Operations
- Job Queue
src/persistence/queue.py - Redis Persistence
src/persistence/redis_saver.py - Audit Tracing
src/core/tracer.py
Other components
- Research Client
- Redis
- Search Providers
- Research Websites
- LLM Providers
Connections 34
- Research Client → FastAPI Service: submits query
- FastAPI Service → Research Routes: routes requests
src/api/main.py - Research Routes → Job Service: starts or queries
src/api/routes.py - Research Routes → API Contracts: accepts and returns
src/api/routes.py - Research Routes → SSE Stream: creates stream
src/api/routes.py - Job Service → Job Queue: enqueues jobs
src/api/job_runner.py - Job Service → Workflow Graph: executes workflow
src/api/job_runner.py - Job Service → Redis Persistence: persists run state
src/api/job_runner.py - Job Service → Audit Tracing: records execution
src/api/job_runner.py - Job Service → SSE Stream: broadcasts progress
src/api/job_runner.py - Job Queue → Redis: stores queued jobs
- Redis Persistence → Redis: stores checkpoints
- Workflow Graph → Planner: dispatches planning
src/graph/builder.py - Workflow Graph → Researcher: dispatches research
src/graph/builder.py - Workflow Graph → Reviewer: dispatches review
src/graph/builder.py - Workflow Graph → Report Writer: dispatches writing
src/graph/builder.py - Workflow Graph → Workflow Supervisor: routes workflow
src/graph/builder.py - Workflow Supervisor → Budget Guardrails: checks limits
src/graph/supervisor.py - Workflow Graph → Research State: updates state
src/graph/builder.py - Researcher → Evidence Collector: gathers evidence
- Evidence Collector → Web Search: runs searches
src/tools/evidence_collector.py - Evidence Collector → Page Scraper: scrapes pages
src/tools/evidence_collector.py - Evidence Collector → Domain Diversity: filters domains
src/tools/evidence_collector.py - Evidence Collector → Hacker News: adds discussions
src/tools/evidence_collector.py - Web Search → Search Providers: queries providers
src/tools/search.py - Page Scraper → Research Websites: fetches pages
src/tools/scraper.py - Workflow Graph → Citation Validator: validates report
- Job Service → RAG Quality Scorer: scores report quality
src/api/job_runner.py - Planner → LLM Provider: generates plan
- Researcher → LLM Provider: analyzes evidence
src/agents/researcher.py - Reviewer → LLM Provider: evaluates findings
src/agents/reviewer.py - Report Writer → LLM Provider: synthesizes report
src/agents/writer.py - LLM Provider → LLM Providers: uses configured model
src/core/llm.py - Workflow Graph → Report Writer: emergency synthesis
src/graph/builder.py