The central entity in the system. An Agent combines a given identity (Agent Profile), capabilities (tools, skills, MCP connections), permissions, and introspection into a single runtime unit that executes Sessions (tasks).
The Agent trait defines the runtime interface (prompting, state access, control, steering queues). BasicAgent is the default in-memory implementation that owns conversation state, tools, and provider configuration.
Stable identifier assigned at construction. Included in every AgentStart event. Immutable for the lifetime of the agent instance.
Agent Profile
AgentProfile
[EXISTS]
Reusable identity blueprint (src/agents/profile.rs). Separate struct from Agent — multiple agents can share one profile via config instances. Fields: profile_id, name, description, system_prompt, thinking_level, temperature, max_tokens, config_id, skills, workspace.
profile_id
String
[EXISTS]
Distinct from agent_id. Allows profile sharing across agents. Auto-generated UUID if not set.
SystemPromptStrategy
trait
[EXISTS]
Defines block structure for multi-block prompt composition (src/agents/system_prompt.rs). Uses a 3-entity model: strategy template (block definitions with order + max_length), prompt instance (content filling blocks, supports file: paths), agent reference (via {{system_prompt.name}}). See configuration guide.
system_prompt
Option<String>
[EXISTS]
System prompt string. Lives on AgentProfile.system_prompt. Supports inline text, file:path (relative to workspace), or {{...}} reference to a prompt instance. Resolution: agent > profile instance > base profile.
Agent Name
Option<String>
[EXISTS]
Human-readable name. Lives on AgentProfile.name.
Agent Description
Option<String>
[EXISTS]
Description of the agent's purpose. Lives on AgentProfile.description.
workspace
Option<PathBuf>
[EXISTS]
Working directory. Lives on AgentProfile as blueprint default; BasicAgent stores an agent-level override. Resolution: agent workspace > profile workspace > current directory.
model_config
ModelConfig
[EXISTS]
Default model for this agent. Falls back here when Session and Loop don't specify their own. Contains: model id, API key, base URL, API protocol, cost rates, context window size.
context_config
Option<ContextConfig>
[EXISTS]
Token budget and compaction policy. Agent-level limit.
execution_limits
Option<ExecutionLimits>
[EXISTS]
Max turns (50), max tokens (1M), max duration (10 min), cost tracking. Agent-level limit.
retry_config
RetryConfig
[EXISTS]
Retry policy for provider errors. Exponential backoff with jitter. Agent-level.
Agent Profile as a separate struct does not exist in code. The system_prompt field lives directly on BasicAgent. A future AgentProfile struct would hold profile_id, SystemPromptStrategy, name, and description, enabling profile sharing across agents.
SystemPromptStrategy now exists as a trait with a compose(context) -> String method. It follows a 3-entity model: strategy template (the trait implementation), prompt instance (concrete prompt for a given context), profile ref (agent profile reference). Full 5-layer composition (base personality, task context, tool/skill index, memory context, turn-specific instructions) is future work. BasicAgent retains a static system_prompt string as a fallback.
thinking_level and temperature are Agent-level defaults. Per-loop values are captured in LoopConfigSnapshot on each LoopRecord. AgentProfile::resolve_thinking_level() and resolve_temperature() have been removed; resolution is now direct from AgentLoopConfig.
Introspection is the largest conceptual gap. It requires session log analysis, memory categorization (episodic/semantic/procedural), and feedback loops to Agent Profile evolution.