Skip to main content

Module agent

Module agent 

Modules§

agent
classifier
context_analyzer
cost
dispatcher
eval
history
history_pruner
history_trim
Whole-turn history trimming. One rule: keep the most recent whole turns that fit the token budget, drop the rest, never cut a turn in half.
loop_
loop_detector
Loop detection guardrail for the agent tool-call loop.
memory_inject
Unified memory-context injection: ONE policy and ONE renderer for the memory preamble, applied at the turn engine.
memory_strategy
personality
Personality system — loads workspace identity files (SOUL.md, IDENTITY.md, USER.md) and injects them into the system prompt pipeline.
personality_templates
Default starter templates for the per-workspace personality files.
pricing_catalog
Global pricing catalog: a last-resort fallback consulted by the cost engine when a model has no per-provider pricing entry in config.
prompt
system_prompt
System prompt construction for the agent loop and channel subsystem. These functions were originally in channels/mod.rs but live here to break a circular dependency between the channels and agent modules.
thinking
Thinking/Reasoning Level Control
tool_execution
Tool execution helpers extracted from loop_.
tool_receipts
HMAC-SHA256 tool execution receipts for hallucination detection.

Structs§

Agent
AgentAttribution
Borrow-only Attributable holding an agent alias. Used by entry points (loop_::run, process_message, cron dispatch) that don’t construct a full Agent but still need to open an attribution_span! carrying the agent’s role + alias.
AgentBuilder
TurnMeta
Lightweight metadata for turn-level event emission. Built at emission call sites from the turn’s borrows — not a cached duplicate. The values are borrows from the turn mint site; the mint site stays the single source of truth for the (channel, agent_alias, turn_id) triple.

Enums§

TurnEvent

Functions§

process_message
Process a single message through the full agent (with tools, peripherals, memory). Used by channels (Telegram, Discord, etc.) to enable hardware and tool use.
run