Memtether

io.github.lanbass869-cellv0.1.0a16更新於 Oct 3, 2026

Cross-client AI memory hub: agents share one SQLite memory.db via file-level pointers.

已驗證STDIO僅桌面DatabasesKnowledge & Memory

概覽

AI 產生的概覽

為助理提供共用的本機 SQLite 記憶庫,讓多個 AI 用戶端讀寫同一份記憶。

功能
MemTether 是一個本機記憶中樞,把記憶保存在單一 SQLite 檔案(memory.db)中,供多個 AI 用戶端共同指向。它支援記住、搜尋、更正與停用記憶,並透過向量檢索、FTS5 全文、字面比對與實體圖的多路召回進行查找。它還提供來源歸屬、雙時間軸 as-of 查詢、以取代而非刪除的方式管理舊記憶、依使用量排序,以及可選的 MEMORY.md 投影用於上下文注入。
適用情境
當你在多個 AI 程式開發用戶端之間切換、希望上下文能延續而不是每次切換就遺失時,適合使用。它也適合希望記憶完全留在本機、而非雲端服務的使用者。
執行需求
以本機程序執行,可從 PyPI 安裝(pip install memtether)或從原始碼安裝,語意搜尋與 REST 服務為可選附加元件。需要 Python 與本機 SQLite 資料庫檔案;可選環境變數 MEM_DB 與 MEM_DEFAULT_SOURCE 用來覆寫資料庫路徑與預設來源歸屬。未宣告需要帳號或 API 金鑰。
安裝前請注意
它會讀寫一個由多個用戶端共用的本機記憶資料庫,因此某個用戶端寫入的記憶對其他用戶端可見。connect 指令會修改用戶端設定檔,README 指出某些深度自訂設定無法安全重寫,建議先預覽變更。語意搜尋依賴可選相依套件,缺少時會退化為關鍵字搜尋。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Memtether,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README


Quick Start

mcp-name: io.github.lanbass869-cell/memtether

bash
# 1. Installpip install memtether
# 2. Initialize (creates a demo memory DB)memtether init
# 3. Connect all detected AI clients (Claude Code, Cursor, Windsurf, etc.)memtether connect --all

Try it:

bash
memtether search "shared memory"memtether remember "my first shared memory"memtether stats

Or on Windows, double-click install.bat for one-click setup.

More install options
bash
# From sourcegit clone https://github.com/MemTether/MemTether.git && cd MemTether && pip install -e .
# With semantic search (local embedding, no cloud)pip install "memtether[vector]"
# With REST API serverpip install "memtether[server]"
# Dockerdocker build -t memtether . && docker run -p 8420:8420 -v ./data:/app/data memtetherdocker-compose up

Try it without installing:

bash
python scripts/make_demo_db.pyMEM_DB=~/.memtether/demo.db python mem.py search "shared memory"

Why MemTether

The problem

You use Claude Code for coding, Cursor for refactoring, and Windsurf for exploration. Each has its own memory. Switch tools and your AI forgets everything.

MemTether's answer is simpler than you'd expect: make them all point to the same file.

How it is different

Common approachProblemMemTether approach
Per-client memorySwitch tools, lose contextFile-level pointer: all clients read/write same memory.db
Cloud-hosted memoryPrivacy + API fees + downtimeLocal-first: SQLite on your machine, zero cloud
Delete old memoriesCannot trace what was knownSupersession: old memories marked, never deleted
Single time axisCannot distinguish when true vs when learnedBi-temporal: dual T/T-prime axes with as-of queries
Equal treatment of memoriesUseful memories get buriedQ-Value: used memories rank higher
Single search pathMisses keyword matches4-path recall: vector + FTS5 + literal + entity graph
No concurrent protectionSimultaneous writes = data lossHubguard: file lock + atomic write

Feature comparison

FeatureMemTethermem0cogneezep
Local-firstYesNo (cloud)YesNo (cloud)
Cross-client sharedYes (23)NoNoNo
Source attributionYesNoNoYes
Bi-temporalYesNoNoYes
Q-Value rankingYesNoNoNo
SupersessionYesNoNoYes
4-factor re-rankingYesNoNoNo
ScaffoldsYesNoNoNo
MCP serverYesYesYesYes
Eval suite includedYesYesNoNo
No API key neededYesNoNoNo
REST APIYesYesYesYes
DockerYesYesYesYes
Full feature list
  • Cross-client shared memory: 23 adapters (Claude Code, Cursor, Windsurf, VS Code, Zed, JetBrains, Cline, Roo Code, Kilo Code, Continue, Cody, Amazon Q, Gemini CLI, Neovim, Claude Desktop, Codex, WorkBuddy CN/Intl, CodeBuddy, ZCode, DSH, OpenClaw, Agents-Neutral)
  • Source attribution: every memory knows which client wrote it
  • Bi-temporal: T (when true) + T-prime (when recorded), as-of queries
  • Supersession: old memories marked superseded, never deleted, full audit trail
  • Q-Value: usage-based ranking (0.3 + 0.7 x q_value multiplier)
  • 4-factor re-ranking: semantic (0.45) + recency (0.25) + frequency (0.05) + importance (0.10), blended 70/30 with RRF
  • Deterministic scaffolds: counting/temporal/comparison/aggregation prepended to top result
  • Consolidation index: 2708 topics + 315 chains + 37 standing instructions as bonus recall
  • FTS5 triggers: SQLite-level full-text sync (INSERT/DELETE/UPDATE triggers)
  • Hubguard: cross-process concurrent write lock + atomic write + format fallback
  • Conflict detection: 89 quantified conflict patterns
  • LLM auto-extraction: extract structured memories from conversation text
  • Projection: auto-generates MEMORY.md (3980 char budget) for context injection
  • Multi-path search: vector + FTS5 BM25 + literal + entity graph PPR, RRF fused
  • Three-layer dedup: supersession-aware, content exact, tag-signature
  • Low-confidence rejection: marks results when keyword empty AND vector < 0.50
  • TTL expiry: expired conclusions downweighted with annotation
  • Self-reference suppression: meta-discussion ranked below answers

Architecture

+---------+   +---------+   +---------+   +---------+|  Claude |   | Cursor  |   |Windsurf |   | VS Code |  ... 23 adapters|  Code   |   |         |   |         |   |         |+----+----+   +----+----+   +----+----+   +----+----+     |              |              |              |     +--------------+------+-------+--------------+                          |                   +------v------+                   |  MemTether  |                   | Memory Hub  |                   |             |                   | SQLite      |  <- one physical memory.db                   | FTS5        |  <- full-text search (triggers)                   | ChromaDB    |  <- vector search (bge-m3)                   | Bi-temporal |  <- T + T-prime dual time axes                   | Q-Value     |  <- usage-based ranking                   | Hubguard    |  <- concurrent write lock                   +-------------+
Tech stack
ComponentTechnologyPurpose
DatabaseSQLite (WAL mode)Single-file, zero-config
Full-textFTS5 trigram + triggersO(1) BM25, SQL-level sync
VectorChromaDB + bge-m3 (1024-dim)Semantic search, local
FusionReciprocal Rank Fusion (K=60)Merge multi-path results
Re-ranking4-factor (sem .45 + rec .25 + freq .05 + imp .10)Z-score + sigmoid
GovernanceSupersession + bi-temporal + conflictNever delete
ConcurrencyHubguard (file lock + atomic write)Cross-process safe
APIFastAPI REST + MCP serverAny language

Connect Your Clients

bash
python -m memtether connect --allpython -m memtether verifypython -m memtether detectpython -m memtether selftest

Supported (23): Claude Code, Cursor, Windsurf, VS Code, Zed, JetBrains, Cline, Roo Code, Kilo Code, Continue, Cody, Amazon Q, Gemini CLI, Neovim, Claude Desktop, Codex, WorkBuddy (CN + Intl), CodeBuddy, ZCode, DSH, OpenClaw, Agents-Neutral


Memory Operations

bash
python -m memtether remember "User prefers dark theme" --source claude-codepython -m memtether search "theme preference"python -m memtether correct <uid> "Updated text"python -m memtether retire <uid> "No longer relevant"python -m memtether statspython -m memtether as-of 2026-09-15 --kind knownpython -m memtether rebuild

Benchmarks

LongMemEval (500 questions, full run, 2026-10-02)

MetricScoreNotes
Strict match (global)62.6%209/334 applicable
LLM judge (global)54.6%263/482
Multi-session strict48.8%Above industry avg 27.9%
Multi-session LLM judge60.0%
E-Hybrid73.3%11/15 (small sample)
Per-type breakdown
TypenStrictLLM Judge
knowledge-update7876.6%64.4%
multi-session13348.8%58.4%
single-session-assistant5640.4%42.9%
single-session-preference30N/A33.3%
single-session-user7086.4%80.0%
temporal-reasoning13360.7%41.4%

Results use our own harness. Not directly comparable with mem0 reported numbers.

Test suite

TestResult
hard_bench62/62
asset_bench23/23
pytest31/31
e2e_verify13/13
refuse_bench26/26
concurrent_stress4/4 PASS

Known Limitations

  1. tether_connect detect may falsely report "not connected" for same-source-different-path configs. Use verify for accurate results.
  2. DSH cordis.patch.yml deep customizations cannot be safely rewritten. Use plan to preview.
  3. memory_hub (production) and memtether (open source) are two copies. Changes need directional sync.
  4. Semantic search requires optional deps (chromadb, onnxruntime). Without them, degrades to keyword search.
  5. Windows-first. macOS/Linux should work but not fully tested.

Relationship to Other Projects

  • mem0: managed memory with cloud API. MemTether is for people who want everything local.
  • cognee: knowledge graph + pipeline. MemTether is lightweight operational memory (SQLite, no Neo4j).
  • letta (MemGPT): agent framework. MemTether works with existing agents you already use.
  • engram: Go + SQLite + FTS5 + MCP. MemTether adds bi-temporal, source attribution, Q-Value, 23 adapters.

You can use MemTether alongside any of these.


License

Apache 2.0 - see LICENSE

Contributing

Issues and PRs welcome. See CONTRIBUTING.md.

Star History

[Star History Chart]


中文文档 | Security | Changelog

來源:README.md,提交 3852976

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.1.0a16最新Oct 3, 2026