<- all tokdocs

The Six-Layer Memory Stack for Multi-Agent Systems

Watch on TikTok

View on TikTok ->

The biggest mistake in multi-agent systems is not the model or the tools -- it is memory. Most builders reach for vector embeddings and similarity search, but there is a simpler, more auditable approach: pure relational tables with explicit connections. Here is the six-layer memory stack designed to fix the core problem of how agents share, retain, and act on context.

Layer 1: Workspace Context

The foundation is a shared prompt that every agent in the workspace inherits. It sets the baseline -- the project rules, the conventions, the boundaries. Every agent reads this before it does anything. Think of it as the constitution of the workspace. No agent operates without knowing the ground rules first.

Workspace Context layer diagram showing shared rules, project conventions, and boundaries feeding into all agents

Layer 2: Task Layer

Each task is a structured unit with a title, description, acceptance criteria, and references to related contexts. This is how you scope what an agent is actually supposed to do. Without this structure, agents drift. With it, every piece of work has a clear contract.

Layer 3: Snapshot

When a task gets assigned to an agent, everything it needs gets assembled into a single JSONB blob -- workspace context, task details, related tasks, relevant skills. That snapshot gets written to a queue and the agent picks it up as a frozen point-in-time package. This is critical because it means the agent's context is deterministic. You can audit exactly what it knew when it started working.

Snapshot layer showing all context packaged into a single JSON object for deterministic execution

Layer 4: Skills

This is where the system compounds. When an agent successfully completes a task, the resolution gets written back as a reusable skill. Skills are scoped to the workspace and explicitly attached to agents through a join table. If a skill is relevant, it is linked. If it is not linked, the agent does not see it. No ambient knowledge leaking across agents.

Layer 5: Comments as Working Memory

While an agent is executing a task, every intermediate update streams back as a comment thread. This gives both human operators and other agents visibility into what is happening mid-task without waiting for completion. It is real-time observability baked into the architecture.

Comments as Working Memory layer showing live updates, intermediate steps, and visibility during execution

Layer 6: Append-Only Activity Log

Every state change, every assignment, every completion gets logged. Nothing gets deleted. Nothing gets overwritten. This creates a complete audit trail and makes debugging multi-agent workflows tractable.

Key Takeaways

  • Skip vector embeddings for agent memory -- relational tables with explicit connections are simpler and more auditable
  • Deterministic snapshots let you replay and debug exactly what an agent knew when it started a task
  • Skills compound over time: successful task resolutions become reusable knowledge scoped to the workspace
  • Working memory via comment threads provides real-time visibility without blocking on task completion
  • An append-only activity log is non-negotiable for any production multi-agent system

Resources

Published May 12, 2026. Writeup generated from a favorited TikTok.