research-loop

An automated research loop that repeatedly forms questions, searches for answers, adds useful results to a wiki, and evaluates what changed. It runs for up to three iterations by default.

In plain words
What is it for?
Use it to investigate a research program, ingest relevant sources into wiki pages, measure unanswered questions and contradictions, and keep or discard each round's changes.
Why use it?
It provides a repeatable way to expand a wiki while checking whether each round actually improves the answers.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/oshayr/llm-wiki/research-loop
Clone the repo
git clone --depth 1 https://github.com/Oshayr/LLM-Wiki
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 547 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00028 $0.00547
Opus 5 $0.00014 $0.00273
Sonnet 5 $0.00006 $0.00109
Haiku 4.5 $0.00003 $0.00055

Measured 2d ago against content hash e727bac0a340, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

research-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/research-loop.md · 60 lines

How it starts

The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Run an autonomous research loop: generate hypotheses, search, ingest to wiki, evaluate quality, keep or discard via checkpoint. Max 3 iterations by default. Stops on metric plateau or question saturation.

Setup

Resolve .wiki/ from plugin install scope. Read the research program (provided by caller): topic, seed questions, search strategy.

Iteration Loop

1. Checkpoint Baseline

Create a checkpoint of current .wiki/ state as a rollback point.

2. Generate Hypotheses

From the program's seed questions and any remaining open questions from .wiki/overview.md:

  • Pick the 2-3 most promising questions for this iteration
  • Generate search queries targeting these specific questions

3. Search

Launch search-orchestrator with the queries. Receive ranked, deduplicated results.

4. Ingest

For each top result: launch wiki-writer (mode: ingest) to compile into wiki pages.

5. Evaluate

After ingestion, assess:

  • Questions answered: how many of the iteration's questions got substantive answers?
  • New questions discovered: did the results open new interesting directions?
  • Confidence changes: did any pages get upgraded/downgraded?
  • Contradiction count: any new contradictions flagged?

6. Keep or Discard

  • If quality metrics improved (questions answered > 0, net confidence up): keep (commit changes)
  • If no meaningful progress or quality degraded: discard (rollback to baseline)
  • If metric plateau (same scores as last iteration): stop — further iterations won't help

7. Continue or Stop

  • If iteration < max (3): continue to next iteration with updated questions
  • If question saturation (all seed questions answered): stop early
  • If metric plateau: stop early

Output

After the loop completes:

  • Write a deep-dive summary page to .wiki/pages/<topic>-deep-dive.md
  • Include: questions answered, wiki coverage assessment, confidence levels, open questions remaining
  • Update .wiki/log.md with iteration summary

Read the full file on GitHub · 60 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 60 lines · 28 tokens per session scan A e727bac0a340

Subscribe to this mod's changes

research-loop is an agent published in the GitHub repository Oshayr/LLM-Wiki (49 stars, last pushed 4mo ago), licensed MIT. It adds 28 tokens to every session and 547 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.