convez.ai
MCP ServerIntegração & APIsAvançado
n1ghter

Cognitive Memory MCP Server

n1ghter/cognitive-memory

Memória local persistente para agentes IA com Obsidian + SQLite

Ver no GitHub
BomPluginScore · de 0 a 100

Servidor MCP de alto desempenho para memória cognitiva persistente de agentes IA, usando SQLite e embeddings locais via Ollama. Funciona integralmente offline com simetria bidirecional: o agente aprende de arquivos Markdown no Obsidian, e humanos podem editar a memória diretamente. Ideal para privacidade total e zero latência.

Instalação

$npx convez-ai n1ghter/cognitive-memory

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
2
Forks
1
Acompanhando
0
Saúde
85%
Último commit
há 1 dia
Versão
v1.5.6
Issues abertas
4
Contribuidores
2

Casos de uso

  • Agentes IA com memória de longo prazo offline
  • Sincronização de conhecimento entre Obsidian e agentes
  • Análise semântica de bases de conhecimento locais
  • Integração de inteligência de código via Git hooks

Veredito

Solução robusta e diferenciada para memória cognitiva de agentes, com foco admirável em privacidade local e edição humana. Requer setup técnico (Ollama + Node.js v24+) e maior curva de aprendizado, mas oferece controle total sobre o conhecimento do agente sem dependências cloud.

README

A tradução para o português deste README ainda está na fila.

Cognitive Memory MCP Server

License NPM Version CI TypeScript Testing PRs Welcome Support me on Ko-fi

A high-performance, local-first Model Context Protocol (MCP) server that provides AI agents with persistent cognitive memory.

Unlike cloud-based memory solutions, Cognitive Memory runs entirely on your local machine using SQLite and local LLM embeddings. This ensures zero latency, zero API costs, and absolute data privacy — making it ideal for enterprise and personal environments.


🌟 Why We Are Unique: Human-Agent Cognitive Symmetry

Most AI memory platforms (like Graphiti, Letta, Cognee) lock the AI's "brain" inside opaque databases (Neo4j, ChromaDB, Pickles). If the AI remembers something incorrectly, it becomes a "black box" that is difficult for a human to debug or edit.

Cognitive Memory pioneers Bi-directional Human-Agent Symmetry: We bridge the gap between an AI's Long-Term Memory and a human's Second Brain. The AI's memory is simply a collection of interconnected Markdown files in an Obsidian vault.

  • Read: You can open Obsidian and visually read what the agent is thinking.
  • Edit: You can delete or modify a markdown file, and the agent's memory instantly updates.
  • Write: You can write your own notes, and the agent natively understands them via Vector+Graph search.

✨ Features

  • Semantic LTM: Stores and retrieves long-term declarative memories using Cosine Similarity vector search.
  • Local Vectors: Uses sqlite-vec and better-sqlite3 for blazing-fast local vector operations.
  • Local Embeddings: Integrates directly with Ollama (qwen3-embedding:8b) to generate 4096-dimensional embeddings locally without hitting external APIs.
  • Hybrid Graph Relations: Connects memories together to form an explicit, interconnected knowledge graph.
  • Obsidian Sync: Bidirectional synchronization with local Markdown vaults (e.g., Obsidian). Manually edit .md memory files, and the changes sync back to SQLite.
  • Code Intelligence: Integrates GitNexus via a Git post-commit hook to asynchronously update the AST knowledge graph for deep codebase intelligence.

🚀 Installation & Setup

Prerequisites

  • Node.js (v24+ recommended)
  • pnpm (v9+)
  • Ollama running locally on port 11434 with the following models pulled:
    ollama pull qwen3-embedding:8b
    ollama pull llama3.2
    

💻 Usage (MCP Client Configuration)

The easiest and recommended way to use this server with an MCP-compatible client (like Claude Desktop, Cursor, or custom AI agents) is via npx. Add the following to your client's MCP configuration JSON:

{
  "mcpServers": {
    "cognitive-memory": {
      "command": "npx",
      "args": [
        "-y",
        "@cemised/cognitive-memory"
      ]
    }
  }
}

Build from Source (For Developers)

If you want to modify the source code or if your environment requires compiling native C++ bindings for SQLite manually:

git clone <repository-url>
cd cognitive-memory
pnpm install
pnpm rebuild  # Crucial for native SQLite C++ bindings
pnpm run build

Then configure your MCP client to point to the local build instead:

{
  "mcpServers": {
    "cognitive-memory": {
      "command": "node",
      "args": [
        "/absolute/path/to/cognitive-memory/dist/index.js"
      ]
    }
  }
}

Exposed AI Tools

Once connected, the server exposes several tools to your AI agent, including:

  • memory_store: Save a new fact or concept into long-term memory.
  • memory_search: Perform a semantic vector search for related memories.
  • memory_delete: Remove obsolete information.
  • memory_relate: Create a graph edge between two existing memories.

🏗️ Architecture

The project adheres to a clean modular architecture:

  • src/db.ts: Manages the SQLite connection, schema, and vector extensions.
  • src/ollama.ts: Lightweight native fetch wrapper for the Ollama API.
  • src/cache.ts: Caches embeddings to avoid recalculating identical strings.
  • src/tools/: Contains the business logic for the MCP endpoints.

🤝 Contributing & Community

We welcome community contributions, from bug fixes to new features!

📄 License

This project is licensed under the Apache 2.0 License. This provides strong patent protection and makes the project safe for enterprise adoption.


Author / Creator:
Eduards Čemis

💖 Support the Project

If you find this project helpful and want to support its continued development, consider buying me a coffee! ☕

ko-fi

Ver o original no GitHub

Bom para

Relacionados