agent-native memory infrastructure

Memory that participates.

HyphaeDB is a database, written in Rust, for teams of AI agents. Store a memory once and it propagates through a gossip mesh, hop by hop on a bounded energy budget, to the agents it concerns. The agent who needs it never has to ask.

$ docker compose -f deploy/docker-compose.yml up -d

Background visualization: memories propagating between the nodes of a mesh, glowing brighter with more energy, caught by ringed beacon nodes. Click anywhere in it to release one.

Between queries, a database does nothing.

It cannot coordinate. It cannot propagate. It waits. For a single agent that is fine: the agent that stored a fact knows to ask for it again.

A team of agents breaks that assumption. The agent that needs a lesson is usually not the agent that learned it, and it does not know the lesson exists, so it never queries. Context stuffing and notification fan-outs are manual wiring disguised as automation.

HyphaeDB inverts the default. A stored memory becomes a diff released into the mesh, and relevance, not a query, decides where it travels. The filing cabinet becomes a mycelium.

How a memory travels

Four moves, all server-side. None of them are yours to orchestrate.

  1. You store a cell

    One call. The server stamps provenance from your authenticated credential and embeds the content.

    store(CellInput(
      cell_type=DECISION,
      salience=0.9,
    ))
  2. The cell becomes a diff

    Seeded with an energy budget scaled by salience and cell type, its origin fixed forever.

    MemoryDiff {
      origin: immutable,
      energy: 10 · √0.9 · 2.0,
      path:   [],
    }
  3. The diff walks the mesh

    Neighbors are scored; each hop costs energy, and strong edges are cheap. When the diff cannot afford another hop, it stops.

    σ = 0.6·relevance
      + 0.3·interest
      + 0.1·salience
    hop_cost = 1 / edge.weight
  4. Inboxes light up

    Agents and beacons along the way receive it: live, de-duplicated, replayable after a reconnect.

    inbox ▸ delivered
      deduped · replayable
    beacon ▸ caught

Reach is a property of what knowledge is

Every diff is seeded once, then spends its way outward. Decisions and constraints travel topology-wide; routine tasks fade within a few hops. Nine cell types, no routing rules to write.

E0 = base_energy × √salience
     × type_multiplier
Shipped defaults. Reach: hops affordable at salience 0.9 across unit-cost edges.
cell typemultiplierreach
decision2.0×~18 hops
constraint2.0×~18 hops
risk1.5×~14 hops
pattern1.5×~14 hops
lesson1.2×~11 hops
fact1.0×~9 hops
preference0.8×~7 hops
context0.5×~4 hops
task0.3×~2 hops

The thesis, running

Two agents, two credentials, no channel between them. The planner stores a decision and tells no one. The worker planted a beacon and listens.

planner.pypython
planner = await HyphaeClient.connect(
    ENDPOINT, os.environ["PLANNER_KEY"]
)
await planner.start_session("planner")

await planner.store(CellInput(
    cell_type=CellType.DECISION,
    content="We use PostgreSQL + pgvector for V1 storage.",
    salience=0.9,
))
# stored once. addressed to no one.
worker.pypython
worker = await HyphaeClient.connect(
    ENDPOINT, os.environ["WORKER_KEY"]
)
await worker.start_session("worker")
await worker.place_beacon("decisions about database storage")

# never queries. declares an interest and listens.
async for item in worker.inbox():
    print("worker received a memory it never asked for:",
          item.delivery.diff_id)
    break

worker received a memory it never asked for: 0198…a3f2

No topic strings, no queues, no fan-out list. The planner never learned the worker exists: the beacon declares meaning, and the topology did the work. Run the propagation quickstart; it takes five minutes.

One graph, not two

The HNSW index that answers recall is the same graph that gossip walks. The edges are the gossip channels, so how knowledge is found and how it travels can never drift apart.

Recall is a vector search over the dense base layer, and each SDK keeps a warm local cache in front of it.

Knowledge earns altitude. Five deliveries inside one scene with zero contradictions promotes a cell upward; promotion resets its journey and re-propagates it fresh. Turn on contradiction detection and a confirmed contradiction demotes it: the mesh self-corrects.

recall.pypython
# the warm local cache answers; the server on a miss
query = RecallQuery(text="storage engine", k=5)
hits = await client.recall(query)
for hit in hits:
    print(hit.score, hit.from_cache, hit.content)
The three-layer HNSW meshThree stacked planes: a dense Layer 0 with many nodes, a sparser Layer 1, and a two-node Layer 2 backbone. One highlighted node appears on all three layers, connected vertically: a promoted decision.layer 2 · backbonelayer 1 · promotedlayer 0 · every cell
A promoted decision resident on all three layers. Promotion is earned by delivery, blocked by contradiction, gated by trust.

Load-bearing invariants

Propagation is only useful if you can trust what arrives. These hold on every surface, for every diff.

  • origin is immutableHowever far a diff travels, it names the node that produced it. Provenance survives propagation.
  • identity is never self-assertedsource_agent is stamped from the authenticated credential, never from the request body. An agent cannot claim to be another.
  • energy is non-increasingEvery hop spends budget, so propagation provably terminates. The mesh cannot flood.
  • the path forbids cyclesA node already on a diff's path never processes it again.
  • trust gates promotionEach agent carries a trust score. Confirmed deliveries raise it, promotion into shared layers requires it, and with contradiction detection on, contradictions lower it.

Four doors into one organism

One application core speaks four protocol surfaces. Pick the door that fits your client; identity and provenance behave identically behind all of them.

gRPC :50051
The primary surface: twelve unary RPCs and a bidirectional inbox stream that replays from your last-seen watermark, then goes live.
MCP stdio · POST /mcp
Eleven tools for MCP hosts. One .mcp.json entry gives a Claude Code agent shared memory.
REST :8080
The HTTP fallback: fully hydrated reads, a consistent error envelope, an OpenAPI-generated reference.
A2A opt-in
Off by default. Enable it and agents on Agent2Agent platforms discover an agent card and four memory skills.

SDKs, in-repo today and on the registries at launch: Python hyphaedbTypeScript @hyphaedb/clientRust hyphae-clientGo is planned, not released.

Run it tonight

One compose file brings up the server and Postgres with pgvector. One env var flips on real local embeddings: in-process Candle, or the optional TEI sidecar profile.

quickstartbash
git clone https://github.com/hyphae-db/hyphae-core.git
cd hyphae-core
docker compose -f deploy/docker-compose.yml up -d
curl -s localhost:8080/readyz   # 200 once the mesh is up

Abridged. The full quickstart runs in CI, on every docs change and nightly against HEAD: what the docs show is what the code does.

Operate it like infrastructure

  • failover

    Active-passive HA on a fenced Postgres lease; the standby promotes itself.

  • durability

    Postgres is the system of record; the in-memory mesh snapshots and rehydrates as a fast-start cache.

  • audit

    A tamper-evident, hash-chained audit log; the chain re-verifies from the CLI.

  • erasure

    Bulk erasure returns a certificate: per-tier removal counts and an audit-verifiable digest.

  • observability

    A contract-tested hyphae.* metrics catalog behind a Prometheus endpoint.

  • observatory

    A live, content-free stream of every propagation hop. Watch diffs travel in production.

Plainly

The parts a landing page usually hides.

If a claim on this page outruns the code, that is a bug. File it.