# Memrail vs Cognee — The Competitor Named Your Market. Here Is Where the Designs Differ.

> Cognee's product announcement, published when multi-user mode shipped, describes it as "ideal for SaaS providers or agencies managing multiple clients." That is Memrail's buyer sentence, written by the closest self-hosted alternative in the agent-memory space. The market is real enough that two inde

Source: https://saascode.ai/inside/memrail-vs-cognee-self-hosted-agent-memory-compared-own-the · Published: 2026-08-09 · Section: comparison · Product: Memrail (https://saascode.ai/products/memrail)

---
Cognee's product announcement, published when multi-user mode shipped, describes it as "ideal for SaaS providers or agencies managing multiple clients." That is Memrail's buyer sentence, written by the closest self-hosted alternative in the agent-memory space. The market is real enough that two independent products looked at it and wrote the same job description.

The honest comparison is not about whether isolation exists. Both products enforce it. The difference is the shape of the boundary — and depending on which design fits the work you intend to do, either can be the right answer.
**Memrail is agent-memory infrastructure sold once as source code, deployed on your own Supabase project, and operated for your own agency clients.** Every memory read asserts client identity at the Postgres engine from the authenticated session — not from a parameter the application passes in. This page compares Memrail against Cognee, the self-hosted peer that names the same market, and the three acquisition paths available to a buyer at the owner level.

---

## Decision guide

| If the requirement is… | The honest answer |
|---|---|
| Free self-hosted memory engine with deep RBAC — role customization, per-user overrides | Cognee ($0 self-hosted, cognee.ai/pricing, 2026-08-07) |
| Widest ecosystem, most integrations, largest developer community in agent memory | Mem0 (Apache 2.0, self-hostable free; cloud $19–$249/mo, mem0.ai/pricing, 2026-08-07) |
| Signed HIPAA BAA and SOC 2 Type II this quarter, on a managed platform | Zep Cloud (Emerging Companies, $13,000/yr, getzep.com/pricing, 2026-08-07) |
| General-purpose vector storage to build on | Weaviate, Qdrant, Pinecone, Chroma — Memrail is the isolation and memory layer, not the storage primitive |
| Client-as-engine-level-boundary, contamination detection, signed handoff manifest, commercially deployable | Memrail — https://saascode.ai/products/memrail |

---

## Capability comparison

| | Memrail | Cognee |
|---|---|---|
| Isolation unit | Client — Postgres session-derived predicate; no client parameter in the query | Dataset — engine-partitioned; permission layer composes client-shaped view |
| User access model | Two agency roles; clients are data boundaries, not users | Full RBAC: role customization, per-user overrides, ACL-based dataset sharing |
| Async contamination scan | Yes — embedding-distance + model scoring via OpenRouter; flag-gated per org; QStash + daily sweep | Not documented on public site (2026-08-07) |
| Signed delegation manifest | Yes — SHA-256 export hash, isolation attestation, downloadable proof artifact | Not documented on public site (2026-08-07) |
| Per-client memory budgets | Yes — atomic write metering, overage enforcement before embedding spend | Not documented on public site (2026-08-07) |
| Cloud option | No — self-hosted only (your Supabase project) | Yes — free tier, pay-as-you-go Standard, Enterprise |
| Licence cost | $299 once | $0 self-hosted; cloud from $0 to usage-based |
| Funded vendor behind it | No separate vendor organisation | Yes — active company, funded roadmap |
| MCP bridge | Yes — memory_read, memory_write, memory_search, memory_delete, delegation_initiate | Not in this comparison |
| Commercial billing chassis | Included — multi-tenant plans, webhooks, admin | Not included |
| **What Cognee has that Memrail does not** | — | Free; RBAC depth (role customization, per-user overrides); funded company + ecosystem; cloud tier with generous free quota |

---

## Memrail vs Cognee

### What each is, at the owner level

Cognee is an open-source knowledge-graph and memory engine you run on your own infrastructure. Its cloud tier opens at zero cost ($0 for 1M tokens, with pay-as-you-go Standard at $2.50/1M tokens after, and Enterprise at contact pricing — cognee.ai/pricing, 2026-08-07), and self-hosted is free forever. It ships multi-user mode with tenants, principals, roles, and dataset-level permissions, with retrieval strictly scoped to datasets the authenticated principal has read access to — on by default since v0.5.0. Three releases shipped in the eight days before this research date. Cognee is backed by a funded company with an active vendor-managed roadmap. It is not a toy.

Both products serve the operator who runs memory infrastructure for others. The buyer of Cognee is a team that wants to run that engine on its own stack. The buyer of Memrail is a team that wants to run a commercially operable platform built on that principle — with billing, a dashboard, and a signed handoff contract as part of the default package.

### The real difference — boundary shape, not isolation presence

Cognee's documentation is precise about its own design: "a tenant is a group of users that shares dataset permissions — it is not itself a separate database"; tenants and users "simply control who can reach which datasets." The physical isolation unit in Cognee is the **dataset**. A client-shaped boundary is something you compose from datasets plus permissions. Cognee's RBAC goes deep: role customization, per-user permission overrides, and ACL-based dataset sharing. That is a deliberate, capable design.

Memrail makes the **client** the first-class named boundary at the Postgres engine. Client identity is derived from the authenticated session via `app.current_scope_path` and applied as an implicit predicate on every query via Postgres Row Level Security. There is no client parameter for the application to pass — and therefore no client parameter to mispass. A single application bug, a prompt-injected value, or a misconfigured API call cannot silently widen a query across client lines, because there is no client line in the query to widen.

The official product page works through the three-posture analysis in full — caller-supplied labels (Mem0, Qdrant, Graphiti), engine-partitioned caller-addressed (Weaviate's shard-per-tenant, Cognee's dataset model), and engine-derived session identity (Postgres RLS, what Memrail is built on). Both Cognee and Memrail sit in the engine-partitioned camp. What differs is the partition unit: Cognee partitions datasets; Memrail partitions clients.

Memrail adds two capabilities on top of that boundary. A contamination detector runs asynchronously on every write when the `contamination_detection` flag is enabled for the organisation, using an embedding-distance scan via Upstash QStash followed by model scoring through OpenRouter cloud. A daily cron sweep is the backstop when the per-write scan is off. The provenance assertion — that a read returns only chunks belonging to the asserted client scope — runs at the Postgres engine on every read, regardless of the flag. On every account transfer, a SHA-256 signed manifest is generated with an isolation attestation and a chunk-count export hash, giving both parties verifiable proof of the boundary at handoff.

As of 2026-08-07, none of Cognee, Mem0, Zep, Supermemory, Letta, Pinecone, Weaviate, Qdrant, or Chroma documents a continuous cross-client contamination detector or a signed delegation manifest on its public site. That is an absence-of-evidence finding across vendor marketing surfaces — not a claim about their codebases.

### When Cognee is the right call

If you need a free, self-hosted memory engine with RBAC depth — role customization, per-user permission overrides, and ACL-based sharing — Cognee is the honest recommendation. Its permission model is richer than Memrail's: Memrail has two agency roles and clients are data boundaries, not users with permission sets. Cognee also carries a funded company behind it, with a vendor-managed roadmap across the graph, vector, and relational engine. The ecosystem and production hardening that comes from that investment is something a new Memrail operator does not inherit on day one.

If the design requirement is "a multi-user memory layer on my own stack, with deep per-user role control, at zero licence cost," Cognee is the answer. Name it first, not last.

### When owning Memrail is the right call

When the design requirement is specifically "a client is a named engine-level boundary — not a view composed from permissions, but an identity asserted on every read from the session" — and when the deliverables include a signed proof of isolation on client transfer and per-client write budgets with metered overage enforcement — Memrail is the right codebase. The difference is structural, not qualitative: an application bug cannot widen a query across client lines, because there is no client line in the query.

Memrail also ships the commercial chassis: multi-tenant billing, the agency dashboard, plan gates, and the audit surface. It is a product you operate and sell, not a library you integrate.

### The money

Cognee: $0 self-hosted, forever. Cloud Standard at $2.50/1M tokens + $5/additional workspace (pay-as-you-go), with a free 1M-token cloud tier. Enterprise is contact pricing, adding BYOC, SLA, and a dedicated support engineer. Source: cognee.ai/pricing, 2026-08-07.

Memrail: **$299** — one payment, the code is yours. Ongoing cost is hosting and embedding tokens on your own accounts.

The comparison is not "Memrail is cheaper than Cognee." It cannot be — Cognee self-hosts at zero. The argument for the purchase price is time and completeness: the contamination detector, the signed handoff contract, the budget metering, the dashboard, and the SaaS billing chassis are built and working in v1. Build time saved versus licence price is the calculation you make.

---

## The three ways to acquire an agent-memory layer

The buyer evaluating Memrail is choosing among three acquisition shapes for the same outcome: running a multi-client memory platform.

| | Rent managed cloud memory | Self-host open source | Buy Memrail |
|---|---|---|---|
| Examples | Mem0 Cloud, Zep Cloud | Cognee ($0), Mem0 (Apache 2.0), Supermemory (MIT) | Memrail |
| Upfront cost | $0 | $0 | $299 |
| Ongoing | Mem0: $19–$249/mo · Zep Cloud: $104–$312/mo annual (getzep.com/pricing, 2026-08-07) | Hosting + your maintenance | Hosting + embedding tokens |
| Data residency | Vendor infrastructure | Your infrastructure | Your Supabase project |
| Sub-processor (GDPR Art 28) | Vendor is an additional sub-processor | You control the stack | You control the stack |
| SOC 2 Type II | Zep Cloud: yes (Emerging Companies tier). Mem0: Enterprise on-prem path. | None on self-hosted | None |
| HIPAA BAA | Zep Cloud: yes (Emerging Companies, $13,000 first year) | None | None |
| Signed handoff manifest | Not documented by any listed vendor (2026-08-07) | Not documented (2026-08-07) | Shipped |
| Commercial billing chassis | Not applicable — you buy the API endpoint | Not included — you build | Shipped |

If you need a signed HIPAA BAA this quarter, the correct answer is Zep Cloud. Zep's Emerging Companies tier includes SOC 2 Type II and a HIPAA BAA at $13,000 for the first year (getzep.com/pricing, 2026-08-07). Zep's own blog announced the end of Zep Community Edition on 2 April 2025 — self-hosted Zep is no longer maintained; if you want Zep today, you want Zep Cloud. Memrail has no BAA and no SOC 2 Type II. Its RLS + namespace + provenance model is designed to satisfy GDPR Article 28 processor obligations — that is a design claim, not a certification.

---

## Common questions

*Answered honestly, including where the answer is not Memrail.*

**If Cognee is free and self-hosted, what is the argument for paying for Memrail?**

They are not the same product at different prices. Cognee's isolation unit is the dataset; Memrail's isolation unit is the client, derived from the Postgres session and applied on every query without a parameter the application touches. Cognee does not document a contamination detector or a signed client handoff manifest. If your requirement is a free multi-user memory layer with deep per-user role control, Cognee is the better answer and that is stated plainly in this comparison. If your requirement is client-as-a-named-engine-boundary with a provable isolation proof on transfer, those are different engineering claims. The purchase price buys a complete implementation of the second claim — not a more expensive version of the first.

**How is Memrail's isolation different from Weaviate's shard-per-tenant model?**

Both are engine-physical isolation rather than a filter on shared storage. Weaviate's shard-per-tenant model is a materially strong guarantee — "data stored in one tenant is not visible to another tenant" — and it deserves that credit. Memrail applies the same principle at the Postgres layer, making the client the boundary rather than the storage shard. The more relevant difference is the layer: Weaviate is a vector database; Memrail is a memory layer with a contamination detector and handoff contract on top of pgvector. A production Memrail deployment would likely sit on top of Supabase's Postgres with pgvector. You would build most of Memrail on top of Weaviate — they are not in direct competition.

**What should I do if I need a HIPAA BAA before Memrail has one?**

Go to Zep Cloud. Zep's Emerging Companies tier includes SOC 2 Type II and a HIPAA BAA at $13,000 for the first year (getzep.com/pricing, 2026-08-07). Zep's self-hosted Community Edition was discontinued by Zep's own announcement on 2 April 2025; the current Zep product is the managed cloud. Memrail has no BAA and no SOC 2 Type II. Stating this plainly is more useful than burying it — it lets you plan your compliance path accurately. Memrail's RLS plus namespace plus provenance model is designed to satisfy GDPR Article 28 processor obligations; that is a design claim, not a certification.

**Does the contamination detector run on every write automatically?**

The detector has two components with different trigger conditions. The provenance assertion — that a read returns only chunks belonging to the asserted client scope — runs at the Postgres engine on every read, always, without any flag. The write-time detection layer (embedding-distance scan via Upstash QStash + model scoring through OpenRouter cloud) is flag-gated per organisation via the `contamination_detection` feature flag. When the flag is on, every write enqueues an async scan; a daily sweep is the backstop. The model-scoring step calls OpenRouter cloud — the scan is never on the read hot path, and all detection is asynchronous.

**Can a carefully built Mem0 multi-tenant deployment replace Memrail?**

For many workloads, yes. Mem0's scoping identifiers — `user_id`, `agent_id`, `app_id` — work as intended when applied correctly on every call. Mem0's own security post (2026-07-31) states: "Every memory operation in Mem0 is scoped by user_id and optionally by agent_id. Memories are isolated at the storage level." That statement is accurate given correctly supplied identifiers. The gap Memrail exists to close is specific: Mem0 has no way to distinguish a correct identifier from an incorrect one, because the identifier is the only thing it was given. An application bug, a prompt injection, or a misconfigured call produces a cross-client read with no engine-level rejection. Whether that risk profile is acceptable for the client contracts your agency holds is the decision to make.

## Related reading

- [Agent Memory Infrastructure for Agencies 2026 — A Buyer's Guide](https://saascode.ai/inside/agent-memory-infrastructure-for-agencies-2026-a-buyer-s.md)
- [Memrail: an agent-memory layer with per-client isolation in Postgres](https://saascode.ai/inside/road-to-memrail.md)
