Pipelines
このコンテンツはまだ日本語訳がありません。
Pipeline documentation explains linear runtime execution paths: what starts them, what each stage receives, what each produces, and where side effects occur.
Pipeline structure and relationships
Section titled “Pipeline structure and relationships”TomoriBot organizes conversation turn handling into five interconnected pipelines:
Incoming Message | v[Chat Pipeline] 1. Admission & Channel Lock 2. Persona Turn Planning 3. Per-Turn Execution | +---> [Context-Build Pipeline] | - Persona & Server Metadata | - Participant Profile Hydration | - Dialogue History & Tail Directives | +---> Generation Turn: Model Fallback Chain & Key Rotation | [Tool-Loop Pipeline] | - Tool Call Validation & Dispatch | - Enhanced Context Restarts | - Memory Tool Writes | | | v | [Provider Pipeline] | - Native Request Serialization | - Chunk Normalization & Reasoning | - Markdown Buffer Management | - Discord Stream Delivery | v 4. Post-Turn Effects | +---> [Memory Pipeline] - Passive Short-Term Memory CapturePipeline index
Section titled “Pipeline index”- Chat Pipeline: Orchestrates Discord event ingress, message admission, channel queue locking, persona turn planning, and post-turn accounting.
- Context-Build Pipeline: Assembles ordered prompt items, evaluates SillyTavern preset routing, hydrates participant profiles, and prepares conversation history for model consumption.
- Tool-Loop Pipeline: Coordinates repeated model generation passes, tool call execution, argument validation, error suppression, and enhanced context restarts.
- Provider Pipeline: Manages provider-specific streaming requests, SSE chunk parsing, reasoning block stripping, markdown segment buffering, and Discord message delivery.
- Memory Pipeline: Connects passive capture of recent dialogue with tool-driven durable summaries and persona-lineage-scoped long-term memories.
Execution handoffs
Section titled “Execution handoffs”- Ingress to planning: An admitted Discord message in the Chat Pipeline acquires a channel lock and plans persona turns.
- Planning to context assembly: For each turn, the chat coordinator calls the Context-Build Pipeline to assemble static system instructions, dynamic participant profiles, and recent dialogue history.
- Context to generation loop: The turn coordinator invokes the Tool-Loop Pipeline, passing the prepared context closure.
- Generation to provider streaming: The tool loop initiates streaming passes through the Provider Pipeline, which negotiates wire protocols, extracts reasoning, flushes markdown buffers, and delivers text to Discord.
- Tool calls to execution: Tool invocations emitted during provider streaming route back to the tool loop for execution. Tools may return direct responses or trigger enhanced context restarts.
- Generation to memory: Memory tools write summaries or long-term facts during the tool loop. After generation settles, result-dependent post-turn effects record recent dialogue and advance memory cadence counters. The Memory Pipeline owns both write paths.