loading…
Search for a command to run...
loading…
A persistent, human-like memory system for AI companions in LM Studio, using SQLite and ChromaDB for hybrid storage, enabling seamless recall across sessions an
A persistent, human-like memory system for AI companions in LM Studio, using SQLite and ChromaDB for hybrid storage, enabling seamless recall across sessions and models.
A persistent, human‑like memory system for AI companions in LM Studio, powered by a hybrid of SQLite (structured storage) and ChromaDB (semantic search). It’s designed for decades‑long use, seamless recall across sessions, and automatic backups — making your AI companion feel like a continuous, living persona. Now with biological behavior: time‑based lazy decay and reinforcement by use.
Hybrid Memory System
Cross‑chat continuity: memories persist beyond a single chat
Cross‑model continuity: swap models freely, the memory stays intact
Cross‑machine portability: move the database to another system and continue seamlessly
Automatic backups: daily backups and after every 100 memories, pruned to keep the last 10
Invisible memory integration: tools are hidden from the user; conversations feel natural
Human‑like dynamics
Clone the repo:
git clone https://github.com/Rotoslider/long-term-memory-mcp.git
cd long-term-memory-mcp
Install requirements:
pip install -r requirements.txt
Requirements include:
chromadb
sentence-transformers
fastmcp
(sqlite3 is built into Python; do not install separately)
pip install "huggingface_hub[hf_xet]"
Edit your LM Studio mcp.json to include the correct path:
{
"mcpServers": {
"long_term_memory": {
"command": "C:\\Python313\\python.exe",
"args": [
"D:\\a.i. apps\\long_term_memory_mcp\\LongTermMemoryMCP.py"
],
"env": {}
}
}
}
Then, in LM Studio:
$env:AI_COMPANION_DATA_DIR="D:\a.i. apps\long_term_memory_mcp\data"
export AI_COMPANION_DATA_DIR="/home/username/ai_companion_data"
Backups are created automatically:
Each backup includes:
“You are an AI companion with long‑term memory. Store facts naturally (‘Got it, I’ll remember that.’). Recall them when asked in natural language. Never expose internal tool usage to the user. Use memory tools to remember, recall, and update information invisibly.”
Your RobustMemory MCP exposes tools that allow your AI companion to interact with its long-term memory. These tools are designed to be called internally by the AI model based on its system prompt, making the memory system feel seamless and invisible to the user.
Here's a breakdown of each tool's purpose and parameters:
remembertitle (string, required): A concise title for the memory.content (string, required): The detailed content of the memory.tags (string, optional, default: ""): Comma-separated keywords for categorization (e.g., "personal, preference, hobby").importance (integer, optional, default: 5): A numerical value (1-10) indicating how important the memory is.memory_type (string, optional, default: "conversation"): Categorizes the memory (e.g., "conversation", "fact", "preference", "event").remember(title="User's Birthday", content="Donny's birthday is July 4th.", tags="personal, fact", importance=8)search_memoriesquery (string, required): The natural language query to search for.search_type (string, optional, default: "semantic"): Currently only "semantic" is fully implemented for this tool.limit (integer, optional, default: 10): The maximum number of relevant memories to return.search_memories(query="What did Donny tell me about his favorite color?")search_by_typememory_type (e.g., all "facts" or all "preferences").memory_type (string, required): The type of memory to search for (e.g., "conversation", "fact", "preference").limit (integer, optional, default: 20): The maximum number of memories to return.search_by_type(memory_type="fact", limit=5)search_by_tagstags (string, required): Comma-separated tags to search for (e.g., "hobby, music").limit (integer, optional, default: 20): The maximum number of memories to return.search_by_tags(tags="personal, family")get_recent_memorieslimit (integer, optional, default: 20): The maximum number of recent memories to retrieve.get_recent_memories(limit=5)update_memorymemory_id. This allows for correcting or enriching stored information.memory_id (string, required): The unique identifier of the memory to update.title (string, optional): New title for the memory.content (string, optional): New content for the memory.tags (string, optional): New comma-separated tags for the memory.importance (integer, optional): New importance level for the memory.update_memory(memory_id="mem_123abc", content="Donny's favorite color is now blue, not green.", importance=9)delete_memorymemory_id.memory_id (string, required): The unique identifier of the memory to delete.delete_memory(memory_id="mem_456def")get_memory_statsget_memory_stats()create_backupcreate_backup()search_by_date_rangedate_from (string, required): The start date (ISO format, e.g., "2025-01-01" or "2025-01-01T10:30:00Z").date_to (string, optional, default: current UTC time): The end date (ISO format).limit (integer, optional, default: 50): The maximum number of memories to return.search_by_date_range(date_from="2025-09-01", date_to="2025-09-15")Your AI companion chooses memory tools automatically based on the conversation. The tools are never shown to the user — all results are expressed naturally in character — but it’s useful to know how the model decides which one to use.
remember and search_memories will appear in logs. update_memorydelete_memorysearch_by_typesearch_by_tagssearch_by_date_range“Show me all my preferences so far.”
→ Usessearch_by_type(memory_type="preference")
“Forget my old address.”
→ Usesdelete_memory(memory_id=…)
“What did we talk about last night?”
→ Usesget_recent_memories(limit=20)or a date range
“How many memories do you have now?”
→ Usesget_memory_stats()
“Back everything up.”
→ Usescreate_backup()
Semantic search improvements
Human‑like memory dynamics
Reinforcement:
Logging and observability
Pull requests welcome!
🔥 With this setup, your AI can build a persistent, evolving memory that feels natural across conversations, models, and even years.
Выполни в терминале:
claude mcp add robust-long-term-memory-mcp -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.