pub struct AgentConfig {Show 22 fields
pub model: ModelConfig,
pub instruction: Option<Template>,
pub query: Template,
pub tools: Vec<ToolRef>,
pub max_iterations: u32,
pub max_tool_calls_per_turn: Option<usize>,
pub parallel_tool_calls: bool,
pub memory: Option<MemoryConfig>,
pub vision: VisionConfig,
pub require_approval: Vec<String>,
pub max_tool_output_chars: usize,
pub keep_tool_images: Option<usize>,
pub stream_tool_turns: bool,
pub tool_context: Map<String, Value>,
pub skills: Vec<String>,
pub learning: Option<Value>,
pub context_window: Option<Value>,
pub long_term_memory: Option<Value>,
pub subagents: Option<Value>,
pub max_parallel_subagents: Option<usize>,
pub max_subagent_calls: Option<usize>,
pub retry_safe_tools: Vec<String>,
}Expand description
Configuration of the agent node.
Fields§
§model: ModelConfig§instruction: Option<Template>System prompt.
query: TemplateUser message (default {{#sys.query#}}).
tools: Vec<ToolRef>§max_iterations: u32Maximum model calls. Default 10.
max_tool_calls_per_turn: Option<usize>Tool calls beyond this number in one turn are rejected with an error result.
parallel_tool_calls: bool§memory: Option<MemoryConfig>§vision: VisionConfig§require_approval: Vec<String>Tools that need host approval: provider/name, a tool name, or * for all.
max_tool_output_chars: usizeTool results longer than this (in characters) are truncated. Default 32 000.
keep_tool_images: Option<usize>Keep the images of only the last N image-bearing tool results in the
conversation (older ones become a text placeholder). Default 3, since
images are resent on every turn; null keeps every image.
stream_tool_turns: boolStream the text of turns that may still call tools as it is generated
(see the module docs). Default true; false buffers those turns.
tool_context: Map<String, Value>Per provider, named values sent with every call to that provider’s tools
({provider: {name: template}}), outside the arguments. See the module docs.
Kept as raw JSON (parsed by AgentNode::from_doc) so no extra serde
code is generated for a rarely used field.
skills: Vec<String>Installed skills this agent may load (see the module docs). Needs the
cargo feature skills and a graphrt_core::skill::Skills service.
learning: Option<Value>Read approved lessons into the system prompt: {agent, user} (see the
module docs). Needs the cargo feature learning and a
graphrt_core::learning::Lessons service. Kept as raw JSON, like
tool_context, so builds without the feature carry no code for it.
context_window: Option<Value>What happens when the conversation outgrows the model’s context
window: auto (the default), summarize, off or a mapping (see
[crate::context]). Needs the cargo feature context. Kept as raw
JSON, like learning.
long_term_memory: Option<Value>Notes the agent saves and finds again in later runs: auto, off or
{agent, user, recall, write} (see crate::memory). Needs the cargo
feature memory and a graphrt_core::memory::Memories service. Kept as
raw JSON, like learning.
subagents: Option<Value>Workflows the model may start as child runs: [{workflow, description, handoff?}] (see crate::subagents). Needs the cargo feature
subagents and a host that links the workflows. Raw JSON, like learning.
max_parallel_subagents: Option<usize>Child runs at the same time (default 4).
max_subagent_calls: Option<usize>Child runs in one run of this node (default 16).
retry_safe_tools: Vec<String>Tools called again when an attempt was cut while they ran (a retry, a
resumed preempt): provider/name, the name the model sees, provider/*
or *. The recall of the agent’s own memory and the skill tools are
always. Any other cut call is not repeated.