pub struct Settings {Show 25 fields
pub config_version: Option<String>,
pub streams: BTreeMap<String, StreamCfg>,
pub services: BTreeMap<String, Service>,
pub vars: BTreeMap<String, Value>,
pub agent: Agent,
pub intelligence: Intelligence,
pub mcp: Mcp,
pub tools: Tools,
pub store: Store,
pub memory: Memory,
pub context: Context,
pub knowledge: Knowledge,
pub search: Search,
pub skills: Skills,
pub workflows: Vec<Value>,
pub limits: Limits,
pub lifecycle: Lifecycle,
pub subagents: Subagents,
pub a2a: A2a,
pub interface: Interface,
pub webhooks: Webhooks,
pub goal: Option<Goal>,
pub observability: Observability,
pub security: Security,
pub identity: Identity,
}Expand description
The typed v2 settings document. Every object is deny_unknown_fields;
every section defaults so a minimal document (agent.instruction alone)
is complete.
Fields§
§config_version: Option<String>§streams: BTreeMap<String, StreamCfg>Named durable event streams: {name: {retention: {max_events, max_age}}}. A stream must be declared before an emit or stream node
may reference it — an undeclared name is refused at startup rather than
silently creating a stream nothing retains.
services: BTreeMap<String, Service>The service catalog: the named external services this deployment may
use. Entries carry connection settings, one shared credential,
authoritative trifecta tags and a tool-surface ceiling; mcp.servers
entries reference them via service:. An absent catalog imposes no
constraints at all.
vars: BTreeMap<String, Value>Operator-defined constants, referenced anywhere in this document and in
workflow definitions as {{config.NAME}} (dotted paths reach into
nested values). The template prefix is config. and NOT vars.
because vars.* already names a RUN’s own variables — two things
called vars in one template language would be a permanent trap.
Substitution is fail-closed: a reference to an undefined name refuses startup naming every unresolved reference at once. In workflows the values fold in at LOAD time, so they participate in the definition hash — a var change is a definition change, and in-flight runs stay pinned to the definition they started with.
agent: Agent§intelligence: Intelligence§mcp: Mcp§tools: Tools§store: Store§memory: Memory§context: Context§knowledge: Knowledge§search: Search§skills: Skills§workflows: Vec<Value>Inline workflow definitions or {name, file|uri} references — kept as
raw documents here and typed by the workflow engine, so config loading
never has to know the node registry.
limits: Limits§lifecycle: Lifecycle§subagents: SubagentsSubagent templates + spawn policy: operator-declared definitions the
model may instantiate (filling declared params only), section-wide
defaults, and the freeform-spawn switch.
a2a: A2a§interface: InterfaceThe display-client surface: opt-in TUI/web-UI methods on the A2A
listener (the global SubscribeToEvents feed + interface read ops).
webhooks: WebhooksThe inbound webhook HTTP surface: a dedicated listener for webhook
start nodes and wait: {on: webhook} callbacks.
goal: Option<Goal>The self-correcting goal watchdog: a periodic check of whether the configured goal is achieved (or the agent is stuck).
observability: Observability§security: Security§identity: IdentityWho work is done ON BEHALF OF, and what travels with it.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn from_document(doc: Value, source: &str) -> Result<Settings, String>
pub fn from_document(doc: Value, source: &str) -> Result<Settings, String>
Type a settings document. source names it in errors.
{{config.*}} substitution happens here, before typing — so a var can
sit anywhere a string can: an endpoint, a path, a header. The
workflows array is deliberately left alone; workflow documents are
substituted at LOAD time instead (load_workflows), where the ones
arriving from files, URLs and directories can be treated identically to
inline ones.
Sourcepub fn instance_name(&self) -> String
pub fn instance_name(&self) -> String
The agent.name fallback chain: config › downward-API instance ›
hostname › agentd.
Sourcepub fn is_long_lived(&self) -> bool
pub fn is_long_lived(&self) -> bool
Whether this instance OUTLIVES a single run — it serves A2A or webhooks,
watches a goal, or owns a workflow with a long-lived start node
(loop/schedule/subscribe/signal/event/a2a/webhook).
This is the durability predicate: a job-shaped run can lose its state
and simply be re-run, while an instance that keeps running cannot. Two
callers need exactly the same answer — load, which defaults such an
instance to the file store, and validate, which refuses an EXPLICIT
store.kind: none here — so the predicate lives in one place instead of
being spelled out twice and diverging.