Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Building Sub‑Agents for a Desktop AI Companion

说明与用途

为桌面 AI 伴侣 Ankita 构建子代理,隔离任务、限制上下文并返回简洁的封装,防止在同时处理多项任务时出现历史膨胀和阻塞。

问题

A single AI agent on a desktop can only handle one conversation at a time, causing context ballooning and blocking when it tries to perform multiple independent tasks.

结果

Sub‑agents keep the parent’s context small, enforce isolation, and provide a clear, capped report for each task, improving reliability and auditability.

工作流

  • 1. Parent agent receives a user request.
  • 2. Parent calls delegate_task with a brief and a sub‑agent type (explore, reviewer, or worker).
  • 3. Sub‑agent runs its own tool loop with a depth of 1 and bounded budgets.
  • 4. Sub‑agent produces a capped envelope (status, summary, final answer, tools, token usage, duration, transcript path).
  • 5. Parent receives the envelope, verifies the report, and updates its state.
  • 6. Parent repeats for subsequent requests, serializing workers per workspace path to avoid conflicts.

证据

Sooner or later, any agent like that hits the same wall: one conversation trying to do three independent jobs at once. The parent's context balloons, the work interleaves, and a long task blocks everything behind it.

来源

A child in Ankita sees only its brief — the prompt passed to delegate_task. It cannot ask questions and cannot delegate.

来源

When it finishes, the parent receives one result envelope: status, a summary capped at 2,000 bytes, the full final answer capped at 48,000 bytes by default, the tools used, token usage, duration, and a transcript path.

来源

There are exactly three child types, defined in src/core/subagents/registry.mjs…

来源

Workers are the opposite: a mutation barrier. One worker runs at a time across the whole process, keyed by the canonical workspace path…

来源

  • 记录日期: 2026-11-01T20:44:15.033Z