Cockroach Memory Agent
Provides persistent memory for LangChain agents, compatible with langchain-cockroachdb for drop-in use as a LangChain-native memory backend.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cockroach Memory AgentSearch my memories for the 'code review' notes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Cockroach Memory Agent
An AI agent with persistent, globally-distributed memory backed by CockroachDB's MCP Server and AWS S3 — built for the CockroachDB × AWS Hackathon.
Live demo: https://cockroach-memory-agent.vercel.app GitHub: https://github.com/0xConsole/cockroach-memory-agent
The Problem
AI agents are amnesiac. Every conversation starts from scratch. Every process restart loses context. Every scale-out creates new instances that don't share memory. This makes agents unreliable for production:
A DevOps agent that monitored incidents yesterday can't reference them today
A code review agent that learned your codebase patterns forgets on restart
A trading agent that tracked market conditions loses its history on redeploy
Multi-region deployments can't share a consistent memory store
Related MCP server: Memclaw
The Solution
Cockroach Memory Agent gives agents a persistent, globally-distributed memory backed by CockroachDB's distributed SQL database. It uses CockroachDB's MCP Server for all database operations, ensuring every memory is stored, retrieved, and audited through a standardized protocol — with automatic AWS S3 backups for disaster recovery.
Key Features
Persistent Memory — memories survive process restarts, failures, and redeployments
MCP Protocol — all DB operations go through CockroachDB's MCP Server (15 tools: 10 read + 5 write)
AWS S3 Backup — periodic gzip-compressed memory snapshots with restore capability
Audit Trail — every MCP tool call is logged with input/output for compliance
Session Isolation — multi-session support with session-scoped memory recall
Multi-Region Topology — CockroachDB's global distribution for low-latency memory access
Full-Text Search — search memories by content (SQLite FTS5 demo / CockroachDB ILIKE)
Works without a cluster — mock transport simulates the full MCP server so the demo runs anywhere
Unique Angle
Unlike ephemeral agent memory (Redis, in-process dicts), Cockroach Memory Agent uses CockroachDB's MCP Server for persistent, globally-distributed, audited memory that survives restarts and scales across regions — with automatic AWS S3 backups for disaster recovery.
How It Uses CockroachDB (≥2 tools requirement)
CockroachDB MCP Server — all memory operations (create table, insert, select, delete, cluster info, cluster nodes) go through the MCP Server's 15 tools (10 read + 5 write). The MCP client wraps every operation as a tool call with full audit logging. Compatible with Claude Code, Cursor, and VS Code.
LangChain CockroachDB Integration — the architecture is compatible with
langchain-cockroachdbfor LangChain-native memory backends, enabling drop-in use with LangChain agents.
The 15 CockroachDB MCP Server Tools
Read (10): list_databases, list_tables, get_table_schema, get_cluster, list_sql_users, list_cluster_nodes, show_running_queries, select_query, explain_query, show_statement
Write (5): create_database, create_table, insert_rows, update_rows, delete_rows
How It Uses AWS (≥1 service requirement)
AWS S3 — periodic gzip-compressed memory snapshots with backup/restore/list operations. Free tier compatible (5 GB storage, 2,000 PUT, 20,000 GET requests/month). Mock fallback for demo mode when no AWS credentials are set.
Architecture
┌─────────────┐ ┌─────────────────┐ ┌──────────────────────────┐
│ AI Agent │────▶│ MCP Protocol │────▶│ CockroachDB MCP Server │
│ (chat/CLI) │ │ (tools/call) │ │ (15 tools: 10R + 5W) │
└─────────────┘ └─────────────────┘ └────────────┬─────────────┘
│
┌───────────────────────────┴────────────┐
│ │
┌─────────▼──────────┐ ┌──────────────▼──────────┐
│ CockroachDB │ │ AWS S3 │
│ (multi-region, │ │ (gzip backup │
│ ACID, survivable)│ │ snapshots) │
└────────────────────┘ └─────────────────────────┘
▲
│ (demo fallback)
┌─────────┴──────────┐
│ SQLite + FTS5 │
│ (no-cluster demo) │
└────────────────────┘Memory Schema (mirrors CockroachDB DDL)
CREATE TABLE memories (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
session_id STRING NOT NULL,
kind STRING NOT NULL DEFAULT 'message', -- observation|reflection|plan|message
role STRING NOT NULL, -- user|assistant|system
content STRING NOT NULL,
metadata JSONB NOT NULL DEFAULT '{}'::JSONB,
importance FLOAT NOT NULL DEFAULT 0.5,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX idx_memories_session ON memories(session_id);
CREATE INDEX idx_memories_session_created ON memories(session_id, created_at);
CREATE INVERTED INDEX idx_memories_metadata ON memories(metadata);Demo (the 3-minute judge flow)
Open the live demo → see the chat UI.
Type
Hi, I'm Alice→ agent responds "Nice to meet you, Alice!" (stored via MCPinsert_rows).Click "🔄 Simulate Restart" → memory persists across the restart.
Type
What's my name?→ agent responds "Your name is Alice — I remember from our conversation." (recalled via MCPselect_query).Click the "MCP Tools" tab → see all 23 MCP tools (8 agent + 15 CockroachDB).
Click the "Audit Trail" tab → see every MCP tool call logged with input/output/timestamp.
Click the "AWS S3 Backup" tab → create a gzip-compressed memory snapshot.
Click "▶ Run Auto-Demo" → runs the full 7-phase demo automatically.
The 7-Phase Automated Demo
Store messages via MCP
insert_rowsSimulate process restart → recall (persistence verified)
Ask "What's my name?" → recall works
Search memories for "Python"
AWS S3 backup (gzip compressed)
CockroachDB cluster topology (3 regions)
Full MCP audit trail (100% success rate)
Tech Stack
Python 3.11 + FastAPI
CockroachDB MCP Server (15 tools: 10 read + 5 write)
AWS S3 (boto3, gzip-compressed backups, free tier)
SQLite FTS5 for demo search (mirrors CockroachDB ILIKE)
Vercel serverless (free tier)
Static HTML/CSS/JS UI (no framework, fast load)
Setup (<5 commands)
Run locally
git clone https://github.com/0xConsole/cockroach-memory-agent.git && cd cockroach-memory-agent
pip install -r requirements.txt
uvicorn app.main:app --reload
# Open http://localhost:8000Run the automated demo
curl -X POST http://localhost:8000/api/demo | python -m json.toolConnect a real CockroachDB cluster
export CRDB_DATABASE_URL="postgresql://user:pass@cluster.cockroachlabs.cloud:26257/defaultdb?sslmode=verify-full"
export AWS_S3_BUCKET="my-agent-backups"
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
uvicorn app.main:app --reloadAPI Endpoints
Method | Path | Description |
|
| Interactive chat UI |
|
| Health check |
|
| Send a message to the agent |
|
| Recall all memories for a session |
|
| Full-text search over memories |
|
| Delete all memories for a session |
|
| CockroachDB cluster info + topology |
|
| Back up memories to AWS S3 |
|
| Full MCP audit trail |
|
| Run the 7-phase automated demo |
|
| List MCP tools (MCP |
|
| Call an MCP tool (MCP |
What's Real vs Mocked
Component | Demo (no cluster) | Production (with cluster) |
CockroachDB MCP Server | Mock transport (simulates all 15 tools) | Real MCP server via stdio/HTTP |
Memory storage | SQLite (file-based, persists across restarts) | CockroachDB (distributed ACID) |
Full-text search | SQLite FTS5 | CockroachDB ILIKE |
AWS S3 backup | In-memory mock | Real S3 with boto3 |
Agent response generation | Rule-based (no LLM key needed) | LLM (GPT-4, Claude) with memory context |
The mock transport is not a fake — it faithfully implements the full MCP tool surface so the agent exercises the real MCP integration path. Swapping to a real cluster is a one-line config change (CRDB_DATABASE_URL).
Real-World Usefulness
Production AI agents (DevOps automation, code review, trading, customer support) need persistent memory that:
Survives restarts (process crashes, deploys, scaling)
Scales globally (multi-region, low-latency access)
Provides audit trails (compliance, debugging)
Backs up automatically (disaster recovery)
Integrates with frameworks (LangChain, MCP clients)
A platform team would deploy Cockroach Memory Agent as the memory backend for their agent fleet.
License
Apache 2.0
Links
Live demo: https://cockroach-memory-agent.vercel.app
CockroachDB MCP Server: https://github.com/cockroachdb/cockroachdb-mcp-server
MCP Protocol: https://modelcontextprotocol.io
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceA production-ready MCP server that enables multiple AI agents to collaborate through a shared, concurrency-safe memory space. It supports advanced search, full CRUD operations, and automatic backups to facilitate asynchronous communication between agents.MIT
- Alicense-qualityBmaintenanceGoverned shared memory platform for AI agents and agent fleets. Provides persistent memory, cross-agent knowledge sharing, permissions, audit trails, and multi-tenant isolation through a Model Context Protocol (MCP) server.3424Apache 2.0
- Alicense-qualityDmaintenanceBacks your AI coding agent's memories, skills, and settings to CockroachDB with automatic sync, hybrid semantic+keyword search, knowledge graph, smart context priming, and 16 MCP tools for cross-machine memory management.1MIT
- Alicense-qualityBmaintenancePersistent memory MCP server for AI agents that stores, recalls, and searches conversation history, key-value context, and long-term entries across sessions with semantic search and FIFO queues.761Inno Setup
Related MCP Connectors
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Cloud-hosted MCP server for durable AI memory
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xConsole/cockroach-memory-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server