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

Packages: soothe (core library), soothe-daemon (server), soothe-cli (CLI/TUI), soothe-sdk (plugin SDK), soothe-plugins (community plugins).

Package Purpose Key Modules
foundation/ Core runtime core/agent (CoreAgent), sloop (StrangeLoop), context (ContextEngine), workspace, events, persistence, identity, cron, autopilot
runner/ Execution coordinator SootheRunner, resolver (protocol wiring), mixins
protocols/ Protocol definitions memory, planner, policy, durability, vector_store, loop_planner, loop_working_memory, core_agent, operation_security
backends/ Protocol implementations memory, durability, vector_store, persistence
middleware/ Soothe middleware stack identity, policy, system_prompt, llm_rate_limit, workspace_context, per_turn_model, filesystem, code_interpreter, mcp_activation, tool_timeout
subagents/ Built-in subagents planner, deep_research, academic_research, browser_use, veritas
foundation/skillify/ Daemon-shared skill search SkillifyService indexer + retriever
skills/ Agent skills builtin_skills, registry, budget
mcp/ MCP integration server management, tool discovery
config/ Configuration SootheConfig, model routing

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.foundation.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