Skip to content
Projects

Research Swarm

LangGraph research pipeline with cited reports and human-in-the-loop review

Research Swarm interface: model, deployment and depth settings beside the research question box with audience selector

A supervisor agent frames the question, then plans sub-questions. Research stages run on a small local model (gemma4:e2b via Ollama); a larger model (gemma4:31b-cloud) handles planning and writing and can be switched off with one setting. Papers and uploaded documents are ranked by a light LLM scorer and read with no embeddings or vector store; the top arXiv papers are read in full text. One extraction call per batch turns sources into facts, each with a verbatim quote located back in its source. A gap-fill search covers thin sub-questions, a verifier applies a fixed verdict policy in code, and the writer tags every sentence with the facts it rests on so citations are numbered and rendered by code. Reports adapt to the audience (academic, technical, general, executive). An alternative evidence-packet path uses one large-model call over numbered source sentences. 287 tests with all LLMs mocked; runs on Anthropic, OpenAI, Ollama or in-process Hugging Face transformers, with a Gradio app on a Hugging Face ZeroGPU Space.

What it does

  • Question frame enforced in code at every stage (planning, scoring, coverage, verification, writing)
  • No embeddings or vector store: papers ranked by a light LLM scorer, sources read whole; full text of top arXiv papers
  • Every fact carries a verbatim quote located in its source in code; a fact whose quote cannot be found is dropped without an LLM call
  • One verifier call per ten facts with a fixed verdict policy; citations numbered and rendered by code
  • Gap fill re-searches only sub-questions short on grounded evidence; human approve/edit step before the report is written
  • Local-first: small local model for research stages, large model only for planner and writer; per-provider concurrency caps, retry with backoff, session token budgets
  • SSRF-validated URL fetching and prompt-injection scanning; SQLite checkpoints with forward migration
  • FastAPI backend with SSE streaming, Streamlit UI, Docker and Hugging Face Space deployment

Pipeline

  1. 1Supervisor (question frame + plan)
  2. 2Paper Scout / Document Workers (extract with quotes)
  3. 3Deep Read (full text of top arXiv papers)
  4. 4Gap Fill (search sub-questions still thin on evidence)
  5. 5Verifier (fixed verdict policy)
  6. 6Writer (outline → sections → review → code-rendered citations)

Results

SciFact verdict accuracy, evidence-packet path~2k large-model tokens per task0.80
SciFact verdict accuracy, fact-chain path~7.2k large-model tokens per task0.77
Relevance scorer vs word overlapHotpotQAnDCG@10 0.848 vs 0.787