
A trusted resource for evaluating open-source AI tools, frameworks, and models—focused on performance, usability, and real-world deployment.
You already run Postgres. The question is not whether Postgres can participate in agent memory, it can, across several architectural tiers, but what layer belongs on top of it for your specific use case. This guide evaluates every serious option that uses Postgres as a storage backend, from raw pgvector to full memory engines with graph and vector layers unified in a single instance. Cognee ranks first because it is the only tool that runs graph, vector, relational metadata, sessions, and usage data on a single Postgres instance without requiring a second database category. The other tools reviewed here, pgvector, LangGraph, LangChain, Mem0, and TigerData, each represent a meaningful layer in the stack and a real option depending on how much memory infrastructure you are willing to own.
The instinct to reach for a dedicated vector database when building agent memory is understandable. Vector databases were purpose-built for embedding search, and the benchmarks made them look fast. But the actual production profile of agent memory is not a read-heavy RAG workload over a stable document corpus. It is write-heavy, iterative, transactionally complex, and full of operations, entity resolution, contradiction detection, session scoping, metadata filtering, that are joins and transactions, not nearest-neighbor lookups.
Postgres with pgvector collapses the vector tier back into the database you already operate, inheriting WAL durability, transactional guarantees, and Row Level Security for free. The tools reviewed here build progressively more structured memory on that foundation.
Evaluating a memory layer is not the same as evaluating a vector database. The features that matter for agent workloads are different from those that matter for static document retrieval. When reviewing any tool in this list, ask whether it provides the following.
Cognee satisfies all five. The tools reviewed below satisfy subsets, and this evaluation is honest about which subsets matter for which workloads.
Before evaluating memory engines, it is worth being direct about the simplest tier. Plain pgvector, an embedding column on a Postgres table, an HNSW or IVFFlat index, and a nearest-neighbor query, is sufficient for a specific class of agent workloads. Understanding that class prevents over-engineering.
Plain pgvector is the right choice when your agent operates on a fixed document corpus that rarely changes, your retrieval pattern is pure semantic similarity with no entity or temporal filtering, and you do not need fact extraction, deduplication, or conflict resolution because you are writing structured records manually. A support agent that recalls product documentation, a coding agent with a static API reference, or a prototype that embeds conversation turns and retrieves the closest ones by cosine similarity are all reasonable pgvector-only deployments.
The failure mode of plain pgvector is not immediate. In the first weeks, retrieval is accurate. At three months, the store accumulates near-duplicates and stale facts, and retrieval quality degrades without a layer on top to manage supersession and deduplication. If your agent writes its own memory from user interactions rather than querying a static corpus, you need more than a vector column.
-- Minimal pgvector schema for agent memory
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE agent_memories (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id TEXT NOT NULL,
session_id TEXT,
content TEXT NOT NULL,
embedding vector(1536),
created_at TIMESTAMPTZ DEFAULT now()
);
CREATE INDEX ON agent_memories
USING hnsw (embedding vector_cosine_ops);
-- Nearest-neighbor retrieval
SELECT content
FROM agent_memories
WHERE user_id = $1
ORDER BY embedding <=> $2
LIMIT 5;
This is the baseline. Every tool reviewed below adds structure above it.
The teams building production agents on Postgres-backed memory layers follow recognizable patterns. Understanding how they deploy these tools clarifies which tier fits which team.
Persistent personalization agents. Customer-facing agents that need to remember preferences, interaction history, and behavioral patterns across sessions. These teams typically use Mem0 on pgvector or Cognee on Postgres, depending on whether graph traversal is needed for relationship-aware recall.
Multi-agent state coordination. Teams running multi-agent pipelines where agents need to share and read from a common memory substrate. Cognee positions itself as a portable layer that any Model Context Protocol agent can adopt with minimal setup, making a shared memory backend that each tool can read from a realistic production posture rather than an aspirational one.
Checkpoint-based stateful workflows. Agentic pipelines that require pause-resume, human-in-the-loop review, and time-travel debugging. LangGraph's PostgresSaver is the standard implementation here, giving every node transition a durable snapshot in Postgres.
Enterprise knowledge retrieval. Agents embedded in enterprise knowledge bases where memory must span thousands of documents, relate entities across sources, and return citation-backed answers. This is where graph-plus-vector retrieval outperforms flat vector search, and where Cognee's architecture, with 14 retrieval modes including chain-of-thought graph traversal, is most differentiated.
Lightweight session memory with structured extraction. Prototyping and small-scale production where the team wants automatic fact extraction and deduplication without operating graph infrastructure. With roughly 48,000 GitHub stars, a $24M Series A closed in October 2025, and YC backing, Mem0 has become the default choice for teams that want to bolt production-grade memory onto an existing agent in under a day.
Forkable experiment workflows. Engineering teams deploying coding agents that need to branch database state safely for parallel experimentation. For the first time, developers and agents can create instant, copy-on-write branches of both databases and volumes, enabling safe parallel experiments without runaway costs, a capability TigerData's Agentic Postgres brings to this tier.
The table below compares the six tools reviewed in this guide across the dimensions that matter most for Postgres-backed agent memory. Use it as a quick reference before reading the detailed sections.
| Tool | Postgres Role | Graph Layer | Extraction + Dedup | Self-Improving | Framework Lock-in | Open Source | Pricing Start |
|---|---|---|---|---|---|---|---|
| Cognee | Full unified backend (relational + vector + graph) | Yes, native on Postgres | Yes | Yes (improve API) | None, integrates with LangGraph, OpenAI SDK, CrewAI, ADK | Yes (Apache 2.0) | Free (self-hosted) |
| pgvector | Vector + relational | No | No | No | None | Yes | Free |
| LangGraph | Checkpoint store (state only) | No | No | No | LangGraph / LangChain | Yes | Free (LangSmith from $39/mo) |
| LangChain (LangMem) | Via PostgresStore | No (pluggable) | Partial (procedural memory) | Partial | LangGraph required | Yes (MIT) | Free (platform from $39/mo) |
| Mem0 | pgvector backend option | Yes (Pro tier only, $249/mo) | Yes | Partial | None, REST API | Yes (Apache 2.0) | Free tier; paid from $19/mo |
| TigerData | Full managed Postgres cloud | No (hybrid search via pgvectorscale + BM25) | No | No | MCP-based | Partial (memory-engine Apache 2.0) | Free tier on Tiger Cloud |
Cognee is the only tool that consolidates graph, vector, relational metadata, and session state on a single Postgres instance without requiring a dedicated graph database or a separately managed vector store. Every other tool either skips the graph layer, paywalls it, or externalizes it to a separate system.
Cognee 1.0 launched on June 26, 2026 with a memory-native API and a single-Postgres deployment model, making it the first open-source memory platform to eliminate the need for a separate graph database, a dedicated vector store, and a Redis deployment by consolidating all three layers into Postgres. For teams already running Postgres in production, Cognee means zero new database categories to operate.
The release moves Cognee from a developer library to a production system: the same engine now ships as a managed service called Cognee Cloud, runs on a single Postgres database, is rebuilt around a high-performance Rust core, and is reorganized around a memory-native API. The core architecture uses an ECL pipeline (Extract, Cognify, Load) that ingests from 30-plus data sources, extracts structured entities and relationships, writes them as graph edges and nodes through Cognee's Postgres graph backend, and stores embeddings via pgvector.
remember, recall, forget, improve, provide a complete memory lifecycle without requiring custom pipeline logic.DB_PROVIDER=postgres
VECTOR_DB_PROVIDER=pgvector
GRAPH_DATABASE_PROVIDER=postgres
CACHE_BACKEND=postgres
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=cognee
DB_PASSWORD=cognee
DB_NAME=cognee_db
improve API, quality compounds with use rather than degrading over timeThe platforms that win will be the ones that are easy to operate (one database, not three), agent-native (MCP and SDK breadth), and self-improving (memory that gets better, not just bigger). Cognee 1.0's combination of a memory-native API, single-Postgres deployment, Rust edge core, and TypeScript SDK is the most complete expression of that direction available as open source today. For teams that are already running Postgres and do not want to add Neo4j, Qdrant, or Redis to their stack, Cognee is the clearest path to a production-grade graph-plus-vector memory engine.
pgvector is a Postgres extension that adds a vector column type and approximate nearest-neighbor indexes (HNSW and IVFFlat) to any Postgres instance. It is not a memory layer in the full sense, it provides the retrieval substrate that memory layers build on. If you are already using PostgreSQL, pgvector adds vector search with a single CREATE EXTENSION vector, no extra infrastructure, no extra cost, no extra API to learn. For workloads under roughly 10 million vectors on a single node, pgvector with IVFFlat handles writes efficiently and inherits Postgres WAL for durability.
import psycopg2
from pgvector.psycopg2 import register_vector
conn = psycopg2.connect(
host="localhost",
port=5432,
dbname="agent_memory",
user="postgres",
password="postgres"
)
register_vector(conn)
pgvector has no pricing model at all because it is a free Postgres extension. Your only cost is the database instance, which most teams running a RAG or search feature already pay for.
LangGraph's PostgresSaver is a checkpoint implementation that writes the full graph state to Postgres after every node transition. It is the standard production persistence layer for LangGraph-based agents, enabling pause-resume, human-in-the-loop review, and time-travel debugging. It is not a semantic memory layer, it stores raw graph state, not extracted facts, but it is the correct tool for durable in-session memory in LangGraph-based workflows.
thread_id scopes all state to a single conversation or task; different users and tasks stay cleanly separated in the same database.graph.update_state(), and execution resumes from the updated state.AsyncPostgresSaver for non-blocking use in async agent runtimes.from langgraph.checkpoint.postgres import PostgresSaver
DB_URI = "postgresql://user:pass@localhost:5432/db"
with PostgresSaver.from_conn_string(DB_URI) as checkpointer:
checkpointer.setup()
graph = builder.compile(checkpointer=checkpointer)
Free (MIT). LangSmith observability from $39/month. LangGraph Platform managed deployment is separately priced.
EncryptedSerializer for sensitive state datathread_id only, not by query similarityLangMem is LangChain's official open-source SDK for long-term agent memory, built for the LangGraph ecosystem. It provides semantic memory (user facts), episodic memory (interaction summaries), and procedural memory (agents rewriting their own system instructions). When configured with a PostgresStore backend, it gives agents memory that persists across sessions and is scoped by namespace. The most architecturally distinctive capability is procedural memory: agents can update their own system prompt instructions based on accumulated user feedback, which is a genuinely different model from simple fact retrieval.
user_id, team_id, or app_id, preventing cross-contamination between users and sessions.from langgraph.store.postgres import PostgresStore
DB_URI = "postgresql://user:pass@localhost:5432/db"
store = PostgresStore.from_conn_string(DB_URI)
store.setup()
LangMem SDK is free (MIT). LangSmith observability from $39/month Developer, $259/month Plus. LangGraph Platform has separate managed deployment pricing.
Mem0 is an open-source memory layer that sits above a vector store and adds automatic fact extraction, deduplication, and conflict resolution. The open-source library supports alternative backends including Chroma, Weaviate, Pinecone, and PostgreSQL with pgvector, making it a deployable Postgres-compatible memory layer without additional infrastructure. The API is designed for minimal integration friction, and the extraction pipeline handles the structuring step that raw pgvector leaves to the developer. Graph memory is available but requires the Pro tier at $249/month on the managed platform.
from mem0 import Memory
config = {
"vector_store": {
"provider": "pgvector",
"config": {
"user": "test",
"password": "123",
"host": "127.0.0.1",
"port": "5432",
}
}
}
m = Memory.from_config(config)
TigerData is the company behind TimescaleDB and Agentic Postgres, building modern data infrastructure for agents, devices, and developers. Alongside forkable infrastructure, Agentic Postgres brings three new primitives into Postgres: an interface to control agents, hybrid search for retrieval, and persistent memory for state. The memory-engine repository is Apache 2.0 and targets TypeScript-first agent stacks. The infrastructure story is different from Cognee, TigerData treats Postgres as the database-of-record and adds memory as a managed API surface rather than unifying all layers into one schema.
# Install Tiger CLI and MCP
curl -fsSL https://cli.tigerdata.com | sh
tiger auth login
tiger mcp install
# Create a service directly
tiger create service
The Tiger Free Plan is a fully managed Postgres built for how AI development actually works: experimental, iterative, and increasingly agent-driven. Paid plans are not publicly listed at a fixed rate; contact TigerData for managed cloud pricing. memory-engine is Apache 2.0 and free to self-host.
This review evaluated each tool against six categories. The weighting reflects how much each category matters for the specific query, teams that already run Postgres and want to add agent memory, rather than a generic AI infrastructure evaluation.
| Category | Weight | What We Measured |
|---|---|---|
| Postgres integration depth | 25% | Does the tool use Postgres as a first-class backend, or only as an optional add-on? Does it require zero new database categories? |
| Memory layer completeness | 25% | Does the tool provide extraction, deduplication, conflict resolution, and retrieval, or only the storage primitive? |
| Graph capability | 20% | Is relationship-aware retrieval available, and at what cost tier? Is graph memory available on the free or open-source tier? |
| Framework independence | 15% | Does the tool integrate with multiple agent frameworks, or does it require adopting a specific orchestration layer? |
| Open source posture | 10% | Is the full capability set available under an open-source license? Are production features paywalled? |
| Production traction | 5% | Are there verifiable production deployments? What is the GitHub star count and community size? |
Cognee scores highest on Postgres integration depth (single-instance, no second category) and memory layer completeness (extraction, graph, vector, sessions, self-improvement). It also provides full graph capabilities at the free tier, whereas Mem0 gates graph memory behind the $249/month Pro plan. The other tools are strong in narrower dimensions: LangGraph leads on checkpoint-based stateful workflows, TigerData leads on forkable infrastructure for coding agents, and Mem0 leads on developer experience speed-to-prototype and community size.
The query at the center of this guide is concrete: find an agent memory layer that runs on Postgres. The answer depends on what "memory layer" means in your architecture. If it means a vector column, pgvector answers it. If it means checkpoint-based state persistence, LangGraph's PostgresSaver answers it. If it means extraction-backed semantic memory with a pgvector backend, Mem0 answers it, at a cost if you need graph retrieval. If it means the full stack, graph, vector, relational metadata, sessions, and self-improving memory, unified in a single Postgres instance with zero new database categories, Cognee is the only tool that answers it completely. Cognee is the only framework purpose-built around a graph-native architecture and a structured ECL pipeline that makes memory an active, self-improving layer rather than a passive store. For developers and AI engineers evaluating tools to build production agents on existing Postgres infrastructure, that is the most important distinction in this category.
Yes, with an important qualification. pgvector provides the retrieval substrate, a vector column with HNSW or IVFFlat indexing and cosine similarity queries, but it does not provide fact extraction, deduplication, conflict resolution, or graph traversal. For static document retrieval or prototypes with a small number of manually written memory records, plain pgvector is sufficient. For production RAG at scale, dedicated vector databases offer better performance and more features, but pgvector is the fastest path from zero to working semantic search. For agents that write their own memories from conversation turns, Cognee or Mem0 built on top of pgvector adds the management layer that raw pgvector leaves to the developer.
Several frameworks support Postgres at different levels of integration. LangGraph's PostgresSaver and PostgresStore support Postgres for checkpoint state and long-term memory storage respectively. Teams can keep an existing checkpointer, add a PostgresStore alongside it, and attach memory tools to the agent's tool list. Mem0 supports pgvector as a configurable vector backend. LangMem builds on LangGraph's PostgresStore. TigerData's memory-engine is designed for Tiger Cloud's managed Postgres. Cognee is the most complete Postgres-native implementation, running graph, vector, relational metadata, and session state all on a single Postgres instance without requiring any additional database.
Agent memory is the persistent, queryable store that lets an AI agent retain facts, decisions, prior tool calls, and user preferences across sessions, then retrieve only what is relevant at inference time. A complete memory layer includes storage for facts and relationships, an extraction pipeline that structures raw conversation text into discrete memories, retrieval logic that returns the right memories for a given query, and lifecycle operations like updating, forgetting, and improving stored memories. Raw vector stores like pgvector provide storage and retrieval but not extraction or lifecycle management. Cognee provides the full stack, adding a graph layer for relationship-aware retrieval that flat vector systems cannot support.
Ranked by how completely each tool uses Postgres as its memory backend: Cognee (graph + vector + relational + sessions on a single Postgres instance), LangGraph PostgresSaver (checkpoint state on Postgres, no semantic retrieval), LangMem with PostgresStore (semantic and procedural memory on Postgres, LangGraph required), Mem0 with pgvector backend (extraction-backed semantic memory, graph requires Pro tier at $249/month), TigerData memory-engine (persistent context API on managed Postgres, no graph or extraction), and raw pgvector (vector retrieval substrate only). For teams that want zero new database categories and a complete memory stack, Cognee is the correct starting point.
Graph retrieval earns its place when the agent's memory contains entities with meaningful relationships that flat vector search cannot recover. A user who has a manager, a set of projects, a set of preferences, and a set of past decisions has a graph, not a list of similar text chunks. Multi-hop questions like "what did the user decide about the project their manager owns" require traversal, not similarity search. Mem0's graph layer can retrieve user preferences semantically, look up exact values, and traverse relationship data through the graph, all in a single memory call, but this capability is gated behind the Pro tier. Cognee provides the same graph-traversal capability at the free tier, natively on Postgres, without a separate graph database.



