This doc describes how agent capabilities are defined, set, validated, and used so you can extend or add new ones. For setting up and using agents (project init, CLI, HTTP server, DAL APIs, molds, evolve), see guides/AGENT_SETUP_AND_USAGE.md.
| Place | Purpose |
|---|---|
AgentConfig.capabilities |
Per-agent list of capability strings (stored on the agent context). |
builtin_capabilities(AgentType)
(Rust) |
Default list per type used when no registry override exists. |
CAPABILITY_REGISTRY (Rust) |
Optional override: per–agent-type list used by validation instead of built-ins. |
Mold agent.capabilities |
Capabilities for agents spawned from that mold. |
DAL agent block /
create_agent_config |
Capabilities supplied from DAL (agent declaration or config map). |
agent::spawn)AgentConfig::new(name, agent_type)
creates config with
capabilities: Vec::new().initialize_<type>_agent(agent_context)
is called and overwrites
agent_context.config.capabilities with the type-specific
list (see table below).So by default, every spawned agent gets the list from the initializer for its type. No separate “registration” step is required for these defaults.
AgentConfig::with_capabilities(vec!["cap1", "cap2"])
when building the config. If you build the config yourself and then
spawn, the initializer will still overwrite capabilities
unless you change the flow (e.g. only run initializer when capabilities
are still empty, or set capabilities after init).agent block, set
capabilities. When creating
AgentConfig from the mold, the runtime uses
config.with_capabilities(mold.agent.capabilities.clone())
(mold/mod.rs), so the mold’s list is applied when spawning
from that mold.create_agent_config-style flow in
engine.rs), it reads
fields["capabilities"] and, if present and
a list of strings, calls
config.with_capabilities(capability_strings).
So DAL can supply capabilities via the config map.agent statements,
agent_stmt.capabilities is copied onto
ai::AgentConfig when executing the
declaration. So the list you write in the agent block in DAL is what
that AI agent gets.So “building out” capabilities for an agent means: either rely on the built-in list for that type, or set/override via config (Rust builder, mold, or DAL config/agent block).
Defined in src/stdlib/agent.rs:
builtin_capabilities(AgentType)
(used for validation when registry is not set):
analysis, learning,
communication, task_executionmonitoring,
coordination, resource_managementtask_execution,
data_processing, automationcustom_processinginitialize_<type>_agent (sets
actual config at spawn):
problem_solvingsystem_optimizationworkflow_managementcustom_processing,
adaptation, flexibilityValidation uses either the registry (if set) or
builtin_capabilities; it does
not read the per-agent
AgentContext.config.capabilities — it only checks that the
agent type has the required capabilities in the
registry/built-in list.
agent::validate_capabilities(agent_type, required_capabilities)
Checks that the type’s allowed set (registry or
built-in) contains every string in required_capabilities.
Used to decide “can this type do this?” (e.g. before assigning a task).
It does not look at a specific agent instance’s
config.capabilities.
AgentContext::is_capable(capability)
Checks whether this agent’s
config.capabilities contains the given string. So per-agent
overrides (mold, DAL, or manual config) are reflected here.
So:
builtin_capabilities and/or the
corresponding
initialize_<type>_agent list (and
optionally register_capabilities if you
use the registry).with_capabilities (Rust), mold
agent.capabilities, or DAL config / agent
block; then is_capable will reflect
it.src/stdlib/agent.rs:
builtin_capabilities(AgentType),
add the new string to the appropriate type’s vec![].initialize_<type>_agent for
that type, add the same string to
agent_context.config.capabilities.validate_capabilities will accept it for
that type.agent::register_capabilities(agent_type_string, vec!["cap1", "cap2", ...]).builtin_capabilities for that
agent_type. Spawn initializers still set
config.capabilities per agent; the
registry only affects validation..with_capabilities(vec!["my_cap", ...])
and spawn. The initializer will overwrite unless you change init to
respect existing capabilities (e.g. only set when empty).agent block set
capabilities: ["my_cap", ...].capabilities to a list of strings.Then is_capable("my_cap") will be true
for that agent; validate_capabilities will
only accept it if the type’s built-in/registry list also includes
"my_cap" (if you validate that type for that
capability).
AgentType (e.g.
Custom("my_type") or a dedicated
variant).builtin_capabilities, add a branch
returning the new type’s list.initialize_<type>_agent (or a
new initializer), set
agent_context.config.capabilities for the
new type.builtin_capabilities and in
initialize_*_agent; optionally in
CAPABILITY_REGISTRY; and in molds/DAL as
capabilities on config or agent
block.with_capabilities (Rust), mold
agent.capabilities, or DAL config
/ agent block.validate_capabilities(agent_type, required)
using registry or
builtin_capabilities.AgentContext::is_capable(capability) using
the agent’s config.capabilities.To build out agent capabilities you either extend the built-in/init
lists and optionally the registry, or supply custom lists per agent via
config/mold/DAL; validation and is_capable
then reflect those choices.