johnlindquist / johnlindquist/mdflow

feat: Self-correcting research loop with into.md

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
604
Forks
43
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by reviewing the existing URL imports and command inlines features, then compare the three proposed architectures and resolve the search provider, token limits, citation format, and feature ownership. Done means a selected design with defined behavior and implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, typescript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.