Skip to main content

Module agent_loop

Module agent_loop 

Source
Expand description

§Agent Loop

High-level orchestration loop that unifies slash command routing, tape recording, and LLM pipeline execution.

§Architecture

┌─────────────┐       ┌────────────┐       ┌─────────────────┐
│  Channel     │ ───→  │ AgentLoop  │ ───→  │  AgentRuntime   │
│ (transport)  │ ←───  │ (routing)  │ ←───  │  (LLM pipeline) │
└─────────────┘       └────────────┘       └─────────────────┘
                          │
                          ├─→ Router (slash commands)
                          ├─→ TapeStorePort (recording)
                          └─→ ToolPort (tool listing for /tools)

The AgentLoop wraps an AgentRuntime and adds:

  1. Slash command routing — deterministic commands bypass the LLM
  2. Tape recording — conversation history is persisted to the tape
  3. System prompt override — load custom system prompts from workspace files

Re-exports§

pub use crate::router::help_text;

Structs§

AgentLoop
High-level agent orchestration loop.

Enums§

AgentLoopOutput
Output from the agent loop after processing a single input.