Seshat AIDocumentation

Documentation / Concepts

Agents and delegation

How an agent hands work to sub-agents, runs them in the background, keeps them under control, and what is not available yet.

A single agent working through a large task fills its context quickly. Seshat lets an agent delegate: it starts a sub-agent with a self-contained task, the sub-agent works on its own with a limited set of tools, and only its result comes back.

  • Main agentTalks to you, plans, decides what to delegate
    • exploreRead-only: read, glob, grep
    • planDesigns an approach before anything changes
    • general-purposeDoes a self-contained piece of work
      • helperA sub-agent of a sub-agent, within the depth limit
    • verifyChecks the result

Two ways to delegate

The agent tool runs a sub-agent and waits for its answer. The main agent chooses a type and writes the task.

ParameterMeaning
typegeneral-purpose, explore, plan, browse or verify
taskA self-contained description: paths, goal, constraints, what to return
max_turnsTurn limit for the sub-agent
run_in_backgroundReturn immediately with a task id and let it run
forkGive the sub-agent the parent’s message history
isolationworktree runs it in its own git worktree, so its changes stay apart until merged
toolsRestrict its tools to a list of patterns

The background family starts an agent that keeps running while the main agent continues:

ToolUse
spawn_agentStart a background sub-agent
send_agent_messageSteer it between turns
wait_agentBlock until it finishes and read its result
list_agentsSee what is running
resume_agentContinue one that stopped
close_agentStop it

Built-in agent types

TypeFor
general-purposeA self-contained piece of work with the full toolset
exploreUnderstanding a codebase, read-only
planDesigning an approach
browseDeep read-only research across the web, documents and code
verifyChecking work that was done

A skill whose context is fork also runs as an isolated sub-agent. See Skills and MCP.

Keeping it under control

Delegation can run away if nothing stops it, so the runtime sets limits:

LimitDefault
Delegation depth (A starts B starts C)3, adjustable up to 5
Background agents running at once, across the process8
Turns for a sub-agentLower than the top-level default, unless the agent type says otherwise
Wall-clock time of one sub-agent30 minutes, as a safety net for an agent that is stuck

Permissions of a sub-agent

Starting an agent is itself an action that asks for approval, like any other tool. Once you approve it, the sub-agent runs without asking again for each tool, within the tools it was given. That is why the tool list matters: explore can only read, and you can narrow any agent further with the tools parameter.

Teams of persistent agents

The repository also contains building blocks for persistent agents that have a name, a role and a mailbox, and message each other asynchronously: agent profiles, a mailbox stored in SQLite, a dispatcher that sends, replies and broadcasts, and a bus that polls each inbox.

Next

Updated on 2026-10-07