Layer 4 · agent
agent
The definition of an agent. An agent is a principal of kind Agent with a name. Its behaviour is fixed by an immutable revision: a role, instructions held as content, a model or route for each use, the tools it may call, the knowledge it is given and its budget limits. A change is a new revision, never an edit. A revision is published, may be retired, and a retired revision is refused wherever it would be used.
Depends on
- knowledge · layer 3 · 4 references
- tool · layer 3 · 4 references
- model · layer 2 · 5 references
- principal · layer 1 · 8 references
- shared · layer 0 · 9 references
Used by
Entities
Agent
A named agent and the principal it answers as. Active until retired; retiring it retires every revision.
Identified by agent_id (AgentId).
| field | type | meaning |
|---|---|---|
principal_id | PrincipalId | The principal of kind Agent this definition stands for. |
name | Name | |
defined_at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
principalreferences Principal of principal (one, byprincipal_id)
Lifecycle of Agent
Retired.AgentRevision
One immutable definition of an agent. No command changes its fields after it is published; only its state moves, from Published to Retired.
Identified by agent_revision_id (AgentRevisionId).
| field | type | meaning |
|---|---|---|
agent_id | AgentId | |
number | integer | The revision's place in the agent's history, counted from 1. |
role | Name | What the agent is for, for example operator or reviewer. |
instructions | Content | |
models | list of ModelBinding | |
tools | list of ToolId | The tools the agent may call; a tool not listed is not granted. |
knowledge | list of KnowledgeId | |
budget | BudgetLimits | |
published_at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
agentreferences Agent (one, byagent_id)toolsreferences Tool of tool (many, bytools)knowledgereferences KnowledgeItem of knowledge (many, byknowledge)
Lifecycle of AgentRevision
Retired.RevisionUsage
One use of a revision, kept apart from the revision so that the revision stays as it was published. Each use records one; the newest of a revision is its last use.
Identified by usage_id (RevisionUsageId).
| field | type |
|---|---|
agent_revision_id | AgentRevisionId |
used_at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
revisionreferences AgentRevision (one, byagent_revision_id)
Lifecycle: one state, Recorded; a recorded RevisionUsage does not change.
Commands
DefineAgent
Define an agent.
| field | type |
|---|---|
agent_id | AgentId |
principal_id | PrincipalId |
name | Name |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-principal refused | no Principal for principal_ | Unknown: No principal of this identity is registered. |
principal-not-agent refused | the Principal of principal_ has kind != Agent | Principal: The principal is not of kind Agent, so no agent can stand for it. |
principal-retired refused | the Principal of principal_ has state == Retired | Principal: A retired principal takes no new agent. |
defined | otherwise | creates a Agent in Active; emits Agent |
More columns: swipe horizontally, or focus the table and use the arrow keys.
PublishRevision
Publish an agent revision. Fixes one definition of the agent. The revision is never edited afterwards; a change is another revision.
| field | type |
|---|---|
agent_revision_id | AgentRevisionId |
agent_id | AgentId |
number | integer |
role | Name |
instructions | Content |
models | list of ModelBinding |
tools | list of ToolId |
knowledge | list of KnowledgeId |
budget | BudgetLimits |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
invalid-number refused | number < 1 | Invalid: The revision number is not at least 1. |
no-model refused | models. | No: A revision names at least one model or route; it names none. |
no-such-agent refused | no Agent for agent_ | Unknown: No agent of this identity is defined. |
agent-retired refused | the Agent of agent_ has state == Retired | Agent: The agent is not in a state this command acts from. |
published | otherwise | creates a AgentRevision in Published; emits Agent |
More columns: swipe horizontally, or focus the table and use the arrow keys.
RetireAgent
Retire an agent.
| field | type |
|---|---|
agent_id | AgentId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-agent refused | no such Agent | Unknown: No agent of this identity is defined. |
retired | otherwise | moves the Agent Active → Retired; moves each AgentRevision with agent_ to Retired; emits Agent |
wrong-state refused | the Agent is in a state that does not allow it | Agent: The agent is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
RetireRevision
Retire an agent revision.
| field | type |
|---|---|
agent_revision_id | AgentRevisionId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-revision refused | no such AgentRevision | Unknown: No revision of this identity is published. |
retired | otherwise | moves the AgentRevision Published → Retired; emits Agent |
wrong-state refused | the AgentRevision is in a state that does not allow it | Revision: The revision is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
UseRevision
Use an agent revision. Names a revision as the one a session or an assignment runs. Default deny: a retired revision is refused, and so is one that was never published.
| field | type |
|---|---|
agent_revision_id | AgentRevisionId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-revision refused | no AgentRevision for agent_ | Unknown: No revision of this identity is published. |
retired refused | the AgentRevision of agent_ has state == Retired | Revision: The revision is retired and is not used. |
used | otherwise | creates a RevisionUsage in Recorded; emits Agent |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Events
| event | fields | emitted by |
|---|---|---|
AgentDefined | agent_ AgentId, principal_ PrincipalId, name Name, at timestamp | Define |
AgentRetired | agent_ AgentId, at timestamp | Retire |
AgentRevisionPublished | agent_ AgentRevisionId, agent_ AgentId, number integer, role Name, at timestamp | Publish |
AgentRevisionRetired | agent_ AgentRevisionId, at timestamp | Retire |
AgentRevisionUsed | usage_ RevisionUsageId, agent_ AgentRevisionId, at timestamp | Use |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Views
| view | rows | fields |
|---|---|---|
AgentRevisionsAgent revisions | each AgentRevision | agent_ AgentRevisionId, agent_ AgentId, number integer, role Name, instructions Content, models list of ModelBinding, tools list of ToolId, knowledge list of KnowledgeId, budget BudgetLimits, published_ timestamp, state State |
AgentsAgents | each Agent | agent_ AgentId, principal_ PrincipalId, name Name, defined_ timestamp, state State |
RevisionUsagesRevision usages | each RevisionUsage | usage_ RevisionUsageId, agent_ AgentRevisionId, used_ timestamp, state State |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Types
| type | is | values or fields |
|---|---|---|
BudgetLimitsCeilings on one run of the agent. An absent limit is no limit, which a gate or an architecture may refuse. | a record | max_ optional integer, max_ optional integer, max_ optional Money, max_ optional integer |
ModelBindingThe model an agent uses for one use. | a record | use ModelUse, target ModelTarget |
ModelTargetWhat a model use points at: one model directly, or a route that resolves to a model at call time. Exactly one, by construction. | exactly one of | Model ModelId, Route RouteId |
ModelUseWhat a model is used for inside the agent: the main loop, cheap side calls such as titles and summaries, or a second opinion on the agent's own work. | one of | Primary, Fast, Review |
RevisionUsageIdThe identity of one use of a revision. | an identifier or value | uuid |
More columns: swipe horizontally, or focus the table and use the arrow keys.
KPIs
5 KPIs from the KPI catalogue. A gate must be zero for a variant of an architecture to count.
Correctness
| KPI | unit | better | gate | status |
|---|---|---|---|---|
unpinned_agent_runsRuns that started without an immutable agent revision. How: RunStarted events whose assignment has no AgentRevisionUsed of a published revision. Must be 0. | count | lower | gate | planned source: design |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Quality
| KPI | unit | better | gate | status |
|---|---|---|---|---|
sub_agents_startedSub-agents started in a window. How: AgentStarted events with a parent agent, per session. Concurrency helps only on the largest tasks, so compare per task size. By work mode: autonomous: ignore, pairing: lower, review: lower | count | lower | – | computed today source: docs/kpis.md |
agent_tree_depthDeepest chain of parent and sub-agent in a session. How: Longest path of parent_agent_id links over AgentStarted events of one session. | count | lower | – | planned source: design |
subagent_cost_shareShare of the cost spent by sub-agents. How: cost_usd of model turns with scope sub divided by cost_usd of all model turns. The report already splits models by scope main and sub. | share | lower | – | computed today source: docs/kpis.md |
agent_time_cost_usdCost of agent time at the hourly price of an agent, over the horizon. How: Seconds each agent copy is alive over the horizon, in hours, times the agent hour price. The simulator adds it to the cost of model messages in cost_usd. | usd | lower | – | simulated source: design |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Settings
The settings a part of this block carries in an architecture document. agenticspec sim check refuses any other setting (setting_unknown) and a value outside its type (setting_invalid), and a part that lacks a setting marked required in the default column; the contract copies a setting into the ports it narrows. The last rows of each table are the settings every part takes. What no setting here types (a file, a path, an audience, the use of a model) goes into the part's notes, a map with free keys and values that the check takes as written and nothing reads.
A part agent:
| setting | type | unit | default | contract | what |
|---|---|---|---|---|---|
harness | string | harness., harness. | The kind of harness the agent runs in, a row a field registers. | ||
role | string | harness. | The role of the behaviour profile the agent plays; without one, the profile's default role. | ||
acts_for | part | harness. | The principal the agent acts for. | ||
coordination | enum Coordination: orchestrator, board, mesh, none | none | How the copies of the agent coordinate. | ||
start_stagger | duration of at least 0s | 0s | The time between the starts of two copies. | ||
partition | enum: scope | scope: each copy works on its own part of the scope, so copies do not collide. | |||
strictness | string | balanced | The entry of the profile's review strictness a reviewer agent judges with. | ||
false_accept | number from 0 to 1 | share | The share of wrong results a reviewer agent accepts; with false_reject, replaces the strictness entry. | ||
false_reject | number from 0 to 1 | share | The share of right results a reviewer agent sends back. | ||
method | string | The label of the method the agent follows, when an experiment compares methods. | |||
model_share | shares | The share of the agent's model calls each model part it reaches gets; without it, equal shares. | |||
max_cost | number of at least 0 | USD | harness. | The spend cap of one run of the agent on a task, the max_cost of its revision's budget limits: a run that has spent it makes no further model call and ends; without it, no cap. | |
count | integer of at least 1 | 1 | How many copies of the part run. | ||
per | part | One copy of the part for each copy of the named part. | |||
notes | notes | Free notes on the part, a map with keys and values of any kind: what no setting of its block types. The check takes any map; the simulator, the search and the contract never read it. |
More columns: swipe horizontally, or focus the table and use the arrow keys.