{
  "schema": "leumas.docs.page/1",
  "id": "pkg:@leumas/research",
  "slug": "engines/research",
  "kind": "capabilities",
  "bucket": "package",
  "title": "@leumas/research",
  "name": "@leumas/research",
  "eyebrow": null,
  "chip": null,
  "summary": "Deep-research engine — iterative query -> web-search -> summarize -> reflect loop over @leumas/providers + the websearch/scraping adapters. Exposed as /api/research (JSON + SSE), the deep-research...",
  "keywords": [
    "research",
    "deep-research",
    "web-search",
    "iterative",
    "websearch",
    "research api",
    "leumas research",
    "reflect"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# @leumas/research\n\nThe deep-research engine: an iterative **query → web-search → summarize → reflect** loop\n(ported from the legacy `ollama-research` tool, LangGraph dropped) that any Leumas surface can call.\n\n- **Engine** — `runDeepResearch({ topic, loops, searchApi, provider, onEvent, signal, providerRegistry, adapters, connector })`.\n  LLM calls ride the injected `@leumas/providers` registry; search rides the `websearch` adapter\n  (DuckDuckGo/Wikipedia keyless, Tavily/Perplexity via env keys); full-page enrichment rides the\n  `scraping` adapter. Runs persist to the `research_runs` dynamic collection when a connector is given.\n- **HTTP** — `createResearchRouter(...)` mounted at `/api/research`: `POST /run` (JSON) and\n  `POST /run/stream` (SSE: `start · loop · query · sources · page · summary · reflection · final · done · error`).\n- **Action** — `deepResearchAction(...)` registers the `deep-research` action: rule-callable, and the\n  seeded `research.deep` functioncall (executor kind `action`) makes it a chatbot tool + MCP tool.\n- **Gating** — logged-in + `intelligence` membership (admins bypass) + PassNode `feature:research.run`.\n\nStudio UI: the **Intelligence** domain's Research Lab. Smoke: `pnpm smoke:research` (network-free fakes).\n",
  "source": {
    "path": "shared/engines/research/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 1439,
    "hash": "215aa0779870633a83282f934dd249c1f2077465"
  },
  "urls": {
    "html": "/p/engines/research",
    "json": "/docs/engines/research.json",
    "md": "/docs/engines/research.md"
  },
  "links": {
    "composes": [
      "pkg:@leumas/actions"
    ],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  },
  "exports": null
}
