llm-memory-tool
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., "@llm-memory-toolRemember that the database is PostgreSQL and the ORM is SQLAlchemy."
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.
LLM Memory Tool
Mémoire persistante, hybride et locale pour agents LLM — serveur MCP + API REST + SDK Python.
LLM Memory Tool stocke les connaissances, décisions et conventions d'un projet, puis fournit le contexte pertinent à injecter dans les prompts, sans jamais dépasser un budget de tokens. Recherche hybride vectorielle + BM25 avec fusion RRF, graphe de connaissances, moteur de politiques (décroissance, rétention, renforcement) et serveur MCP pour une intégration directe dans les assistants (VS Code, opencode, Claude…).
Fonctionnalités
Recherche hybride : similarité cosinus (vecteurs) + full-text BM25 + fusion RRF
4 types de mémoire :
semantic,episodic,procedural,profileInjection pilotée par budget : jamais au-delà du plafond de tokens configuré
Moteur de politiques : décroissance de confiance, renforcement, rétention/élagage
Graphe de connaissances : entités, relations typées, parcours, plus court chemin, clustering (KMeans/DBSCAN) et extraction d'entités par NLP (spaCy)
Génération de skills : transforme un cluster du graphe en fiche
SKILL.mdAPI REST : FastAPI + spec OpenAPI auto-générée sur
/docsSDK Python : un appel
get_context(query, project_id)pour le contexte de promptServeur MCP : 20+ outils exposés (
memory_store,memory_retrieve,graph_*…)Observabilité : métriques Prometheus, logs structurés
Docker : conteneur de production avec service d'embeddings (Ollama) intégré
Related MCP server: CORTEX Memory MCP
Architecture
┌──────────────┐ stdio / MCP ┌──────────────────┐ HTTP :8765 ┌──────────────────┐
│ Assistant │ ◄──────────────► │ Serveur MCP │ ─────────────► │ API REST │
│ (opencode, │ │ mcp_server/ │ (MEMORY_API_URL)│ memory_tool/ │
│ VS Code…) │ │ server.py │ ◄───────────── │ (FastAPI) │
└──────────────┘ └──────────────────┘ HTTP :8765 └────────┬─────────┘
│
┌───────┴────────┐
│ SQLite │
│ /data/memory.db│
└────────────────┘
┌──────────────────┐ HTTP :11434
│ Ollama │ ◄────── embeddings (nomic-embed-text)
│ (conteneur) │
└──────────────────┘API (
memory_tool/) : FastAPI, port8765, endpoints sous/api/v1Serveur MCP (
mcp_server/) : transport stdio, s'appuie sur l'API viaMEMORY_API_URLUI : accessible sur
http://localhost:8766(optionnelle, voir docker-compose)
Prérequis
Outil | Version minimum |
Python | 3.11+ (3.13 testé) |
Docker | 24+ (recommandé, avec plugin compose) |
pip | 23+ |
Installation
Option A — Docker (recommandé)
cd memory_tool/
cp .env.example .env # définir MEMORY_API_KEY
docker compose up -d --build # démarre API :8765 + embeddings Ollama
curl http://localhost:8765/api/v1/healthLe service embeddings télécharge nomic-embed-text au premier démarrage.
Option B — Local (pip)
cd memory_tool/
python -m venv .venv
source .venv/bin/activate # Windows : .venv\Scripts\activate
pip install -e ".[dev]"
# Pour le NLP (spaCy) : python -m spacy download en_core_web_sm
MEMORY_API_KEY=changeme MEMORY_EMBED_MODEL=mock uvicorn memory_tool.app:app --port 8765Configuration du serveur MCP
Ajoutez ce bloc à votre opencode.json (ou équivalent pour VS Code / Claude) :
{
"mcp": {
"llm-memory-tool": {
"type": "local",
"command": ["python", "-m", "mcp_server.server"],
"environment": {
"MEMORY_API_URL": "http://localhost:8765/api/v1",
"MEMORY_API_KEY": "changeme",
"MEMORY_DEFAULT_PROJECT": "default"
},
"enabled": true
}
}
}Le serveur MCP parle à l'API sur MEMORY_API_URL (défaut : http://localhost:8765/api/v1).
Outils MCP exposés
Outil | Rôle |
| Vérifie que l'API est joignable |
| Stocke une mémoire (type, tags, importance) |
| Récupère le contexte prêt à injecter (budget tokens) |
| Recherche augmentée par le graphe de connaissances |
| Parcours et lecture des mémoires |
| Mise à jour / suppression (soft ou hard) |
| Applique décroissance/rétention (dry-run par défaut) |
| Entités du graphe |
| Relations typées entre nœuds |
| Exploration du graphe (BFS, plus court chemin) |
| Clustering KMeans/DBSCAN des entités |
| Extraction d'entités par NLP (spaCy) |
| Génération de fiches |
Utilisation rapide
API REST
# Stocker une mémoire
curl -X POST http://localhost:8765/api/v1/memories \
-H "X-API-Key: changeme" \
-H "Content-Type: application/json" \
-d '{"project_id": "my-project",
"content": "On utilise FastAPI pour tous les endpoints REST, pydantic v2 pour la validation.",
"memory_type": "procedural",
"tags": ["architecture", "fastapi"]}'
# Récupérer le contexte
curl -X POST http://localhost:8765/api/v1/retrieve \
-H "X-API-Key: changeme" \
-H "Content-Type: application/json" \
-d '{"query": "quel framework pour les APIs ?", "project_id": "my-project", "token_budget": 600}'SDK Python
from memory_tool.sdk import MemoryClient, get_context
client = MemoryClient(api_key="changeme")
client.create_memory(
project_id="my-project",
content="Convention : snake_case pour toutes les fonctions Python.",
tags=["conventions"],
)
context = get_context("conventions de nommage", project_id="my-project")
prompt = f"Contexte :\n{context}\n\nUtilisateur : {user_message}"Outils MCP (exemple de workflow)
memory_retrieved'abord — injectez le contexte pertinent dans votre prompt ;après une interaction utile,
memory_storepour persister la nouvelle connaissance ;memory_consolidatepériodiquement pour appliquer les politiques.
Configuration (variables d'environnement)
Toutes les réglages passent par des variables préfixées MEMORY_ (fichier .env supporté) :
Variable | Défaut | Description |
|
| Chemin SQLite |
|
| À changer en production |
|
|
|
|
| URL Ollama / LM Studio |
|
| Modèle d'embedding |
|
| k par défaut de la recherche |
|
| Plafond de tokens injectés |
|
| Jours avant décroissance de confiance |
|
| Rétention par défaut |
|
| URL de l'API (côté MCP/SDK) |
|
| Projet par défaut (MCP) |
Tests
cd memory_tool/
pytest tests/ -q # 38 tests (SQLite en mémoire, aucun service externe requis)
# Avec couverture
pytest --cov=memory_tool --cov-report=term-missing
# Lint
ruff check memory_tool/Les tests utilisent une base SQLite en mémoire : aucune API Docker n'est nécessaire.
Structure du projet
memory_tool/
├── mcp_server/ # Serveur MCP (stdio) : server.py, client.py
├── memory_tool/ # API FastAPI
│ ├── app.py # Point d'entrée FastAPI
│ ├── auth.py # Authentification par clé API
│ ├── config.py # Paramètres (pydantic-settings, env MEMORY_*)
│ ├── dependencies.py # Injection de dépendances
│ ├── sdk.py # Client SDK Python
│ ├── adapters/ # Embeddings (Ollama/mock), graphe
│ ├── db/ # Schéma SQLite + migrations + repository
│ ├── domain/ # Modèles métier purs + exceptions
│ ├── routers/ # Endpoints REST (memories, retrieve, admin, graph, infra)
│ └── services/ # mémoire, recherche hybride, politiques, NLP, clustering, skills
├── scripts/ # Synchronisation de l'index des skills, évaluation Recall@K
├── tests/ # Suite pytest
├── docs/ # Documentation (skill-index)
├── Dockerfile
├── docker-compose.yml # API :8765 + embeddings Ollama + UI :8766
├── pyproject.toml
└── requirements.txtLicence
MIT © 2026 Jean-Luc KOUMAGLO (menoxz)
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
- Flicense-qualityBmaintenanceMCP server that gives AI agents and teams persistent, shared memory using a knowledge graph with vector embeddings, automatic consolidation of related facts, and hybrid search.Last updated3
- Flicense-qualityBmaintenancePersistent semantic memory MCP server for AI agents with hybrid search, LLM scoring, and decay engine, fully local.Last updated2
- Alicense-qualityAmaintenanceMCP server providing persistent AI memory with four-tier retrieval (SQLite FTS5, graph, vector, LLM agent) to give AI assistants structured, long-term memory without RAG.Last updated1Apache 2.0
- Alicense-qualityCmaintenanceA persistent, searchable memory layer for AI assistants, exposed as an MCP server. It supports CRUD, namespaces, hybrid ranked search, relationships, chat-context assembly, import/export, and optional LLM-powered auto-extraction.Last updated13MIT
Related MCP Connectors
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Local-first RAG engine with MCP server for AI agent integration.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
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/menoxz/llm-memory-tool'
If you have feedback or need assistance with the MCP directory API, please join our Discord server