Back to MCP Servers

Cogmemai

Persistent cognitive memory for Claude Code. Cloud-first with semantic search, AI-powered extraction, and project scoping. Zero local databases.

knowledge-memoryai
By hifriendbot
64Updated 2 weeks agoTypeScriptMIT

Installation

npx -y cogmemai-mcp

Configuration

{
  "mcpServers": {
    "cogmemai-mcp": {
      "command": "npx",
      "args": ["-y", "cogmemai-mcp"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes
<p align="center"> <img src="assets/hero.png" alt="CogmemAi — Cognitive Memory for Any Ai System" width="800"> </p>

npm version License: MIT Quantum Safe

CogmemAi — Cognitive Memory for Any Ai System

Autonomous robots. Self-driving vehicles. Defense systems. Coding assistants. Any Ai system that needs to remember.

<p align="center"> <img src="assets/demo.svg" alt="CogmemAi demo — your Ai assistant remembers your project across sessions" width="800"> </p>

CogmemAi is a portable memory layer that gives any Ai system persistent recall across sessions, devices, users, and teams — and captures knowledge autonomously, even when your Ai forgets to save. 95.10% accuracy on LongMemEval — top published score on the field's hardest long-term memory benchmark. 91% on LoCoMo, above human performance (87.9%). Quantum-safe encryption. Works with Claude Code, Cursor, Windsurf, Cline, Continue, and any MCP-compatible tool. Switch editors, switch models, switch machines — your knowledge stays. Not just one score on a test — the most complete Ai memory system available.

What's New in v3

Loud Failures on Firewall Blocks (v3.20.0)

When a request to the CogmemAi backend is intercepted by an upstream firewall, CDN, or proxy, the response is HTML, not JSON. Earlier versions tried to JSON-parse it and threw a confusing Unexpected token '<' error, then silently retried the same blocked payload. v3.20.0 detects HTML responses, names the blocking layer when it can (NinjaFirewall, Cloudflare, ModSecurity), and surfaces a clear actionable error. Retryable 4xx responses with HTML bodies no longer trigger retry loops. The class of incident that can silently drop memory writes is now loud.

Autonomous Memory — Your Ai Doesn't Decide Whether to Save Anymore (v3.15)

Every memory system has the same hidden failure mode: the Ai has to choose to save, and under pressure it doesn't. You can bake instructions into system prompts. You can nudge. But when your Ai is head-down on a coding task, it forgets to save — and the decisions you made two hours ago vanish when the context compacts.

CogmemAi v3.15 moves the decision out of the Ai's hands entirely. Your coding sessions are captured at the infrastructure level — decisions, file changes, bug fixes, and deployments land in memory without a single prompt. At session end, an intelligence pass distills them into structured memories: the right types, the right importance scores, the right scopes. Your Ai never sees this happen.

The result: a day of heavy coding produces 15–20 quality memories instead of 3. Future sessions pick up seamlessly. Your Ai stops re-litigating architectural choices you already made. Stop reminding your Ai to remember. It just does.

Proactive Memory Recall (v3.12)

CogmemAi now thinks before it speaks. Before your Ai assistant suggests any action, approach, or recommendation, CogmemAi checks its memory first — automatically, on every topic.

  • preflight tool — A fast, lightweight recall designed to be called before every suggestion. Your assistant checks what it already knows about a topic before opening its mouth. "Let's try approach X" → first checks if X was already tried, rejected, or completed. Sub-200ms, near-zero cost.
  • Prior context surfacing — Every time a memory is saved, CogmemAi automatically searches for related prior memories across all topics — people, companies, technical approaches, features, everything — and surfaces them in the response. Your assistant never suggests something redundant.
  • Smart recall hooks — In Claude Code, CogmemAi reads every user message and automatically injects relevant memories before the assistant responds. No manual recall needed — context arrives before the assistant starts thinking.
  • Upgraded recall engine — Higher-dimensional semantic understanding, balanced reranking, keyword-expanded search, dual-path memory storage for more reliable retrieval, and adaptive search that expands automatically when initial results are low confidence.

The result: your Ai assistant stops suggesting things you've already tried, people you've already contacted, and approaches you've already rejected. Your brain is no longer the safety net for what your tools should already know.

Wisdom Engine — Auto-Extracted Principles (v3.10)

CogmemAi now automatically detects patterns across your memories and extracts factual principles. While skills tell your Ai HOW to behave ("always use Zustand"), principles tell it what's TRUE about your project ("this codebase never validates inputs at service boundaries"). Principles are extracted from clusters of 5+ related memories, scored by confidence, and injected into every session. Use extract_principles to trigger manually or let it happen automatically.

Remote MCP — Zero Install (v3.9)

CogmemAi now supports Streamable HTTP transport — connect from any MCP client without installing anything. No npm, no config files, no Node.js required. Just point your client to https://hifriendbot.com/mcp/ with your API key and start using persistent memory immediately. Same 35 tools, same Intelligence Engine, same benchmark-topping accuracy — zero setup friction.

Quantum-Safe Encryption (v3.7)

CogmemAi is the first quantum-safe Ai memory system. All memories are encrypted at rest with quantum-resistant encryption — both in cloud mode and local mode. Your data is protected against today's threats and tomorrow's quantum computers. Encryption is automatic, zero-config, and enabled by default. No setup required.

Choose Your Storage Mode (v3.6)

CogmemAi now runs three ways — pick the one that fits your workflow:

Cloud (default)LocalHybrid
Best forFull intelligence, team collaboration, cross-device portabilityZero-config start, offline-only environmentsLocal speed + cloud brains, travel/unreliable networks
Setupnpx cogmemai-mcp setup (choose Cloud)npx cogmemai-mcp setup (choose Local)npx cogmemai-mcp setup (choose Hybrid)
API key neededYes (free)Yes (free) — like a license key, your data stays localYes (free)
SearchSemantic (by meaning)Full-text search (FTS5)Semantic with local fallback
Intelligence EngineFull — auto-linking, contradiction detection, memory decay, auto-skills, query synthesisFTS5 search + CRUD — data stays on your machineFull — with offline resilience
Team collaborationYesNoYes
Cross-device syncAutomaticNo — data stays on your machineAutomatic with local cache
Offline supportRequires internetFull offlineFalls back to local when offline
EncryptionQuantum-safe (server)Quantum-safe (local)Quantum-safe (both)

Cloud mode is the recommended experience. It gives you the full Intelligence Engine — semantic search that finds memories by meaning, auto-linking knowledge graph, contradiction detection, self-improving recall, auto-skills, query synthesis, and team collaboration. Everything that makes CogmemAi more than just a database.

Local mode keeps your data on your machine. A free API key is required for registration (like a software license key), but all your data stays local. Full-text search (FTS5) provides quality recall. Works offline after initial setup. When you're ready for semantic search and the full Intelligence Engine, upgrading to cloud takes one command.

Hybrid mode is for developers who travel or work on unreliable networks. Saves to both local and cloud simultaneously. Reads from cloud when available, falls back to local when offline. Unsynced memories automatically push to cloud when connectivity returns.

Intelligence Engine + Auto-Skills (v3.5)

CogmemAi now gets smarter every time you use it. The Intelligence Engine is a self-improving memory system that learns what matters, connects related knowledge automatically, and synthesizes answers from your entire memory. Auto-Skills takes it further — CogmemAi doesn't just remember, it learns how to behave.

Auto-Skills (Closed-Loop Learning)

  • Behavioral skills — CogmemAi automatically synthesizes your corrections, preferences, and patterns into behavioral directives that tell your Ai assistant HOW to work, not just what to know
  • Closed learning loop — correct your assistant once, and CogmemAi detects the pattern. After enough evidence accumulates, it generates a skill that prevents the mistake from ever happening again
  • Confidence tracking — each skill has a confidence score that rises when it works and drops when it doesn't. Low-confidence skills are automatically retired
  • Self-evaluation — skills periodically review themselves against new evidence and adapt, strengthen, or retire as your practices evolve

Intelligence Engine — 95.10% on LongMemEval, 91% on LoCoMo

CogmemAi scores 95.10% accuracy on LongMemEval — the top published score on the field's hardest long-term memory benchmark — and 91% accuracy on LoCoMo with a 100% retrieval hit rate, above human performance (87.9%). Two benchmarks, two #1-tier scores. CogmemAi finds the right memories when you need them.

  • Precision reranking — every recall runs a second-pass reranker that re-scores candidates for precision, balanced with the initial ranking signal to surface the most relevant memory first
  • Self-improving recall — memories that consistently help you rank higher over time; memories you never use fade naturally. Your recall quality improves automatically with every session
  • Auto-linking knowledge graph — related memories are automatically connected when you save them. Your knowledge builds into a web of relationships, not a flat list
  • Contradiction detection — when recalled memories conflict with each other, CogmemAi flags the contradiction so you catch stale or outdated information before it causes problems
  • Context-aware ranking — tell CogmemAi what you're doing (debugging, planning, reviewing) and it boosts the right types of memories. Debugging? Bug reports and patterns surface first. Planning? Architecture decisions lead
  • Query synthesis — ask a question and get one coherent answer synthesized from all your relevant memories, not just a list of matches. Like asking a teammate who's read everything
  • Cross-project intelligence — patterns that appear across 3+ projects are automatically promoted to global scope. Your best practices follow you everywhere without manual effort
  • Proactive insights — at session start, CogmemAi tells you what you should know before you ask. Stale critical memories, duplicate subjects that need merging, patterns ready for promotion

Also in v3

  • Memory health score — 0-100 score with actionable factors
  • Session replay — pick up exactly where you left off with automatic session summaries
  • Self-tuning memory — importance adjusts based on real usage; stale memories auto-archive
  • Auto-ingest README — learn from your README on new projects instantly
  • Smart recall — relevant memories surface automatically as you switch topics
  • Auto-learning — CogmemAi learns from your sessions automatically
  • Task tracking — persistent tasks with status and priority
  • Correction learning — teach your assistant to avoid repeated mistakes
  • Session reminders — nudges that surface at the start of your next session
  • Mandatory rules — define absolute requirements ("NEVER do X", "ALWAYS do Y") that surface in every sessi

View source on GitHub