Module 2: Setup Like a ProLesson 4 of 6

Where the Brain Lives

Where the Brain Lives

Let's be precise about what "the brain" means.

The Agent Has No Persistent Brain

This is important to understand:

The LLM itself doesn't remember anything.

Every time you start a conversation:

  1. OpenClaw loads your workspace files
  2. These become the "system prompt"
  3. The LLM sees them as context
  4. The LLM generates responses
  5. Important info must be saved back to files

The "brain" is the files, not the model.

What Gets Loaded

At session start, OpenClaw injects:

[System Prompt] ├── SOUL.md content ├── USER.md content ├── AGENTS.md content ├── MEMORY.md content ├── Current date/time ├── Tool definitions └── Channel context

This is your agent's "consciousness" for this session.

What Gets Saved

During/after a session, the agent can:

  • Write to memory/daily/*.md
  • Update MEMORY.md
  • Modify any workspace file
  • Create new files

This is how memory persists.

The Context Window

The LLM has a context window — maximum tokens it can process.

ModelContext Window
Claude Sonnet~200K tokens
Claude Opus~200K tokens
GPT-4~128K tokens

Your loaded files + conversation must fit in this window.

If it fills up, compaction happens — old messages get summarized.

Practical Implications

  1. Keep MEMORY.md small (under 3KB)
  2. Load details on demand (not everything at once)
  3. Save before compaction (or lose information)
  4. Structure matters (well-organized files = better retrieval)

The Mental Model

Think of it like this:

YOUR FILES (SOUL, MEMORY, daily logs) ⬇️ loaded into ⬇️

CONTEXT WINDOW (what the LLM can "see") ⬇️ generates ⬇️

RESPONSE (text, tool calls, etc.) ⬇️ saved back to ⬇️

YOUR FILES (updated with new info)

The files are the persistent brain. The LLM is the thinking engine.