Skip to main content
Glama
SimoneB79
by SimoneB79

๐Ÿง  Memory Engine

A living memory system for AI assistants โ€” built on SQLite + MCP (Model Context Protocol).

Not just a key-value store. Not just a knowledge graph. A living memory that decays, learns, and evolves with your AI.

โœจ Features

  • _atomic memory model โ€” knowledge stored as atoms (facts, decisions, events, preferences, logs, procedures, notes)

  • multi-factor ranking โ€” recall combines FTS relevance ร— confidence ร— recency ร— weight (not just BM25)

  • organic decay โ€” atoms lose weight over time if not accessed; critical ones get flagged for review

  • learning engine โ€” generates questions for the human when it detects contradictions, gaps, weak atoms, or merge candidates

  • auto-bonding โ€” creates relationship links between atoms automatically during import

  • graph traversal โ€” navigate the knowledge graph with depth control and relation filtering

  • markdown import โ€” one-way sync from your existing markdown notes (coexistence, not replacement)

  • merge & deduplicate โ€” consolidate similar atoms intelligently

  • TTL support โ€” atoms that expire automatically

  • versioning โ€” automatic atom history tracking

Related MCP server: sostenuto

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           Your AI Assistant              โ”‚
โ”‚         (via MCP Protocol)              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         MCP Server (FastMCP)            โ”‚
โ”‚     15 tools (recall, remember, ...)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚            Engine Layer                  โ”‚
โ”‚  ranking ยท decay ยท learning ยท merge     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚          SQLite (FTS5 + JSON1)          โ”‚
โ”‚     atoms ยท bonds ยท versions ยท Q&A      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Files

File

Purpose

Lines

server.py

MCP server โ€” exposes 15 tools via FastMCP

~330

db.py

SQLite layer โ€” CRUD, FTS, bonds, versions

~460

engine.py

Ranking, decay, similarity, gap detection

~230

learning.py

Question generation (5 trigger types)

~210

importer.py

Markdown โ†’ SQLite one-way importer

~185

schema.sql

Database schema (atoms, bonds, FTS, versions)

~120

Total: ~1,600 lines of Python. No external dependencies beyond mcp SDK.

๐Ÿ”ง MCP Tools

Tool

Description

remember

Create or update an atom

recall

Smart query (FTS ร— confidence ร— recency ร— weight)

link

Create a typed bond between atoms

unlink

Remove a bond

get_atom

Get full atom details with all bonds

merge_atoms

Merge two atoms (secondary โ†’ primary)

list_atoms

List atoms with filters (domain, type, status)

search_graph

Traverse the knowledge graph from an atom

stats

Memory statistics (counts, domains, types)

decay_run

Execute decay cycle (reduce unused atom weights)

learning_run

Run learning engine (detect gaps, contradictions)

ask_pending

Get pending human questions

answer_human

Answer a pending question

import_markdown

Import markdown files (bulk or single)

export_atom

Export an atom as markdown

๐Ÿš€ Quick Start

# docker-compose.yml
services:
  memory-engine:
    build: .
    restart: unless-stopped
    expose:
      - "8085"
    volumes:
      - memory-data:/data
      - ./your-markdown-notes:/workspace/memory:ro
    environment:
      - MEMORY_DB_PATH=/data/memory.db
      - MARKDOWN_SOURCE=/workspace/memory
      - MEMORY_HOST=0.0.0.0
      - MEMORY_PORT=8085

volumes:
  memory-data:
docker compose up -d

Local (Python โ‰ฅ3.11)

pip install -r requirements.txt
python server.py

Connect to your MCP client

Add to your MCP client config (e.g., Claude Desktop, OpenClaw, etc.):

{
  "memory-engine": {
    "url": "http://localhost:8085/sse",
    "transport": "sse"
  }
}

๐Ÿ“Š Use Cases

  • Personal AI assistant memory โ€” remember preferences, decisions, project context across sessions

  • Team knowledge base โ€” shared memory accessible to AI agents

  • Project documentation โ€” import existing markdown docs, query them naturally

  • Learning journal โ€” track decisions and their rationale over time

โš™๏ธ Configuration

Edit config.json to tune:

Section

What it controls

decay

Interval, decay factor, critical threshold, archive timeout

ranking

Weight of FTS score, confidence, recency, and atom weight

learning

Thresholds for contradiction, merge similarity, gap detection

๐Ÿงฌ How It Differs

Feature

memory-graph

sqlite-memory-mcp

Memory Engine

Storage

SQLite

SQLite

SQLite

FTS search

โŒ

โœ… (BM25)

โœ… (multi-factor)

Decay

โŒ

โŒ

โœ…

Learning/Q&A

โŒ

โŒ

โœ…

Markdown import

โŒ

โŒ

โœ…

Auto-bonding

โŒ

โŒ

โœ…

Graph traversal

Basic

โŒ

โœ… (depth + relation filter)

Merge atoms

โŒ

โŒ

โœ…

TTL

โŒ

โŒ

โœ…

Versioning

โŒ

โŒ

โœ…

๐Ÿ“ License

MIT โ€” see LICENSE.

๐Ÿค Contributing

Contributions welcome! Open an issue or PR.

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

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/SimoneB79/memory-engine-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server