2026-01-26 · AI & Agents

Tree vs Claw: Agent Memory Paradigms

Two competing/complementary approaches to agent memory and context.

Comparison

Tree Mode Claw Mode
DB-backed hierarchy File-based workspace
Summaries propagate up MEMORY.md curated by agent
Semantic clustering Manual organization
Context = ancestor chain Context = read files on session start

Claw Structure (workspace-based)

├── SOUL.md (identity)
├── USER.md (who you serve)
├── MEMORY.md (curated long-term)
└── memory/
    └── YYYY-MM-DD.md (daily logs)

Handles: identity persistence, daily memory logging, heartbeats, proactive behavior

Tree Structure (conversation-based)

└── Conversations organized hierarchically
    ├── "Work" branch
    │   ├── summary: "Orca development, agent systems"
    │   └── children: [conv1, conv2, conv3]
    └── "Personal" branch
        ├── summary: "Check-ins, life stuff"
        └── children: [conv4, conv5]

Handles: conversation organization, context efficiency, topic clustering

Options

  1. Build both - tree for structured projects, claw for workspace agents
  2. Hybrid - tree structure + claw-style daily logs + MEMORY.md
  3. Pick one - focus claw since full prompt spec already exists (AGENTS.md)

Related: DSPy for Structured Signals

Can complement either paradigm with DSPy modules for extracting structured state:

class EmotionalShift(dspy.Signature):
    character_state: str = dspy.InputField()
    dialogue_history: str = dspy.InputField()
    new_input: str = dspy.InputField()
    
    feelings_changed: bool = dspy.OutputField()
    new_state: str = dspy.OutputField()
    reason: str = dspy.OutputField()

Observer model extracts signals without breaking character immersion.

See also: ~/someday-maybe/dspy-roleplay-pipeline.md