How ayushdevadiga1/insight-swarm works
InsightSwarm is a multi-agent fact-checking application with a React interface, FastAPI gateway, and debate orchestrator. Users submit a claim; the pipeline estimates complexity, decomposes compound claims, retrieves evidence, runs adversarial arguments and source verification, may pause for human review, then produces a moderated, calibrated verdict that streams to the UI. The graph preserves the README’s documented research and result capabilities. Some pipeline wiring is documented rather than visible in sampled code; unsampled implementation details are not inferred.
Main entry points: debate.py Debate orchestrator · client.py LLM client · App.jsx Debate interface · server.py REST and SSE API
Components 23
User interface
- Debate interface
frontend/src/App.jsx - Live event hook
frontend/src/hooks/useSSE.js - Debate state
frontend/src/store/useDebateStore.js - Human review panel
frontend/src/components/hitl/HITLPanel.jsx - Verdict and metrics
frontend/src/components/results/MetricsGrid.jsx
API gateway
- REST and SSE API
api/server.py
Claim analysis
- Debate orchestrator
src/orchestration/debate.py - Claim complexity
src/novelty/claim_complexity.py - Sub-claim decomposition
src/utils/claim_decomposer.py - Pro agent
src/agents/pro_agent.py - Con agent
src/agents/con_agent.py - Debate summarizer
src/utils/summarizer.py
Evidence and results
- Evidence retrieval
src/utils/tavily_retriever.py - Source verification
src/agents/fact_checker.py - Verdict moderation
src/agents/moderator.py - Fallacy analysis
src/novelty/argumentation_analysis.py - Confidence calibration
src/novelty/confidence_calibration.py - Verdict explainability
src/novelty/explainability.py
Runtime services
- Claim cache
src/orchestration/cache.py - LLM client
src/llm/client.py
Other components
- Claim submitter
- LLM providers
- Web sources
Connections 28
- Claim submitter → Debate interface: submits claim
- Debate interface → Live event hook: starts stream
frontend/src/App.jsx - Live event hook → REST and SSE API: opens /stream
frontend/src/hooks/useSSE.js - REST and SSE API → Debate orchestrator: runs debate
api/server.py - Debate orchestrator → Claim complexity: estimates depth
- Debate orchestrator → Sub-claim decomposition: decomposes claim
src/orchestration/debate.py - Debate orchestrator → Evidence retrieval: retrieves evidence
src/orchestration/debate.py - Evidence retrieval → Web sources: searches
- Debate orchestrator → Pro agent: dispatches
src/orchestration/debate.py - Debate orchestrator → Con agent: dispatches
src/orchestration/debate.py - Debate orchestrator → Debate summarizer: summarizes rounds
src/orchestration/debate.py - Debate orchestrator → Source verification: verifies sources
src/orchestration/debate.py - Source verification → Web sources: fetches cited URLs
src/agents/fact_checker.py - Debate orchestrator → Verdict moderation: requests verdict
src/orchestration/debate.py - Verdict moderation → Fallacy analysis: analyzes arguments
- Verdict moderation → Confidence calibration: calibrates confidence
- Debate orchestrator → Verdict explainability: explains verdict
- Debate orchestrator → Claim cache: reads and writes
src/orchestration/debate.py - Pro agent → LLM client: requests completion
src/agents/pro_agent.py - Con agent → LLM client: requests completion
src/agents/con_agent.py - Source verification → LLM client: requests completion
src/agents/fact_checker.py - Verdict moderation → LLM client: requests completion
src/agents/moderator.py - LLM client → LLM providers: calls providers
- REST and SSE API → Live event hook: emits debate events
- Live event hook → Debate state: updates state
frontend/src/hooks/useSSE.js - Debate interface → Human review panel: renders review
frontend/src/App.jsx - Debate interface → Verdict and metrics: renders results
frontend/src/App.jsx - REST and SSE API → Debate orchestrator: resumes review
api/server.py