DEV Community

Sahil David
Sahil David

Posted on

The Missing Layer in the Agent Stack: Why I Wrote a Shared Memory Protocol for AI Agents

AI agents can call tools. They can talk to each other. But they can't remember together.

I found this out the hard way, and that's why I built the Akashik Protocol.

The moment it broke

A few months ago, I ran an experiment. Five AI agents, one research task. A researcher, an analyst, a strategist, a writer, and a reviewer. They could call tools via MCP. They could pass messages. On paper, it should have worked.

Here's what actually happened.

The strategist made a recommendation based on data that the researcher had already corrected two steps earlier. The writer produced a section that directly contradicted the analyst's findings. And nobody, not the agents, not the system, caught it.

The models were fine. The memory layer was missing.

The gap

I went looking for a protocol that solved this. Here's what I found:

MCP (Model Context Protocol) standardises how agents call tools, read a file, query a database, and invoke a function. Brilliant at what it does.

A2A (Agent-to-Agent) standardises how agents message each other, send tasks, receive results, and stream progress. Also brilliant.

But what happens after the call:

  • Where do findings go once an agent produces them?
  • How does context accumulate across agents and turns?
  • What happens when two agents arrive at contradictory conclusions?

Every team building multi-agent systems is solving this from scratch. Custom state management. Ad-hoc memory. Fragile glue code that breaks the moment you add a fourth agent.

Akashik: the third layer

Today I'm publishing the Akashik Protocol ~ an open specification for shared memory and coordination between AI agents.

Think of it as the missing third layer in the agent stack:

Layer Protocol What it handles
Tool access MCP Agent ↔ Tool
Messaging A2A Agent ↔ Agent
Memory Akashik Shared memory & coordination

These aren't competing protocols. They're complementary layers of the same stack.

Three ideas at the core

1. Intent is mandatory

You cannot write to the Akashik Field (the shared memory space) without declaring why. The intent field is required on every single write.

await researcher.record({
  type: 'finding',
  content: 'European SaaS market growing at 23% CAGR',
  intent: {
    purpose: 'Validate market size for go-to-market strategy',
    question: 'Is the market large enough to justify entry?'
  }
})
Enter fullscreen mode Exit fullscreen mode

Any agent ~ or any human ~ can look at any finding and immediately understand what question it was answering. You get a reasoning chain for free.

2. Attunement, not search

Agents don't query a database. They declare who they are, their role, active task, and context budget, and the protocol figures out what's relevant.

const context = await strategist.attune({
  scope: {
    role: 'strategist',
    max_units: 10
  },
  context_hint: 'Drafting competitive positioning section'
})

// context.record[0].relevance_score → 0.85
// context.record[0].relevance_reason → 'Recent finding from researcher. Market sizing relevant to strategy.'
Enter fullscreen mode Exit fullscreen mode

Every returned unit includes a relevance score and a human-readable reason for why it was surfaced. Context finds the agent, not the other way around.

3. Conflicts are first-class

When two agents arrive at contradictory conclusions, the protocol detects it, creates a structured Conflict object, and surfaces it in every relevant ATTUNE response. Nothing gets silently overwritten.

await researcher2.record({
  type: 'finding',
  content: 'Growth decelerating to 14% CAGR based on Q4 data.',
  intent: { purpose: 'Update market projection with latest data' },
  confidence: { score: 0.75, reasoning: 'Single source.' },
  relations: [{
    type: 'contradicts',
    target_id: 'mem-001',
    description: 'Original estimate was 23% CAGR; new data suggests 14%'
  }]
})
// → Field automatically creates a Conflict object
Enter fullscreen mode Exit fullscreen mode

The next time the strategist attunes, they receive both findings plus the unresolved conflict. They can then resolve it using one of seven structured strategies - from last_write_wins to confidence_weighted to human_escalation.

What it looks like end to end

Here's a complete Level 0 example, two agents sharing memory in under ten lines:

import { Field } from '@akashikprotocol/core'

const field = new Field()

const researcher = await field.register({ id: 'researcher-01', role: 'researcher' })
const strategist = await field.register({ id: 'strategist-01', role: 'strategist' })

// Researcher records a finding — intent is required
await researcher.record({
  type: 'finding',
  content: 'European SaaS market growing at 23% CAGR',
  intent: { purpose: 'Validate market size for go-to-market strategy' }
})

// Strategist attunes — receives relevant context automatically
const context = await strategist.attune({ max_units: 10 })
// → Returns the finding, ranked by relevance
// → Every result includes WHY it was recorded
Enter fullscreen mode Exit fullscreen mode

That's Level 0. No persistence, no embeddings, no configuration. Just shared memory with intent.

Progressive adoption

You don't have to adopt the full protocol at once. Akashik is designed for progressive adoption; every level adds capability without requiring you to rewrite what already works.

Level Name What you get Effort
0 Starter REGISTER, RECORD, ATTUNE. In-memory. An afternoon
1 Core + Persistence, logical clocks, conflict detection, polling. A week
2 Standard + Semantic attunement, MERGE, push subscriptions, REPLAY. Serious build
3 Full + Security model, authority hierarchy, coordination extension. Production-grade

Start at Level 0. It solves the core problem, agents sharing memory with intent tracking, with almost no overhead. Move up when you need to.

What Akashik is not

  • Not a vector database. Akashik is a protocol, not an implementation. It defines the contract; you choose the storage.
  • Not a message queue. Agents share structured, intent-bearing context, not raw messages.
  • Not a replacement for MCP or A2A. Akashik is the memory layer. MCP and A2A remain the tool and communication layers.
  • Not a framework. It's framework-agnostic and transport-agnostic. Any agent system can adopt it.

Where things stand

The specification (v0.1.0-draft) is live now. It covers:

  • Nine core operations (REGISTER, DEREGISTER, RECORD, ATTUNE, DETECT, MERGE, SUBSCRIBE, REPLAY, COMPACT)
  • Four conformance levels with normative requirements
  • Full data type definitions with JSON Schema reference
  • Error model with recovery guidance
  • Transport bindings for Native SDK, MCP Server, and HTTP REST
  • Security model and authority hierarchy

The Level 0 SDK (@akashikprotocol/core) ships in April — TypeScript, in-memory, the exact code examples above will run.

This is deliberately early

The spec is in draft. The best protocols are shaped by the people who use them.

If you're building multi-agent systems and you've hit the stateless agent wall, I'd genuinely value your perspective:

  • Read the spec and tell me what's missing
  • Open an issue with what you'd change
  • Tell me what you'd build if your agents could share memory

Links:

The missing layer in the agent stack is memory. Let's build it right.

~ Sahil sahildavid.dev

Top comments (0)