Memory for AI agents
Give your AI a memory
it won't make up.
The memory layer built for people building AI agents. It remembers what matters, forgets what's gone stale, and lets you prove exactly what it knows — so your agent stops making things up. Open source, and it drops into the tools you already build with.
"Customer account: Basic Plan"
"Customer account: Basic Plan"
Memory you can prove
Every other memory layer asks you to trust it. Hakuya lets you verify — provenance on every belief, a tamper-evident audit trail, cryptographic erasure, and memory that cleans itself. The controls regulated teams and production agents now require, shipped today.
Provenance on every belief
Each memory carries its source, evidence type, and confidence. You can always answer where a belief came from and why the agent holds it — the foundation for trusting, or distrusting, what an agent remembers.
Tamper-evident audit trail
Every belief change that matters — created, reinforced, contradicted, redacted, erased — is sealed in a per-tenant SHA-256 hash-chained log. Verify the whole chain in one call; export a signed record for SOC 2 / HIPAA review. Edit, reorder, or drop a single row and verification fails.
Verified per-subject erasure
Cryptographically shred everything Hakuya holds about one customer, patient, or guest — and keep a provable record that you did. Right-to-be-forgotten that survives an append-only audit log. Built for GDPR Article 17 and the EU AI Act.
Self-cleaning memory
Stale beliefs lose confidence; redundant ones suppress each other through competition-aware decay. Other stores accumulate junk — one public audit of a leading memory layer found 97.8% of entries were garbage after a month. Hakuya's memory stays clean on its own.
Don't trust it. Verify it.
interactive demoThis is a real SHA-256 hash chain, computed in your browser — the same construction Hakuya seals around every memory mutation. Click any record and change it. Then run verification.
memory "Prefers TypeScript" · conf 0.90
000000…0000hash …conf 0.90 → 0.94 · used in reply
…hash …"now prefers Go" · conf 0.94 → 0.61
…hash …contradiction resolved · prior belief superseded
…hash …GDPR erasure · subject anchor purged
…hash …The Problem
Giving agents memory is easy.
Making that memory reliable is not.
Most teams reach for a vector database and call it done. What they get is an agent that either forgets everything or remembers the wrong thing forever.
It keeps forgetting
You want your support agent to remember that a client prefers email, dislikes upsells, and had a billing issue last quarter. Instead, every session starts blank. Users repeat themselves. The agent never improves.
When it remembers, it's wrong
You add a memory store. Now the agent confidently cites preferences from a year ago — a plan the customer upgraded from, a stack they stopped using, a constraint that no longer applies. Persistence without decay is just confident misinformation.
You can't see what it knows
There's no way to inspect what the agent believes, how old that belief is, or how confident it should be. When it gives a wrong answer, you're digging through logs trying to trace a memory that was written months ago.
A cognitive engine under the trust layer
Provenance and audit are only worth as much as the memory underneath them. Hakuya models memory the way cognitive science says it should work — typed, confidence-scored, and alive.
Tiered Memory
Memories auto-tier by confidence: Hot memories inject into every prompt. Cold ones surface only when relevant. Archives decay gracefully.
Belief Dynamics
Confidence updates via Bayesian log-odds. Reinforced memories grow stronger. Contradicted ones weaken. Unused ones decay naturally.
Hybrid Retrieval
Every recall combines vector similarity with graph traversal. Navigate entity relationships up to 2 hops deep for richer context.
Conversation Extraction
Automatically extract memories from conversations. LLM-powered classification detects preferences, facts, decisions, and constraints.
Procedural Learning
Agents learn skills from successful episodes. Trigger-action patterns are extracted, versioned, and matched to new situations.
Metacognition
Agents assess their own knowledge quality. Detect gaps, measure confidence per query, and flag uncertainty in novel situations.
Four memory systems,
one unified API
Inspired by CoALA, Mem0, and ACT-R research. Each memory type serves a distinct cognitive function.
Facts & Beliefs
Persistent knowledge about users, preferences, constraints, and decisions. Typed and confidence-scored.
"User prefers dark mode" 0.92Experiences
Rich records of past interactions with full context: emotions, entities, causal links, and outcomes.
"Helped debug auth flow" successLearned Skills
Trigger-action patterns extracted from successful episodes. Matched to new situations for better responses.
"When error → check logs first" 87%Active Context
7-slot active memory for current goals, reasoning state, and recent messages. Mirrors human working memory capacity.
"Current goal: fix login bug" activeWhere others stop, Hakuya starts
Mem0 and Zep solve retrieval. Hakuya solves trust — provenance on every belief, a tamper-evident audit trail, and verified erasure no other memory layer ships.
| Capability | Mem0 | Zep | Hakuya |
|---|---|---|---|
| Data Model | |||
| Memory architecture | Vector-first; graph is an add-on requiring external Neo4j | Temporal knowledge graph (Graphiti); no semantic/episodic distinction | 4-type cognitive model — semantic, episodic, procedural, working |
| Cognitive memory typesSemantic, episodic, procedural memory as distinct first-class types | Stores facts extracted from conversations; no type distinction | Graph nodes and edges only; no cognitive type model | All four types, each with distinct storage and retrieval semantics |
| One agent, many isolated subjectsScope memory to the customer/guest/patient it's about — with per-subject belief dynamics | user_id / run_id filters, but combined-key filtering was historically buggy; same decay/confidence for all | Per-user graph + threads, but no per-subject decay, confidence, or contradiction | Anchors + sessions + tenant canon, composed on recall; reinforcement, decay & contradiction applied per subject |
| Memory Quality | |||
| Confidence & belief dynamicsEach memory carries a confidence that moves with evidence and time — not just a timestamp | ADD / UPDATE / DELETE operations only; no confidence value on memories | Temporal metadata (valid_at / invalid_at) tracks when, not how certain | Log-odds confidence that rises with reinforcement and decays when stale, surfaced on every memory |
| Memory decayStale, unused beliefs automatically lose confidence over time | No configurable expiry or decay; memories stay at full weight indefinitely | Temporal tracking does not expire or decay facts — manual deletion only | Mathematically principled decay formula with competition-aware suppression |
| Contradiction detectionWhen two beliefs conflict, the system detects and resolves the tension | LLM reconciliation detects duplicates; does not model semantic tension | Temporal invalidation marks superseded facts; no semantic conflict analysis | LLM tension analysis with three resolution strategies: hard demote, temporal archive, contextual coexist |
| Retrieval | |||
| Graph retrievalTraversal across entity relationships beyond single-hop similarity | Hybrid mode available but requires a separately hosted Neo4j instance | Native BFS traversal with temporal consistency; requires graph DB infrastructure | Built-in hybrid retrieval — pgvector + graph up to 2 hops, zero extra infrastructure |
| Retrieval ranking modelHow results are scored and ordered | Vector cosine similarity; graph mode adds entity score | Graph score + cosine + BM25 full-text; no confidence weighting | Relevance × recency × confidence — higher-confidence memories surface first |
| Trust & Governance | |||
| Tamper-evident audit trailA record of every belief change that can be proven intact | Operation log (ADD / UPDATE / DELETE / NOOP); no integrity guarantee | Temporal provenance per fact; no tamper-evidence | Per-tenant SHA-256 hash chain — verify in one call, export a signed record; any edit breaks the chain |
| Write-provenance & poisoning resistanceKnowing where a memory came from — and defending the store against malicious writes (OWASP ASI06) | No write provenance; a CVSS 8.1 injection flaw was disclosed across backends in 2026 | Graph carries source nodes, but no write-time trust controls | Evidence-typed provenance on every write, recorded in the tamper-evident log |
| Verified per-subject erasureProvably forget one customer, patient, or guest — and keep the receipt | Delete API removes rows; no per-subject scope or proof of erasure | Delete by group/user; no cryptographic erasure or audit receipt | Cryptographic shred scoped to one subject, recorded in the audit chain — GDPR Art. 17 / EU AI Act |
| Knowledge health monitoringVisibility into the quality and trustworthiness of an agent's knowledge state | Analytics dashboard — latency, token usage, accuracy metrics | No health monitoring; temporal logs require manual querying | Confidence distribution, staleness indicators, and learning velocity per agent |
| Deployment | |||
| Self-hostedFull functionality without a managed cloud dependency | Docker Compose (FastAPI + PostgreSQL + optional Neo4j) | Community Edition deprecated April 2025; Graphiti library requires self-assembly | Single Go binary — no runtime dependencies beyond Postgres |
Based on public documentation as of June 2026. Zep Community Edition was deprecated in April 2025.
Measured on the hardest public memory benchmark
LongMemEval (ICLR 2025) grades long-term conversational memory across six task types, over chat histories that scale past a million tokens. Here is exactly how Hakuya performs — every task type, every number, nothing hidden.
| Task type | What it tests | Score |
|---|---|---|
| Knowledge update | When a fact changes over time, answer with the current value and ignore the superseded one. | 100.0% |
| Abstention | Recognise an unanswerable question and decline, instead of hallucinating an answer. | 100.0% |
| Single-session · user fact | Recall a specific fact the user stated within one conversation. | 98.4% |
| Single-session · preference | Surface a user preference, whether stated outright or implied by repeated behaviour. | 93.3% |
| Multi-session | Combine and aggregate facts that are spread across many separate conversations. | 90.2% |
| Single-session · assistant | Recall something the assistant said, recommended, or listed earlier in a session. | 89.3% |
| Temporal reasoning | Reason about when events happened — order, duration, and 'how long ago' across sessions. | 82.3% |
| Overall | Every task type, including abstention. | 91.4% |
Methodology
Hakuya is the memory store and retrieval layer; the agent reads only what Hakuya returns. Answers are graded by LongMemEval's standard GPT-4o judge against the official LongMemEval set. Strongest areas — knowledge updates, abstention, and single-session recall — sit at 89–100%. Temporal reasoning is date-aware (the answerer is given the question's reference date) and is the area with the most remaining headroom. Multi-session aggregation uses a counting-aware answerer that scans every recalled session and de-duplicates instances across conversations.
How to read memory benchmarks
Memory-layer numbers are notoriously setup-dependent — published LongMemEval scores swing widely with the reader model and harness, and vendors have publicly disputed each other's figures. We publish the full per-task breakdown and methodology so you can reproduce it, rather than a single cherry-picked headline.
Benchmark: LongMemEval — Wu et al., ICLR 2025 (github.com/xiaowu0162/LongMemEval, arXiv:2410.10813).
Is Hakuya right for you?
Whether you write the code yourself or build on agentic and no-code platforms — if your agents need to remember, learn, or improve, the answer is yes.
Agent & copilot builders
Building assistants, copilots, or agents — in code or on an agentic / no-code platform — that work with people over days, weeks, and months.
LLM App Builders
Shipping products powered by language models that need persistent user context beyond a single session.
Multi-Agent Systems
Orchestrating multiple agents that need shared memory with automatic conflict resolution and belief updates.
Research Teams
Implementing cognitive architectures grounded in peer-reviewed research: CoALA, Mem0, ACT-R, MUSE.
Probably not the right fit if you...
Pricing
Simple, predictable pricing
Self-host for free under Apache-2.0, or let us run it for you. Pick a managed plan and start in minutes — cancel anytime.
Full capabilities on your own infrastructure. Deploy with Docker Compose and own your data completely.
- Tamper-evident audit trail (verify + signed export)
- Verified per-subject erasure (GDPR / EU AI Act)
- Write-provenance on every memory
- All 4 cognitive memory types
- Confidence & belief dynamics
- Contradiction detection
- Self-cleaning memory decay & lifecycle
- Hybrid vector + graph retrieval
- Studio: Ask + Import (bring your own LLM keys)
- Python SDK + REST API
- LangChain integration (langchain-engram)
- Multi-LLM support
- Unlimited agents & memories
- Community support
Managed Postgres and pgvector so you ship features, not maintain databases.
- Everything in Self-Hosted
- Managed Postgres + pgvector
- Automated backups
- 5 agents
- 50,000 memories / month
- 500 Studio asks + 100 document imports / month
- Web dashboard
- Email support
Production-grade reliability for teams running agents with real users and uptime requirements.
- Everything in Developer
- 25 agents
- 500,000 memories / month
- 5,000 Studio asks + 1,000 document imports / month
- Observability dashboard — usage, cost & latency
- Knowledge health dashboard
- Multi-region replication
- Priority support
- 99.5% uptime SLA
Scale to heavy production workloads — high limits and full observability across your agents.
- Everything in Team
- 100 agents
- 5,000,000 memories / month
- 50,000 Studio asks + 10,000 document imports / month
- Full observability & cost analytics
- Higher rate limits
- Priority support
Private deployments, compliance packages, and contracts tailored to your organization.
- Everything in Growth
- Unlimited Studio Ask + Import
- Unlimited agents & scale
- BYOC deployment
- SSO / SAML
- Compliance & audit reports
- Dedicated support
- Custom SLA
How Hakuya works
Store
Memories are stored with type, content, and provenance. Embeddings are generated automatically. Entities and relationships are extracted into the graph.
Recall
Hybrid retrieval combines vector similarity with graph traversal. Hot memories auto-inject. Results are ranked by relevance, recency, and confidence.
Evolve
Feedback updates confidence via log-odds. Reinforced memories tier up. Contradictions trigger review. Unused memories decay toward archive.
Up and running in 2 minutes
Start the server
# Clone and start with Docker
git clone https://github.com/Harshitk-cp/engram.git
cd engram
# Set a setup token, then start
ENGRAM_SETUP_TOKEN=changeme docker compose up -d
# Get your master API key (run once)
curl -X POST http://localhost:8080/v1/setup \
-H "X-Setup-Token: changeme" \
-H "Content-Type: application/json" \
-d '{"org_name":"My Org"}'
# → {"api_key":"mk_..."} — save thisInstall the SDK
pip install engram.toStore and recall memories
from engram import Hakuya
client = Hakuya(
base_url="http://localhost:8080",
api_key="mk_...",
)
# Register an agent
agent = client.agents.create(
external_id="my-assistant",
name="My Assistant",
)
# Store a typed, confidence-scored memory
client.memories.store(
agent_id=agent.id,
content="User prefers TypeScript over JavaScript",
type="preference",
confidence=0.9,
)
# Recall with hybrid vector + graph retrieval
memories = client.memories.recall(
agent_id=agent.id,
query="language preferences",
)Ready to go deeper? The full docs cover memory types, scopes, confidence, the graph, and the complete API reference.
Read the docsContact
Talk to the team
Questions about integrating Hakuya, enterprise pricing, or a custom deployment? Reach out and we'll respond within one business day.
tech@hakuya.aiQuestions people actually ask
Straight answers on what Hakuya is, how it's different, and how to put it to work.
Two moves. When something matters, your agent calls remember to save it — or Hakuya extracts it from the conversation for you. When it needs context, it calls recall with a plain-language query like "what do I know about this customer's billing?" and gets back the most relevant memories, ranked by how confident and how recent they are. Hakuya can also auto-inject the most important memories into the prompt, so the agent walks in already knowing.
A vector database stores text and finds similar text — that's it. It never forgets, never notices when two memories contradict, and will happily hand back a fact that stopped being true six months ago. Hakuya adds the judgment on top: it lets stale memories fade, catches and resolves contradictions, ranks by confidence and recency instead of raw similarity, and records where every fact came from. You get the memory your agent should act on, not just the closest string match.
That's the whole point. Because stale memories lose confidence and fresh ones win recall, your agent stops citing a plan the customer already upgraded from, a preference they changed, or a fact that's no longer true. And when it genuinely doesn't know, low confidence lets it say so instead of inventing an answer — "confidently wrong" is exactly the failure mode Hakuya is built to prevent.
Every memory has a confidence score that moves with evidence. Use or confirm a belief and it strengthens; contradict it and it weakens; leave it untouched and it slowly decays. Repeats of the same fact collapse into one strong memory instead of a pile of noisy duplicates. So the store gets cleaner the more it's used — you never run a cleanup job.
Yes. Each end-user — a customer, patient, or guest — gets an isolated space, so what your agent remembers about one person never leaks into another's, even though it's all one deployment. You can also share company-wide facts that everyone should know alongside the per-user memory. It's built for one support or concierge agent serving thousands of people.
Pick whatever fits your stack: an MCP server that drops straight into Claude Desktop, Claude Code, Cursor, and Windsurf (memory just works, no glue code), a REST API, a Python SDK, or a LangChain integration. Point your agent at the endpoint and remembering and recall are available immediately — you don't have to build a memory pipeline yourself.
One call erases everything tied to a single user and keeps a verifiable record that the data existed and was removed. That's genuine right-to-be-forgotten (GDPR / EU AI Act) that survives an append-only log — the reason teams in health, finance, and legal can actually put an agent in front of real customers.
Yes to both. Hakuya is open source and free to run yourself with a single command — your data never leaves your infrastructure. If you'd rather not operate it, there's a managed cloud with a free tier to start and paid plans as you scale.
Ship memory you can prove.
Open source and free to self-host. One Docker Compose command to a full production memory layer.