Architecture Overview

Soothe is a goal-driven orchestration framework for 24/7 autonomous agents. It extends deepagents with planning, context engineering, security policy, durability, and remote agent interop.

Soothe does not implement domain logic. It composes capabilities from others — langchain tools, MCP servers, deepagents subagents, ACP/A2A remote agents — and adds orchestration: wiring, delegation, lifecycle management, and context continuity.


Three-Level Execution

Soothe operates through a hierarchical execution model with three tiers. Each tier delegates downward:

Tier Scope Loop Pattern Delegates To RFC
ContextEngine Long-running multi-goal DAGs Goal → PLAN → PERFORM → REFLECT → Update StrangeLoop RFC-624/625
StrangeLoop Single-goal iterative refinement Plan → Execute (max ~8 iterations) CoreAgent RFC-201
CoreAgent Model → Tools → Model turn loop LangGraph native execution langgraph RFC-100

ContextEngine manages the goal DAG (priorities, dependencies, decomposition). StrangeLoop executes a single goal through iterative Plan-Execute cycles. CoreAgent is the pure execution runtime — no goal awareness, just prompts and tools.


Framework Stack

+------------------------------------------------------+
|  Soothe (orchestration framework)                    |
|  - ContextEngine: Autonomous Goal Management         |
|  - StrangeLoop: Agentic Goal Execution               |
|  - CoreAgent: Runtime                                |
|  - MemoryProtocol, PlannerProtocol,                  |
|    PolicyProtocol, DurabilityProtocol                |
+------------------------------------------------------+
|  deepagents (agent framework)                        |
|  - BackendProtocol, AgentMiddleware,                 |
|    SubAgent/CompiledSubAgent, SummarizationMiddleware|
+------------------------------------------------------+
|  langchain / langgraph (runtime)                     |
|  - BaseChatModel, BaseTool, StateGraph,              |
|    Checkpointer, BaseStore, RemoteGraph              |
+------------------------------------------------------+

Stack Responsibilities

Tier Components Responsibility
Soothe ContextEngine, StrangeLoop, CoreAgent, Protocols Orchestration, planning, durability, policy
deepagents SubAgent, Middleware, Backend Agent construction, summarization, backends
langchain/langgraph Models, Tools, StateGraph Runtime execution, state management

Module Map

Soothe is a monorepo of five owned packages with a one-way dependency DAG: soothe-sdk (leaf) → soothe (host) → soothe-autopilotsoothe-daemonsoothe-cli. Community plugins ship from the external mirasoth/soothe-plugins repository.

Package Purpose Key Modules
soothe Core runtime & host coreagent/ (CoreAgent factory, builder), sloop/ (StrangeLoop: engine, cognition, stages, orchestrator), context/ (ContextEngine: engine, projection, ledger, DAG, stores), runner/ (SootheRunner, resolver, thread manager), protocols/ (loop_planner, loop_working_memory, runner), subagents/ (planner, deep_research, academic_research, browser_use, veritas), identity/, workspace/, events/, persistence/, security/, prompts/, config/
soothe-autopilot Goal orchestration dispatch/, monitor/, verify/, rails/, intake/, jobs/, sla/, workers/, notify/
soothe-daemon Process lifecycle & server server/ (HTTP/WS), channels/, cron/, runtime/, bootstrap/, health/, query/, events/, display/, skillify/, persistence/, admin_rpc.py
soothe-cli CLI / TUI cli/ (Typer commands), tui/ (Textual UI), runtime/, config/
soothe-sdk Shared contracts (leaf) Wire events, display contracts, plugin protocols

Protocol Architecture

Soothe follows a protocol-first, runtime-second design. Every module is defined as a protocol (abstract interface). Default implementations use langchain/langgraph, but protocols carry no runtime dependency.

Core Protocols

Protocol Purpose RFC
MemoryProtocol Memory management (keyword, vector) RFC-300 (archived), RFC-303
PlannerProtocol Planning and goal decomposition RFC-304
PolicyProtocol Security policy enforcement RFC-305
DurabilityProtocol State persistence and recovery RFC-306
VectorStoreProtocol Vector database abstraction RFC-301
LoopWorkingMemoryProtocol Working memory for StrangeLoop RFC-224
LoopPlannerProtocol Planning within StrangeLoop RFC-226
CoreAgentProtocol CoreAgent runtime contract RFC-100
OperationSecurityProtocol Operation-level security RFC-901

Note: ContextProtocol (RFC-302 draft) was never implemented. Context management is handled by ContextEngine (soothe.context) directly, not via a protocol abstraction.

Protocol Hierarchy

Protocol (ABC)
    ├── MemoryProtocol
    ├── PlannerProtocol
    ├── PolicyProtocol
    ├── DurabilityProtocol
    ├── VectorStoreProtocol
    ├── LoopWorkingMemoryProtocol
    ├── LoopPlannerProtocol
    ├── CoreAgentProtocol
    └── OperationSecurityProtocol

Data Flow

Query processing: User → CLI/Daemon → Thread Manager → StrangeLoop (Plan → Execute loop) → CoreAgent (Model → Tools → Model) → Tool Execution → Response Stream → User.

Event flow: Tool Execution → soothe.* Event → Middleware Processing → Event Emitter → Daemon → WebSocket → CLI/TUI.


Design Principles

  1. Protocol-First, Runtime-Second — Every module is a protocol (abstract interface). Default implementations use langchain/langgraph, but protocols carry no runtime dependency.
  2. Extend deepagents, Don’t Fork It — Soothe adds protocols deepagents lacks (context, memory, planning, security, durability, remote agents). Everything deepagents provides is used as-is.
  3. Orchestration is the Product — Soothe composes capabilities from others (wiring, delegation, lifecycle management, context continuity). No domain logic.
  4. Unbounded Context, Bounded Projection — The orchestrator accumulates knowledge without limit; projection injects a token-budget-aware subset into prompts.
  5. Durable by Default — Agent state is persistable and resumable. Crashes recover from the last checkpoint.
  6. Plan-Driven Execution — Complex goals decompose into steps via two-phase planning (status assessment → plan generation). Simple queries bypass planning.
  7. Least-Privilege Delegation — Every tool/subagent call passes through PolicyProtocol. Subagents inherit narrower permissions than their parent.
  8. Controlled Concurrency — Plan steps declare dependencies (DAG); independent steps run in parallel within configurable limits.
  9. Uniform Delegation Envelope — Local subagents, MCP tools, ACP endpoints, A2A peers, and LangGraph remote graphs all use the same SubAgent/CompiledSubAgent interface.

RFC Title
RFC-000 System Conceptual Design
RFC-001 Core Modules Architecture
RFC-100 CoreAgent Runtime
RFC-101 Tool Interface & Event Naming
RFC-102 Secure Filesystem Path Handling
RFC-103 Thread-Aware Workspace
RFC-104 Dynamic System Context
RFC-105 Progressive Skill Loading
RFC-200 Autonomous Goal Management (archived → RFC-624/625)
RFC-201 StrangeLoop Plan-Execute Loop
RFC-203 StrangeLoop State Memory (archived)
RFC-204 Autopilot Mode
RFC-206 Prompt Architecture
RFC-217 Goal Context Management
RFC-220 LangGraph Agent Loop Orchestrator
RFC-624 Context Engine
RFC-625 Autopilot-Monitor-ContextEngine Unification
RFC-300 Context & Memory Protocols (archived)
RFC-301 Protocol Registry
RFC-303 Memory Protocol Architecture
RFC-304 Planner Protocol Architecture
RFC-305 Policy Protocol Architecture
RFC-306 Durability Protocol Architecture
RFC-450 Daemon Communication Protocol
RFC-401 Event Processing
RFC-403 Unified Event Naming
RFC-600 Plugin Extension System
RFC-601 Built-in Agents

See the full RFC index for the complete catalog.


See Also