
Engraphy
io.github.devon-clarkk由 GitHub 帳號 devon-clarkk 發布v0.3.0更新於 Oct 25, 2026
Self-hosted MCP memory server: a typed knowledge graph on Postgres 16 and pgvector.
概覽
自架的 MCP 記憶伺服器,在 Postgres 與 pgvector 上為助理提供具型別的知識圖譜,寫入會自動去重,檢索融合語意與關鍵字。
- 可以做什麼
- 寫入記憶時與既有記憶比對,自動合併、建立關聯或暫存為待判定的重複項,並回傳共振報告。在單一或多個範圍內進行語意與關鍵字融合檢索,並從起始節點走訪圖譜。依 id 讀取完整節點與邊摘要,取得由 pack 宣告的 session 起始簡報。列出與建立範圍,並取得說明各範圍管轄內容的 routing manifest。透過 link、update、supersede 與重複項處理來編輯圖譜,檢視待處理寫入、統計與擷取收件匣。管理空間、成員、權杖、授權與可見性。
- 適用情境
- 當助理需要持久、可共享、能承受並行、改寫與重複的記憶,且你願意自行執行一個以 Postgres 為基礎的服務時適用。適合多使用者或多空間情境,此時資料庫層級的隔離比簡單的本機 JSON 檔案更重要。
- 執行需求
- 需要本機自架部署:Docker 與 Compose,或無 Docker 路徑下的 Postgres 16 加 pgvector、Python 3.12 與 dbmate。必要密鑰 ENGRAPHY_DATABASE_URL 是連接含 pgvector 的 Postgres 16 資料庫的 libpq 連線字串,以非超級使用者 engraphy_app 角色存取。用戶端需帶上由維運 CLI 簽發的 Authorization bearer 權杖。選用 ENGRAPHY_BIND_HOST 與 ENGRAPHY_BIND_PORT 設定綁定位址與連接埠。嵌入模型首次啟動時下載並快取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Engraphy,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Engraphy
An MCP server giving AI agents associative memory, modelled on the human mind.
[CI] [Latest release] [License: BSL 1.1] [Python 3.12+] [Postgres 16 + pgvector]
Quickstart · Documentation · Tool reference · Design set · Contributing
The name comes from engraphy, an old term from memory science for the process of laying down an engram, the trace a memory leaves in the brain. Engraphy does that for agents: it checks each new memory against what it already knows before the write lands, merging restatements, linking genuinely new facts, and never silently overwriting. Nothing is deleted, so history stays walkable.
Engraphy is self-hosted. It stores what an agent learns as a typed knowledge graph on Postgres + pgvector: writes deduplicate themselves against existing memory, retrieval fuses semantic and lexical search, isolation between users is enforced by the database, and the whole shape of memory is declared per application as a pack.
It exists to replace the reference MCP memory server's flat-JSON, single-user, stdio model with something that survives concurrency, paraphrase, duplicates, and years of accumulated memory. It speaks the Model Context Protocol, so any MCP client (a VS Code extension, a desktop app, another agent) can use it over HTTP.
Source-available. Licensed under the Business Source License 1.1: read it, run it, build on it, and use it in production for your own product. Offering Engraphy itself as a hosted or managed service to third parties is reserved to the Licensor until the Change Date, when it converts to Apache-2.0. See License.
What it does
- A typed memory graph. Memories are typed nodes (
fact,decision,person,event, …) joined by typed edges (involves,references,supersedes, …). The types, their attribute schemas, and the rules for which edges may connect which types are declared per space in a pack and enforced in Postgres. - Writes that deduplicate themselves. Every write is embedded and banded against existing memory. A near-verbatim restatement auto-merges; a genuinely new but related fact is kept as its own searchable node and joined by an edge (nothing is silently absorbed); a borderline case parks as a pending duplicate-check verdict for the caller to resolve. Every write returns a resonance report of what it touched.
- Hybrid retrieval.
searchfuses a vector leg (cosine over embeddings) and a lexical leg (Postgres full-text) with Reciprocal Rank Fusion, andtraversewalks the edges. Attribute values are folded into the searchable surface, so a fact stored only in a typed attribute is still findable. - Isolation the database enforces. Multiple spaces, and multiple principals
within a space, are separated by Postgres Row-Level Security running under a
non-superuser role, not by application checks that can be forgotten. The server
connects as a
NOBYPASSRLSrole. - Scope routing built for LLMs. Every scope carries a description of what it
governs; the read-only
scope_guidetool returns that routing manifest so an agent can decide where a new memory belongs before it writes. - An operator CLI and an MCP tool surface for everything from bootstrapping a space to minting tokens, importing data, applying packs, and verifying restores.
How it works
A write is embedded, banded by similarity into merge / merge-link / pending /
new, and committed under the caller's identity. A read (search, get,
traverse, briefing) runs under RLS so a caller only ever sees the scopes they
were granted. A pack declares the node types, edge types, attribute schemas,
and session-start briefing for a space, so one engine serves many differently
shaped memory applications. The architecture overview
walks the full write and read paths.
Quickstart
Requirements: Docker (with Compose). The cloud profile brings up Postgres, runs migrations, provisions the app role, and starts the server in one command.
The server is now on 127.0.0.1:8000 (put a TLS-terminating reverse proxy in
front to expose it). Point any MCP client at it with the bearer token. The
setup guide covers the local, no-Docker path as well.
Or let the scripts do it
up.sh and provision.sh (with up.ps1 / provision.ps1 as Windows
equivalents) wrap exactly the sequence above, and add the waiting that a
copy-paste quickstart cannot:
up.sh polls /healthz rather than compose's health status, because on first
boot compose reports starting for as long as the model cache takes to seed,
which looks identical to a crash-loop from the outside. A 200 is the real signal.
Both scripts are safe to re-run: an existing .env is never overwritten, and an
existing space or an already-applied pack is skipped rather than treated as an
error, so a re-run still mints a fresh token.
Everything is parameterised, with defaults that work unchanged:
The token is printed once and never written to disk by the scripts; the server
stores only its SHA-256. If you lose it, re-run provision.sh for a new one.
Using it from a client
Engraphy is an MCP server, so a client connects and calls tools:
See the tool reference for parameters, returns, and
an example per tool. A first-party VS Code extension lives in
vscode-extension/.
Documentation
- docs/: developer documentation, architecture, setup, packs, tool reference, deployment, and an end-to-end tutorial.
- design/: the design set, the data model, retrieval and dedup, auth and tenancy, operations, the pack/ontology system, and the benchmark harness. This is where the engineering reasoning lives.
- skills/: concise guidance an LLM agent can load to use Engraphy well (writing and dedup, retrieval, scopes and visibility, answer discipline).
Requirements
- Postgres 16 with pgvector (the
pgvector/pgvector:pg16image ships both). - Python ≥ 3.12.
- dbmate for migrations (bundled in the
admin container; only needed on
PATHfor the no-Docker path). - The embedding model
nomic-ai/nomic-embed-text-v1.5(384-dim, on ONNX Runtime, downloaded and cached on first boot).
Project status
v0.1.0. The schema and enforcement kernel, engine behaviors (dedup, hybrid
retrieval, graph traversal, briefings), the MCP server with auth and admin, and
the operator CLI are implemented and covered by a live-Postgres test suite plus a
CI job that exercises the shipped deploy artifacts end to end. A benchmark harness
(bench/, design/09) runs the engine against public long-term-memory datasets;
it is a tool for measuring changes, not a source of marketing numbers.
bench/RUN-LOCOMO.md is the walkthrough for running LoCoMo
yourself: it needs an OpenAI-compatible base URL and key, and it pins the dataset,
the arm, the models and the judge.
Contributing
Issues and pull requests are welcome. CONTRIBUTING.md covers
getting a development database up, running the suite, what the three CI jobs
check, and the house style. Security problems go through
a private advisory
rather than a public issue.
License
Engraphy is licensed under the Business Source License 1.1 (see
LICENSE).
- You may read, modify, redistribute, self-host, and use Engraphy in production as the memory layer for your own applications and agents.
- You may not offer Engraphy itself to third parties as a hosted or managed service before the Change Date.
- Change Date: 2026-08-22 + 4 years (2030-08-22), on which the license converts to the Apache License, Version 2.0.
Copyright (c) 2026 Devon Clark.
來源:README.md,提交 dcb9f3b
工具
0版本歷史
1- v0.3.0最新Sep 18, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。