Stateful agents
From Karpathy's LLM-OS to a working Zettelkasten
HybridClaw turns each agent into a stateful operator: Luhmann's Zettelkasten as memory structure, RAG for retrieval, vector and structured stores for enterprise-grade recall.
Why memory is the hard part
Andrej Karpathy coined the picture of the LLM-OS: an LLM as CPU, tools as peripherals and memory as RAM and disk. Without that memory layer every agent is as forgetful as a fresh browser tab — every answer starts from zero. With HybridClaw an agent gets short-term context, a hierarchical long-term memory and access to a Company Brain that consolidates knowledge from docs, CRM, ERP and email.
Six memory layers, one consistent access pattern
Like an operating system, HybridClaw distinguishes sharply between different memory types — by lifetime, confidentiality and searchability.
Working memory
The active context of a running task: current conversation, tool outputs, sub-agent responses. Disappears after the task ends.
Zettelkasten
Inspired by Niklas Luhmann's note system: small, atomic notes with explicit cross-references. Lets the agent structure its own thinking and re-encounter it on the next run.
Company Brain
The shared knowledge of the organization: docs, wiki, CRM records, tickets. Vector- and full-text-indexed, with RBAC.
RAG
Retrieval-augmented generation. Instead of holding everything in the prompt, the agent pulls only the snippets relevant to the task from Company Brain.
Cross-agent sharing
A skill refined by the finance agent benefits the BI agent. Memory updates can be shared or kept isolated.
Confidentiality & RBAC
Every memory entry has an access level. What is not meant for everyone never shows up in their retrieval.
How the Zettelkasten works in practice
Luhmann's idea — atomic notes with explicit cross-references instead of hierarchical folders — works better for agents than any database table.
- Atomicity. One note, one thought. Makes reuse in other contexts easy.
- Cross-references. Notes link to each other. The agent follows links when it recognizes similar problems.
- Tags. Multi-dimensional indices (tags + embeddings) provide several retrieval paths.
- Versioning. Every update of a note becomes a new version. History is preserved.
- Auto-pruning. Unreferenced notes lose weight in retrieval over time — like biological forgetting.
"HybridClaw is a strong alternative — I particularly liked the integration of Luhmann's Zettelkasten as a memory system in the latest release."
Memory questions that come up often
Does this work without cloud storage? +
Yes. Self-hosted keeps memory entirely local — vector store, structured store, Zettelkasten. There is no obligation to outsource it to a third party.
What happens to memory when an employee leaves? +
Memory entries are tagged by owner/team. During offboarding the associated notes can be archived, deleted or transferred to a successor — a defined workflow, not a manual database edit.
How do you prevent hallucinations from memory? +
Every piece retrieved from the Company Brain comes with provenance. When the agent references a memory entry, a human can jump back to the source. Skill evals explicitly test that answers stay grounded in the memory source.
How large can the Company Brain get? +
There is no hard limit. In the Managed Cloud, thousands of documents and hundreds of thousands of notes are realistic. Performance stays steady because retrieval only loads relevant snippets into the model context.