Memory Is The Bottleneck banner
OnlyTerp OnlyTerp

Memory Is The Bottleneck

Development community intermediate

Description

The agent's intelligence isn't the limiting factor — memory is. Every session starts fresh. The files are the memory.

Installation

Terminal
claude install-skill https://github.com/OnlyTerp/openclaw-optimization-guide

README


Part 9: Vault Memory System (Stop Losing Knowledge Between Sessions)

Part 4 gave you memory. It works — `memory_search()` is fast, local, and free. But after a few months of daily use, you'll notice something: **your agent is getting dumber, not smarter.**

Here's what happened to us: 358 memory files. 100MB+ of accumulated knowledge. Vector search returning irrelevant results because every query matches 15 files about slightly different things. Date-named files like `2026-02-27-cerebras-session.md` that tell you nothing from the filename. Research conclusions from a 2-hour session — gone, because nobody saved them to memory. The agent starts every session fresh, reads MEMORY.md, and has zero idea what happened yesterday.

**The more you teach it, the worse it gets.** That's the sign your memory architecture is broken.

Why Flat Files + Vector Search Breaks Down

Vector search finds what's *similar*. That's the problem. Ask "what do we know about God Mode?" and you get 8 files that all mention Cerebras somewhere. None of them give you the full picture because the full picture is spread across 12 files that vector search doesn't know are related.

The failure modes:

Problem What Happens Real Example
Date-named files Filename tells you nothing 2026-03-19.md — what's in it? Who knows
No connections Related files don't know about each other God Mode research in 3 files, none linked
Bloat pollutes results Generic knowledge drowns specific insights "What's our memory architecture?" returns 15 partial matches
Session amnesia Agent starts fresh every time "We discussed this yesterday" — no it didn't
MEMORY.md overflow Index file grows past injection limit MEMORY.md hit 20K, context truncated on every message
Vector search ceiling Similarity ≠ understanding Finds files that mention the word, not files that answer the question

The fix isn't better embeddings or a fancier vector database. **The fix is structure.**

The Solution: Vault Architecture

Instead of a flat `memory/` folder with hundreds of date-named files, you build an Obsidian-inspired linked knowledge vault. The key ideas:

    undefined

Here's the folder structure:

vault/
  00_inbox/      ← Raw captures. Dump it here, structure later
  01_thinking/   ← MOCs (Maps of Content) + synthesized notes
  02_reference/  ← External knowledge, tool docs, API references
  03_creating/   ← Content drafts in progress
  04_published/  ← Finished work (includes metadata: date, platform, link)
  05_archive/    ← Inactive conte