Open Source Agent Memory

Memory that agents
can trust.

Vault extracts structured facts, resolves entity keys across agents, and retrieves memory semantically — with your own database.

npm install vault-memory drizzle-orm
01

Extract facts

Pass conversation messages to Vault. An LLM pulls structured facts from the latest turn — diet preferences, timezone, project context — validated with Zod before anything is stored.

02

Resolve & classify

Align the subject label, then classify against this agent's own memory: ADD, UPDATE, REPLACE, or NOOP. A new fact is compared with other agents and labeled compatible, equivalent, or contradicting before any policy runs.

03

Search semantically

Retrieve memories by meaning, not keywords. Embeddings power vector search scoped to your agent, with filters for entity, conversation, and status.

Use cases

Built for teams where
memory accuracy matters.

Most agent memory is append-only. Vault fits when multiple writers, contradicting facts, and attribution all need to coexist in one store.

Multi-agent teams

Scheduling, chat, and tool agents share one database. Compatible facts on the same subject stay. Real disagreements use recency or authority, with a dispute row when trust cannot pick a winner.

Facts that evolve

Users correct themselves, preferences change, context shifts. REPLACE supersedes old claims instead of piling on contradictions or duplicate chunks.

Audit trails

Every claim carries sourceAgent, conversationId, and status. Superseded and disputed facts stay in the record — nothing disappears without a trace.

Features

Memory that stays accurate.
Not another chunk store.

Most agent memory is append-only. Vault resolves entity keys, classifies every fact before it lands, and applies per-entity conflict policy — so contradictions resolve and restatements don't bloat your database.

Contradiction handling

Old facts get superseded,
not duplicated.

When the same agent corrects itself, REPLACE marks the prior claim superseded and stores the new one as active. The old row stays for audit. Search returns the new fact.

User says: "I'm vegetarian"

statusentityclaim
activeuser.dietThe user is vegetarian

User says: "Actually I eat meat now"

statusentityclaim
supersededuser.dietThe user is vegetarian
activeuser.dietThe user eats meat
Structured facts

Facts, not chunks.

Extraction returns entity + type (semantic or episodic). Optional registry seeds canonical keys — user.timezone, not a new label every turn.

Resolve & classify

Align keys, then write.

Entity resolution aligns a drifted label using the fact's embedding. Pass 1 then chooses ADD, UPDATE, REPLACE, or NOOP. Pass 2 asks whether another agent's fact on that subject is compatible, the same, or a real contradiction.

Multi-agent

Shared store.
Resolved conflicts.

Multiple agents share one database. Another agent's fact on the same subject can stay if both can be true. A real contradiction uses recency or authority — higher trust wins, and a tie or a loss is stored as disputed with an audit row.

agent-a (scheduling)

Calendar onboarding. EST from chat was a contradiction, so this higher-trust claim stays active.

user.timezone → "The user is in PST"

type: semantic · conv: onboarding-call

status: active · authority 0.9

agent-b (chat)

Casual mention in chat — parked until a human picks PST vs EST.

user.timezone → "The user is in EST"

type: semantic · conv: daily-checkin

status: disputed · authority 0.2

agent-b (chat)

Chat owns mood. A matching fact from scheduling would be labeled before any overwrite.

user.mood → "The user seems happy today"

type: semantic · conv: daily-checkin

status: active · authority 0.8

agent-c (tools)

No authority on this subject. A contradicting write from another agent would win by recency.

user.project → "User is building Vault"

type: semantic · conv: repo-sync

status: active · recency

Retrieval

Search by meaning.

Queries are embedded and matched with cosine similarity. Ask about food preferences and get the diet claim — even when the query never mentions vegetarian.

Lifecycle

Every claim has a trail.

Claims carry sourceAgent, conversationId, and status (active, superseded, or disputed). Superseded facts stay for audit; search returns active memory for your agent.

Conflict

Two writers.
One decision.

New facts ADD. Same-agent corrections REPLACE. Restatements NOOP. Compatible facts from another agent stay. A real clash uses authority or recency, and a weaker claim is disputed rather than overwritten.

Conversation

CLASSIFY

agent-a · chat

“I'm vegetarian.”

Memory

statusentityclaimagent
no claims yet

A new mention lands. Vault extracts a structured fact before anything is written.

Compare

How Vault
stacks up.

Vault is built for teams that want structured, agent-attributed memory in their own database — with real conflict resolution when multiple agents write to the same store.

FeatureVaultSupermemoryMem0
Open sourceYesPartialYes
Bring your own databaseYesNoNo
Structured facts (entity + type)YesYesPartial
Contradiction handlingREPLACE + supersedeGraph auto-updateADD-only accumulation
Multi-agent conflict resolutionCompatible, or authority / recencyContainer isolationShared by user ID
Entity key resolutionYesYesEntity linking
ADD / UPDATE / REPLACE / NOOPYesAutomaticADD-only
Semantic searchYesYesYes
Claim audit trailActive, superseded, disputedGraph historyPartial
Managed cloudNoYesYes
RAG & connectorsNoYesPartial
User profiles APINoYesYes
Multimodal ingestNoYesPartial

FAQ

Frequently Asked Questions

Vault is an open-source memory layer for AI agents. It extracts structured facts from conversations, classifies them against existing memory (ADD, UPDATE, REPLACE, NOOP), and retrieves them via semantic search — all stored in your own database.

Yes. vault-memory is MIT licensed and free for personal and commercial use. You only pay for your own LLM and embedding API calls, plus whatever database hosting you choose.

Any database Drizzle supports — SQLite, Postgres, bun:sqlite, and more. The library includes optional FAISS vector store backends for production deployments.

Yes. Pass custom embed and llm functions in the config to use OpenRouter, Anthropic, or a local model. The apiKey shortcut is just a convenience for OpenAI defaults.

Multiple agents share one database. Vault aligns subject labels, then loads every other agent's active claim on that subject. A model labels each one equivalent, compatible, or contradicting. Only contradictions use recency or authority. Equal or lower authority stores the new claim as disputed.

The same agent gets REPLACE: the old claim is superseded and the new one is active. Across agents, a restatement writes nothing, a compatible fact is stored beside the old one, and a contradiction uses recency or authority. Wildcards like user.schedule.* are supported. Equal authority leaves an open dispute.

Extractors can drift labels (user.xyz vs user.timezone). Before classify, Vault embeds the fact text and compares it with existing active claims. A score of 0.85 or higher adopts the existing subject. Between 0.70 and 0.85, an optional model call decides. Below that, the extracted label stays. useEntityRegistry can also limit extraction to keys you seed.

MIT. Use vault-memory in personal and commercial projects without restriction.

Give your agents memory today.

Install vault-memory, wire it to your agent, and stop losing context across conversations. MIT licensed.