# Research Loop Starter — Operator Loops

> A complete autonomous research workflow template. Drop it into any agent framework that supports YAML-defined tools or Python-based agents.

> **Free download** — part of the Operator Loops spec preview.

---

## What this does

Spins up a multi-step research agent that:

1. Accepts a research question or topic
2. Generates a structured search plan (subtopics, angles, sources)
3. Runs each search in parallel using web tools
4. Deduplicates and ranks results by relevance
5. Synthesizes a structured summary with citations
6. Delivers output as markdown to a destination (file, Slack, email, etc.)

---

## Files in this kit

```
research-loop-starter/
  README.md               <- this file
  workflow.yaml           <- agent workflow definition
  skill.md                <- Hermes-compatible skill file
  prompts/
    planner.txt           <- search plan generation prompt
    synthesizer.txt       <- synthesis prompt
  scripts/
    run.py                <- standalone runner (Python 3.10+)
  examples/
    example-output.md     <- sample output for "AI inference trends 2025"
```

---

## Quick start (Hermes Agent)

```bash
# 1. Copy skill.md to your skills directory
cp skill.md ~/.hermes/profiles/engineer/skills/research-loop.md

# 2. Run it
hermes "Research the top 5 AI agent frameworks in 2025 and compare their strengths" \
  --skill research-loop
```

## Quick start (standalone Python)

```bash
pip install openai httpx rich
export OPENAI_API_KEY=replace-with-your-api-key

python scripts/run.py \
  --query "What are the best practices for prompt caching in 2025?" \
  --output report.md
```

---

## Customization points

| Variable | Default | Description |
|---|---|---|
| `MAX_SEARCHES` | 5 | Max parallel web searches |
| `DEPTH` | 2 | How many follow-up queries per topic |
| `OUTPUT_FORMAT` | `markdown` | `markdown` \| `json` \| `slack` |
| `MIN_SOURCES` | 3 | Minimum sources before synthesis |

---

## Adapting to other frameworks

### LangGraph

The `workflow.yaml` maps 1:1 to a StateGraph. Each step is a node; edges are defined in the `transitions` block.

### CrewAI

Each agent role in the yaml (`planner`, `searcher`, `synthesizer`) maps to a CrewAI `Agent`. The `tasks` block maps to `Task` objects.

---

*This is a free starter template from the Operator Loops spec preview. More templates coming soon.*
