Autonomous Research Loop (propose-only)
Drives the KG's self-evolution golden loop — one cycle of:
- Intake — unresolved
Concepttopics (noADDRESSED_BYedge). - Acquire — semantically related sources per topic (vector search over the
KG; optional external X/SearXNG/scholarx when
KG_RESEARCH_EXTERNAL=1). - Resolve — write
ADDRESSES/ADDRESSED_BYedges so the loop converges (addressed topics stop re-surfacing; new open topics rise). - Distil (optional,
KG_GOLDEN_DISTILL=1) —SpecDraftmarkdown written to.specify/specs/kg-distilled/(DRAFTS only). - Synthesize — a
TeamSpec/AgentSpecproposal addressing the topics, persisted to the KG (not executed).
Propose-only guarantee: no code execution, no PR merge, no edits outside
.specify/ drafts and KG proposal nodes.
Run it
On-demand via the graph-os MCP orchestration tool:
graph_orchestrate(action="golden_loop", max_topics=5)
…or directly:
KG_DAEMON_ROLE=client python -c \
"from agent_utilities.knowledge_graph.research.golden_loop import run_golden_loop_cycle; \
import json; print(json.dumps(run_golden_loop_cycle(max_topics=5), default=str, indent=2))"
Always-on daemon (optional)
Set KG_GOLDEN_LOOP=1 (interval KG_GOLDEN_LOOP_INTERVAL, default 3600s) on the
host daemon (gateway / graph-os-daemon) to run the cycle continuously and
throttled behind the foreground gate. Off by default (autonomous LLM work is
opt-in). Still propose-only.
Output
A JSON report: topics_intake, topics_resolved, sources_linked,
spec_drafts (paths), team (lead + members + persisted node/edge counts),
errors.
Prerequisites
- Embeddings backfilled (the host daemon's
embed_backfillthread) so acquire's vector search has substrate. - A reachable graph backend (tiered: epistemic L1 + pggraph L3).