Skip to content

feat: Self-correcting research loop with into.md #7

@johnlindquist

Description

@johnlindquist

Summary

Create a self-correcting research loop where agents can search the web, read results via into.md, and refine their answers - enabling RAG-like capabilities without a vector database.

Concept

---
harness: claude
research: true  # Enable web research mode
---

What are the best practices for React Server Components in 2024?

# Agent behavior:
# 1. Generate search queries based on the question
# 2. Fetch top results via into.md
# 3. Synthesize answer from sources
# 4. Optionally: identify knowledge gaps and repeat

How It Would Work

  1. Agent generates search queries (via tool call or structured output)
  2. Execute search (via existing search tools or new integration)
  3. For each result URL, fetch through into.md
  4. Feed converted markdown back to agent as context
  5. Agent synthesizes final answer with citations
  6. Optional: agent identifies gaps, requests more searches

Architecture Options

Option A: Built-in Research Mode

research:
  enabled: true
  max_searches: 3
  sources_per_search: 5
  synthesize: true

Option B: Research Agent Template

Provide a RESEARCHER.md agent that users can chain:

ma RESEARCHER.md "React Server Components best practices" | ma SUMMARIZER.md

Option C: Tool Integration

Expose into.md as a tool the agent can call:

Agent: I need to look up the React docs
Tool call: fetch_url("https://react.dev/reference/rsc/...")
Tool result: [converted markdown]
Agent: Based on the docs, here's the answer...

Use Cases

  • Technical Research: Deep dives with source citations
  • Fact Checking: Verify claims against live sources
  • Trend Analysis: What's the current state of X?
  • Documentation Q&A: Answer questions from live docs

Implementation Notes

  • This is a higher-level feature building on URL imports
  • Requires search integration (Google, Bing, or existing MCP tools)
  • Token management crucial - sources can be large
  • Need to track and cite sources in output

Questions for Discussion

  • Which search provider to integrate with?
  • How to handle token limits when sources are large?
  • Should this be a core feature or a separate "research" harness?
  • How to format citations in output?

Related

This is part of exploring into.md integration opportunities. Builds on:

  • URL imports feature
  • Command inlines feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions