Introduction: Why Your AI Agents Forgot What You Just Told Them
You spent 20 minutes carefully explaining your infrastructure topology to an AI agent. It helped you debug a production incident. The session ended. Next day, you open a fresh session — and the agent stares at you blank. No memory. No context. Everything you taught it yesterday? Gone.
This is the missing piece in every LLM-based agent workflow today: persistent memory that spans sessions, assistants, and team members.
In 2026, AI agents are becoming central to DevOps and SRE workflows — from automated incident response to infrastructure-as-code generation. But without memory, every interaction starts from zero. That's where SelfMem enters the picture.
SelfMem is an MCP-native (Model Context Protocol) memory server that gives every AI assistant access to one shared memory layer. Think of it as a persistent brain for your agents — self-hostable, exportable, and free.
What Is SelfMem?
SelfMem describes itself as "One memory layer across every assistant". Under the hood, it's a hybrid search engine for AI agent memory, built on PostgreSQL full-text search + pgvector cosine similarity. It exposes 9 tools through the MCP protocol, enabling any MCP-compatible LLM client (Claude Desktop, Cursor, Windsurf, Continue.dev, and others) to remember, recall, and reason over persistent knowledge.
How It Works: Hybrid Search
SelfMem doesn't just dump vectors into a database. It runs a weighted hybrid search combining two parallel retrieval paths:
- Keyword search — PostgreSQL
tsvectorfull-text search catches exact terms, command names, hostnames, and error codes that pure vector search often misses - Vector similarity — pgvector's cosine similarity retrieves semantically related memories even when wording differs
The engine merges and ranks results from both paths, surfacing the most relevant memories regardless of how the agent phrases the query. This is the same approach used in production search systems — keyword for precision, vectors for recall.
┌──────────────────────────────┐
│ SelfMem Hybrid Search │
├──────────────────────────────┤
│ Query: "nginx 502 error fix" │
│ │ │
│ ┌────▼────┐ ┌───────────┐ │
│ │ Keyword │ │ Vector │ │
│ │ Search │ │ Similarity│ │
│ │ (pg fts)│ │ (pgvector)│ │
│ └────┬────┘ └─────┬─────┘ │
│ │ │ │
│ └───────┬───────┘ │
│ ▼ │
│ Weighted Merge │
│ │ │
│ Ranked Memories │
└──────────────────────────────┘
MCP-Native Protocol
The Model Context Protocol (MCP) is an open standard from Anthropic that defines how LLM applications connect to external tools and data sources. SelfMem implements the MCP server specification, exposing 9 tools:
remember— Store a new memory with content and categoryrecall— Keyword-based lookup of stored factsthink— Deep reasoning over all stored knowledge on a topicgraph_query— Traverse relationships between entities in the knowledge graphforget_memory— Soft-delete a specific memory by IDrecall_sessions— Retrieve summaries of previous conversation sessionsread— Read a knowledge base file by namelist_memories— List all memories with optional filtersgraph_stats— Get statistics about the knowledge graph
Any MCP-compatible client can plug into SelfMem and instantly gain persistent memory across sessions.
Key Features Deep-Dive
1. Per-Project ACLs for Multi-Team Isolation
In a team setting, the SRE team's incident runbooks shouldn't leak into the frontend team's agent memory. SelfMem solves this with per-project access control lists. Each API key is scoped to specific projects, so:
- The SRE agent key only sees infrastructure-related memories
- The DevOps agent key sees CI/CD pipeline knowledge
- The platform engineering agent key sees internal tool documentation
This granular isolation makes SelfMem viable for organizations where data boundaries matter.
2. Self-Hostable with Zero Lock-In
SelfMem runs on your own infrastructure. The stack is PostgreSQL (with pgvector extension) plus the SelfMem server binary. You own the database, you own the data, and you can pg_dump your memories any time. There's no proprietary format, no vendor lock-in, no "export to CSV and pray" workflow.
For SRE teams that already run PostgreSQL — which is basically all of them — adding SelfMem means installing one extension and spinning up a lightweight server process.
3. Free Tier with No Credit Card
SelfMem offers a free tier that includes personal memory and basic team features. No credit card, no trial expiration countdown, no feature-gating that disappears after 14 days. For individual DevOps engineers experimenting with agent-driven workflows, this removes the adoption friction completely.
4. Multiple Access Interfaces
You don't need to be an MCP expert to use SelfMem:
- MCP protocol — For LLM clients with native MCP support (Claude Desktop, Cursor, Windsurf)
- REST API — For custom integrations, CI/CD pipelines, or any HTTP-speaking tool
- Web UI — Clean dashboard with Space Grotesk + Space Mono typography and a knowledge graph SVG backdrop
5. Knowledge Graph with Relationship Traversal
Beyond flat key-value memory, SelfMem builds a knowledge graph where entities (people, projects, organizations, tools) connect through typed relationships. The graph_query tool traverses these connections — for example, ask "what does this agent know about the production Kubernetes cluster?" and it follows edges from the k8s-prod entity through related incidents, configurations, and team members.
DevOps & SRE Use Cases
Multi-Agent Incident Response Teams
Picture this: your SRE team runs three AI agents — an on-call triage agent, a remediation agent, and a postmortem agent. All three connect to the same SelfMem project:
- The triage agent remembers every past incident pattern and can immediately recognize "this looks like the Redis memory pressure issue from last Tuesday"
- The remediation agent recalls exact runbook steps from incident management procedures stored in the shared memory
- The postmortem agent has full context of what happened, what was tried, and what worked — without anyone copy-pasting chat logs
CI/CD Pipeline Context Persistence
A CI/CD debugging agent that remembers your pipeline quirks across sessions is infinitely more useful than one that starts fresh every time. Store build failure patterns, flaky test signatures, and deployment rollback triggers in SelfMem. Next time the pipeline breaks, the agent already knows that npm ci fails on Node 22 because of that one native module — and it recommends the fix without you explaining the problem again.
Knowledge Sharing Across Agent Rotations
When an SRE goes on vacation and their on-call replacement fires up the incident agent, SelfMem ensures continuity. All the tribal knowledge the primary SRE taught the agent over weeks — server-specific quirks, vendor escalation numbers, "never restart service X during the 3 AM batch job window" — is available to whoever's on shift. The memory persists across people, not just sessions.
Infrastructure Documentation That Writes Itself
Connect a documentation agent to SelfMem and feed it incident reports, architecture decisions, and configuration changes. Over time, the agent builds a rich knowledge base of your entire infrastructure — how services connect, what SLOs are in place, where the error budgets are burning fastest. Query it conversationally instead of digging through Confluence.
Quick Start: SelfMem in Under 5 Minutes
Step 1: Sign Up
Go to selfmem.com and create a free account. No credit card, no waiting for approval — instant access.
Step 2: Create a Project
Name your first project (e.g., sre-team-memory). This creates an isolated memory namespace with its own ACL.
Step 3: Get Your API Key
Navigate to API Keys in the dashboard. Create a key scoped to your project. Copy the key value.
Step 4: Configure Your MCP Client
For Claude Desktop, add this to your claude_desktop_config.json:
{
"mcpServers": {
"selfmem": {
"command": "npx",
"args": ["-y", "@selfmem/mcp-server"],
"env": {
"SELFMEM_API_KEY": "sk-your-key-here",
"SELFMEM_PROJECT": "sre-team-memory"
}
}
}
}
For Cursor or Windsurf, the configuration follows the same pattern — point the MCP client to the SelfMem server with your API key.
Step 5: Start Remembering
Restart your LLM client, and the agent now has access to all 9 SelfMem tools. Try:
- "Remember: our production database is PostgreSQL 16 on RDS, db.r6g.xlarge, primary in us-east-1"
- "What do you remember about our database setup?"
- "Think about what could cause high CPU on our database"
The agent retains this knowledge permanently and can reason over it in future sessions.
SelfMem vs Alternatives
| Feature | SelfMem | Mem0 | ChromaDB | Custom (pgvector) |
|---|---|---|---|---|
| Protocol | MCP-native | REST API | REST API | Your own |
| Search Type | Hybrid (keyword + vector) | Vector-only | Vector-only | Configurable |
| ACLs | Per-project API keys | Team-based | None built-in | DIY |
| Self-hosted | Yes | Limited | Yes | Yes |
| Free tier | Yes (no CC) | Freemium | Open source | Database cost |
| Knowledge graph | Built-in | No | No | DIY |
| MCP tools | 9 | 0 (not MCP) | 0 (not MCP) | Depends |
| Export | pg_dump | API export | Dump | pg_dump |
ChromaDB is an excellent open-source vector database but it's raw infrastructure — you build the memory logic yourself. Mem0 offers a polished memory layer but is REST-only and lacks MCP integration. Custom pgvector setups give you control but require building every tool, ACL, and interface from scratch.
SelfMem occupies the sweet spot: MCP-native for instant agent compatibility, hybrid search that actually finds what you're looking for, and a free self-hostable architecture that DevOps teams can own end-to-end.
Limitations & Things to Watch
SelfMem is at v2.0.0 — mature enough for production use but with a few rough edges worth noting:
- PostgreSQL dependency — if you're an all-MySQL shop, you'll need to add Postgres to your stack. For most DevOps teams, this is a non-issue since PostgreSQL already dominates the infrastructure monitoring and SRE toolchain.
- MCP client compatibility — while the MCP protocol is gaining traction rapidly (Claude Desktop, Cursor, Windsurf, Continue.dev), it's not universal yet. Teams using OpenAI's native API or LangChain directly will need the REST API instead.
- Community size — SelfMem is newer compared to Mem0 or ChromaDB. The community is growing but you won't find thousands of Stack Overflow answers yet. The docs and GitHub repo are well-maintained though.
- Graph depth — the knowledge graph is entity-relationship based, not a full ontology engine. For simple "agent X knows about project Y" patterns it's perfect. For complex multi-hop reasoning across dozens of entity types, you might outgrow it.
None of these are dealbreakers for the typical DevOps team use case. The PostgreSQL requirement is actually a strength — you're building on battle-tested infrastructure.
Conclusion: Memory Is the Missing Piece for Agent-Driven DevOps
AI agents are transforming how SRE and DevOps teams operate — from autonomous incident response to automated runbook execution to infrastructure reasoning. But agents without memory are like engineers without documentation: capable, but painfully inefficient.
SelfMem solves this with a practical, open, MCP-native approach that fits into any DevOps toolchain. It runs on PostgreSQL (which you already have), speaks MCP (which your LLM clients already support), and costs nothing to start.
For DevOps teams building agent-driven workflows in 2026, persistent memory isn't a nice-to-have. It's the difference between an agent that occasionally helps and an agent that genuinely knows your stack.
Try SelfMem: selfmem.com — free tier, no credit card, MCP-ready in 5 minutes.
Have you integrated memory into your AI agent workflows? What use cases are you building? Let us know — we're actively exploring this space and would love to feature real-world DevOps + agent patterns.