bareagent: Letting Models Decompose Workflows Autonomously
Tight_Heron1730 · reddit · 2026-07-16
This post discusses a key trend: 真正决定 agent 工作流的人是谁, and how the responsibility for task decomposition is evolving from 没人负责 → 人类负责 → 模型负责.
文章中的三种路线
- Ralph: No fixed workflow; repeatedly runs a bash loop with the same prompt, using fresh context each iteration to progress.
- CodeMachine: Humans pre-define the workflow, and the agent executes accordingly.
- RLM: The model treats context as an environment, autonomously decomposing tasks and calling itself recursively, generating its own structure.
作者自己的实现:bareagent
The author implements the RLM (model-led decomposition) approach as a recurse() primitive:
- Supports decompose → fan-out → verify → synthesize
- Gives the model a spawnchild tool to decide whether to split tasks
- Subtasks only receive their local context, returning {result, verdict} or an honest {incomplete}
- Clearly flags failures like truncation, refusal, or context overflow without masking them as successes
- Uses bareguard to manage budget, rounds, and audit logs
工程信息
- 零依赖, Apache-2.0
- Node >= 18, pure JS + JSDoc
- Features 862 个测试
- Supports Anthropic / OpenAI / Gemini / Ollama / CLI-pipe
- The author also mentions companion projects: litectx (memory), barebrowse (web), and baremobile (Android/iOS)
More from coding & agent
- A roundup of AI agents and MCP resources, including how to evaluate agents — _jaydeepkarale · 2026-07-21
- Anthropic shares a masterclass on how it builds AI agents — _jaydeepkarale · 2026-07-21
- Anthropic masterclass spotlights how to build and observe AI agents — _jaydeepkarale · 2026-07-21
- A beginner guide to AI agents points readers to a Stanford webinar — _jaydeepkarale · 2026-07-21
- A full course shows how to build and deploy an AI agent with OpenAI and LangChain — _jaydeepkarale · 2026-07-21
- A practical guide on how to evaluate AI agents — _jaydeepkarale · 2026-07-21