Skip to content

Ask an agent to propose a better version of itself from its own record

POST
/api/v1/agents/{name}/reflect
curl --request POST \
--url http://localhost:11044/api/v1/agents/example/reflect \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'

Reads its runs, requests and duty checks for the last 30 days. Proposals change only wording, cadence and duties, never what it may do.

name
required
string

The agent’s name

The proposal, with the record it read and the evidence for each change

Media typeapplication/json

A proposal after reflecting, adopting or dismissing, or why that was refused; answered by the /agents/{name}/reflect and /agents/{name}/proposals/{id} endpoints

object
proposal

The proposal after the change; null when it was refused

object
agent
required

Name of the agent the proposal is for

string
changes
required

The proposed changes, already filtered to the targets a proposal may touch; may be empty when the record supported nothing

Array<object>

One proposed change to an agent: what it targets, the new value, and the reason and evidence for it

object
duty

The duty to add when target is “add-duty”; null otherwise

object
every

Six-field cron the duty is checked on; null means checked on demand

string
holds
required

The view or DERIVE label whose rows are the duty’s violations

string
name
required

Name of the new duty; must not match one the agent already has

string
text
required

The duty’s Always/Never rule, in words

string
evidence
required

The counts from the record that support the change, as the model cited them

string
from

The current value, as the model stated it; not checked against the agent, and null when the model gave none

string
target
required

What the change touches: “job”, “routing”, “persona”, “duty::text”, “duty::every” (an existing duty), or “add-duty” (with duty)

string
to
required

The new value: text for job, routing, persona and duty text, a six-field cron for a duty’s cadence; ignored for add-duty

string
why
required

The model’s reason for the change

string
createdAt
required

When the proposal was made, ISO-8601 instant

string format: date-time
decidedAt

When it was adopted or dismissed, ISO-8601 instant; null while OPEN

string format: date-time
fromVersion

The agent’s latest signed version when the proposal was made, which it improves on; null when the agent had never been signed

integer format: int32
id
required

Proposal id, “pr_” followed by a UUID; the {id} of the adopt and dismiss endpoints

string
ownerId
required

Id of the user whose world the agent belongs to; proposals are private to them

string
proven
required

Whether the proposal has passed a battery and a replay of the period; always false, since neither check exists yet

boolean
record
required

The record the reflection read, as plain-text lines of counts over the period: runs by outcome, requests by status, hours to a decision, the commonest rejection reasons, and each duty’s cadence

string
refused

Why the last attempt to adopt it was refused, because the result would widen what the agent may do; null when no adoption has been refused

string
status
required

OPEN until adopted or dismissed; a refused adoption leaves it OPEN

string
Allowed values: OPEN ADOPTED DISMISSED
summary
required

The model’s one-sentence summary of what the proposal changes

string
refused

Why the change was refused, in words; null when it was made

string

Example

{
"proposal": {
"status": "OPEN"
}
}

No authenticated principal

One of:

A refusal with a machine-readable code and a plain-language message. ApiErrorAdvice answers it for a failed validation, a missing resource or a conflicting state, and some controllers answer it directly

object
code
required

Machine-readable key to branch on, such as validation_failed, unknown_field, not_found or conflict. Open: a surface may answer codes of its own

string
detail

Extra context where there is some, such as the fields a body may carry; null otherwise

string
message
required

A plain-language explanation, written to be shown. Never carries an exception message

string

Example generated

{
"code": "example",
"detail": "example",
"message": "example"
}

No such agent in your world

Refused: the world has no workhorse role, or the model did not answer

Media typeapplication/json

A proposal after reflecting, adopting or dismissing, or why that was refused; answered by the /agents/{name}/reflect and /agents/{name}/proposals/{id} endpoints

object
proposal

The proposal after the change; null when it was refused

object
agent
required

Name of the agent the proposal is for

string
changes
required

The proposed changes, already filtered to the targets a proposal may touch; may be empty when the record supported nothing

Array<object>

One proposed change to an agent: what it targets, the new value, and the reason and evidence for it

object
duty

The duty to add when target is “add-duty”; null otherwise

object
every

Six-field cron the duty is checked on; null means checked on demand

string
holds
required

The view or DERIVE label whose rows are the duty’s violations

string
name
required

Name of the new duty; must not match one the agent already has

string
text
required

The duty’s Always/Never rule, in words

string
evidence
required

The counts from the record that support the change, as the model cited them

string
from

The current value, as the model stated it; not checked against the agent, and null when the model gave none

string
target
required

What the change touches: “job”, “routing”, “persona”, “duty::text”, “duty::every” (an existing duty), or “add-duty” (with duty)

string
to
required

The new value: text for job, routing, persona and duty text, a six-field cron for a duty’s cadence; ignored for add-duty

string
why
required

The model’s reason for the change

string
createdAt
required

When the proposal was made, ISO-8601 instant

string format: date-time
decidedAt

When it was adopted or dismissed, ISO-8601 instant; null while OPEN

string format: date-time
fromVersion

The agent’s latest signed version when the proposal was made, which it improves on; null when the agent had never been signed

integer format: int32
id
required

Proposal id, “pr_” followed by a UUID; the {id} of the adopt and dismiss endpoints

string
ownerId
required

Id of the user whose world the agent belongs to; proposals are private to them

string
proven
required

Whether the proposal has passed a battery and a replay of the period; always false, since neither check exists yet

boolean
record
required

The record the reflection read, as plain-text lines of counts over the period: runs by outcome, requests by status, hours to a decision, the commonest rejection reasons, and each duty’s cadence

string
refused

Why the last attempt to adopt it was refused, because the result would widen what the agent may do; null when no adoption has been refused

string
status
required

OPEN until adopted or dismissed; a refused adoption leaves it OPEN

string
Allowed values: OPEN ADOPTED DISMISSED
summary
required

The model’s one-sentence summary of what the proposal changes

string
refused

Why the change was refused, in words; null when it was made

string

Example

{
"proposal": {
"status": "OPEN"
}
}