MemoryHub
# MemoryHub
MemoryHub is an experimental local long-term memory service for AI assistants. It uses SQLite and FTS5 and exposes memory tools through a lightweight MCP server over standard input and output. Assistants can retrieve earlier notes, decisions and project context without placing the whole database in every conversation.
**[Instrukcja po polsku](README.pl.md) | [Manual installation](docs/INSTALL.md) | [AI-assisted setup](AGENT_SETUP.md) | [Architecture and limitations](docs/ARCHITECTURE.md)**
This is an experimental release prepared from a system used in daily work. It has not been independently reviewed or installed end-to-end on a separate clean machine. The code and tools currently use Polish descriptions; support for other languages and clients is not guaranteed.
## How it works
- A single SQLite database can be used for one assistant, or a local shared database can be combined with a separate private database for each agent ID.
- `mem_search_index` returns a compact index; `mem_get_details` retrieves selected records. `mem_list` lists metadata for an audit; its offset pagination is not a frozen snapshot.
- `mem_save`, `mem_deprecate` and `mem_purge` change entries. When the same ID exists in both databases, destructive operations without an explicit scope fail rather than selecting one silently.
- FTS5 is supplemented with simple Polish stemming heuristics. It is not a language model, and missing a search result does not prove that a record is absent.
- The default MCP stdio mode uses Python's standard library. FastMCP is an optional separate mode and has not been checked as part of this package.
## Boundaries
The private/shared split is **application-level routing**, not OS-level security. Another process running under the same account may access the files. The viewer reads every database it discovers in the chosen directory and writes an HTML snapshot containing their contents to a temporary file; use it only in an appropriate local environment. The service does not automatically sync databases between machines or set up backups.
P04-style checks are heuristics, not a guarantee against storing credentials, data leakage or malicious instructions. Memory entries are untrusted context. Verify important facts against their sources. SQLite databases using WAL should be kept on a suitable local filesystem; use consistent snapshots for backups rather than treating a live file copy as a backup.
## Quick start
You need Python 3.10 or later with SQLite FTS5 enabled. Download or clone the repository and follow the [step-by-step guide](docs/INSTALL.md), including a synthetic test and setup for your MCP client. Example for two different agent identities on one machine:
```text
python mcp_server.py --memory-dir <local-directory> --agent alpha
python mcp_server.py --memory-dir <local-directory> --agent beta
```
These are separate stdio servers for clients to launch, not commands to run interactively in one terminal. Each uses `shared_memory.db` and `<agent>_memory.db` in that directory. With `--db-path <path>` the server uses a single database. With neither option it uses an ephemeral in-memory database.
To ask an AI agent for help, use the [setup interview](AGENT_SETUP.md). It asks about your clients, storage, backups, existing data and optional instructions before changing configuration.
## Project status
The synthetic tests exercise the engine, MCP stdio, scopes and conflicting IDs. Source and design were developed with reference to the open-source [claude-mem](https://github.com/thedotmack/claude-mem) project; the documented provenance review and preserved upstream notices are described in [NOTICE](NOTICE.md). No external hosting, HACS integration or automatic installation is provided.
The repository is distributed under the MIT license; third-party notices and the Apache-2.0 reference are retained in [NOTICE](NOTICE.md).
TDQS
Scored across 6 tools
Each tool has a distinct role: listing metadata, two-stage progressive search, save, soft-deprecate, and hard purge. The only soft overlap is mem_list vs mem_search_index, both returning lightweight entry indexes, but filters vs. inflection-aware matching distinguish them adequately.
All tools share a consistent mem_ snake_case prefix with verb-style suffixes (mem_save, mem_list, mem_purge, mem_deprecate). Minor deviation: two tools use verb_noun (mem_search_index, mem_get_details) while others are verb-only, but the convention remains readable and predictable.
Six tools is a tight, well-scoped set covering the memory lifecycle plus a deliberate two-phase search design. No tool appears redundant or padded.
Coverage spans create (mem_save), read (mem_list, mem_search_index, mem_get_details), soft-update (mem_deprecate), and delete (mem_purge). The notable gap is an explicit in-place content update/edit, forcing agents to deprecate-and-recreate; otherwise the surface is coherent.