
Neurodivergent Memory
io.github.jmeyer1980由 GitHub 帳號 jmeyer1980 發布v0.1.8更新於 Oct 25, 2026
Persistent knowledge graph MCP server for neurodivergent thinking. BM25 search, no cloud LLM.
發布方自己的服務:Memory.fit
概覽
本機持久化知識圖譜記憶伺服器,讓助理在五個認知分區中儲存、連結、搜尋與綜合記憶。
- 可以做什麼
- 建立、讀取、更新與刪除記憶節點,支援標籤、情緒效價、強度、認知狀態與專案歸屬,並以雙向連結關聯記憶。使用 BM25 排序搜尋、目標情境與時效加權、圖形走訪、相關記憶混合、分頁清單與彙總統計來檢索與探索記憶。從內嵌項目或快照檔案批次匯入記憶,支援試執行、去重與移轉選項,並檢視儲存路徑與診斷資訊。透過提示詞或鏡像工具準備探索與綜合情境,並將情緒類記憶提煉為結構化邏輯產物。
- 適用情境
- 適合希望助理在本機跨工作階段保留可搜尋筆記的情境,尤其是需要以關聯圖譜而非純文字保存專案層級或多專案知識的用途。
- 執行需求
- 透過 stdio 在本機執行,通常以 npx 搭配 Node.js 24,或使用 Docker 映像。不需帳號、API 金鑰或雲端大型語言模型。選用環境變數可指定快照目錄或檔案、記憶上限與淘汰策略,以及同步工具使用的分層目錄。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Neurodivergent Memory,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
neurodivergent-memory MCP Server
[npm version] [Docker Image Version] [License: MIT] [Node 24 LTS]
Quick-start
Windows
Linux/macOS
Model Flow
Flow notes:
- Memory operations update both graph state and BM25 index.
- Persistence writes to the local snapshot file for restart continuity.
- All MCP responses return through stdio transport.
Features
Five Memory Districts
Memories are organized by cognitive domain:
- logical_analysis — Structured thinking, problem solving, and analytical processes
- emotional_processing — Feelings, emotional responses, and affective states
- practical_execution — Action-oriented thoughts, tasks, and implementation
- vigilant_monitoring — Awareness, safety concerns, and protective thinking
- creative_synthesis — Novel connections, creative insights, and innovative thinking
Resources
- Explore memory districts and individual memories via
memory://URIs - Each memory includes content, tags, emotional metadata, and connection information
- Access memories as JSON resources with full metadata
Tools
store_memory— Create new memory nodes with optional emotional valence and intensityretrieve_memory— Fetch a specific memory by IDupdate_memory— Modify content, tags, district, emotional_valence, intensity, or project attributiondelete_memory— Remove a memory and all its connectionsconnect_memories— Create bidirectional edges between memory nodessearch_memories— BM25-ranked semantic search with optional goal context, recency bias, and filters (district, project_id, tags, epistemic status, emotional valence, intensity, min_score)traverse_from— Graph traversal up to N hops from a starting memoryrelated_to— Find memories by graph proximity + BM25 semantic blend, with optional goal context and epistemic-status filterslist_memories— Paginated listing with optional district/archetype/project_id/epistemic-status filtersmemory_stats— Aggregate statistics (totals, per-district/per-project counts, most-accessed, orphans) with optional project scopeserver_handshake— Return runtime server identity/version details for explicit client-side version confirmationstorage_diagnostics— Show the resolved snapshot path, WAL path, and effective persistence source in one responseimport_memories— Bulk-import from inline JSON entries or a snapshotfile_path, withdry_run, dedupe policies, and explicit snapshot migration flagsprepare_memory_city_context— Tool mirror ofexplore_memory_cityfor clients that support tools but do not invoke MCP promptsprepare_synthesis_context— Tool mirror ofsynthesize_memoriesfor prompt-limited clientsprepare_packetized_synthesis_context— Tool mirror ofsynthesize_memory_packetsfor prompt-limited or attachment-constrained clients
Prompts
explore_memory_city— Guided exploration of districts and memory organizationsynthesize_memories— Create new insights by connecting existing memoriessynthesize_memory_packets— Packetized synthesis prompt for attachment-constrained clients; emits one coverage manifest plus bounded memory slices that summarize the broader graph
Use synthesize_memories when the MCP client can comfortably consume many raw memory resources. Use synthesize_memory_packets when the caller path is attachment-constrained or when you need broader graph coverage in a small number of structured resources.
For maximum interoperability across MCP clients, the server exposes the same synthesis/exploration context in two forms:
- Prompts via
prompts/list+prompts/getfor clients that implement MCP prompt invocation. - Tools via the
prepare_*_contexttools for clients that support MCP tools but ignore or under-support prompts.
Some clients, such as Cline, expose MCP prompts as namespaced slash commands in the form /mcp:<server-name>:<prompt-name> rather than /<prompt-name>.
Core Concepts
Memory Archetypes
Each memory is assigned an archetype tied to its district:
- scholar — logical_analysis
- merchant — practical_execution
- mystic — emotional_processing and creative_synthesis
- guard — vigilant_monitoring
Semantic Ranking
Search uses Okapi BM25 ranking (k1=1.5, b=0.75) without requiring embeddings or cloud calls. Results are normalized to 0–1 score range.
Emotional Metadata
Each memory can optionally carry:
- emotional_valence (-1 to 1) — Emotional charge or affective tone
- intensity (0–1) — Mental energy or importance weight
Epistemic Status
Memories can optionally carry epistemic_status to distinguish tentative planning from validated knowledge.
draft— provisional or planning-orientedvalidated— confirmed and safe to treat as establishedoutdated— superseded but retained for history
When store_memory or import_memories creates a new practical_execution memory without an explicit epistemic_status, the server defaults it to draft if the memory has a task tag. The canonical task tag is kind:task, and the server also accepts the compatibility synonyms type:task and bare task. This keeps planning notes from silently presenting as settled fact.
Project Attribution and Scoped Retrieval
Memories can optionally include a first-class project_id for attribution and scoped retrieval across multi-project graphs.
project_idis optional on writes (store_memory,update_memory,import_memories).update_memoryacceptsproject_id: nullto clear existing project attribution.search_memories,list_memories, andmemory_statsaccept an optionalproject_idfilter.search_memories,list_memories, andrelated_toaccept optionalepistemic_statusesfilters so callers can avoid stale planning memories when appropriate.search_memoriesaccepts optionalcontextandrecency_weightparameters. Context is blended into ranking as a lightweight BM25 boost;recency_weightmust be between0and1and adds a recency boost without replacing semantic relevance.search_memoriesacceptsmin_intensity/max_intensityas the preferred intensity filter names. The legacyintensity_min/intensity_maxaliases remain supported for compatibility.related_toaccepts an optionalcontextparameter to bias related-memory ranking toward the caller's current goal.- Stats now include a
perProjectbreakdown. - Scoped
memory_statsreportstotalConnectionsonly for edges where both endpoints are in scope. list_memoriesincludes aproject: ...segment in each line (unsetwhen no project attribution exists).- Validation contract:
project_idmust match^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$(max length 64). - Invalid values return stable error code
NM_E020with recovery guidance.
Import Diagnostics and Migration Semantics
storage_diagnostics reports the resolved snapshot path, the WAL path, and which configuration source won the persistence-path precedence check.
import_memories supports two source modes:
- Inline
entriesfor ordinary bulk seeding. file_pathfor server snapshot imports, avoiding large MCP payloads.
Import validation flags:
dry_run: truevalidates the request without writing data and returns deterministicwould_import,would_skip, andwould_failcounts.dedupeacceptsnone,content_hash, orcontent_plus_tags.- Deduplicated rows are reported with stable reason codes:
DEDUPE_CONTENT_HASHorDEDUPE_CONTENT_PLUS_TAGS. - Snapshot
file_pathimports accept.jsonfiles under the resolved persistence directory by default. SetNEURODIVERGENT_MEMORY_IMPORT_ALLOW_EXTERNAL_FILE=trueonly when importing external snapshot files intentionally.
Snapshot migration flags:
preserve_idsis only valid withfile_path; any ID collision with the live store is rejected deterministically.merge_connectionsis only valid withfile_path; every referenced connection target must exist either in the imported snapshot or the live store, or the row fails validation withINVALID_CONNECTION_TARGET.- If validation failures are present, the non-dry-run import is rejected as a whole. Run
dry_run: truefirst to inspect the failure list before retrying.
Knowledge Graph Persistence
Memories are persisted with a write-ahead journal (WAL) plus snapshot model:
- Every mutating operation appends to
memories.json.wal.jsonlfirst. - The in-memory graph is then updated and periodically snapshotted to
memories.json. - On startup, the server loads
memories.json, replays WAL entries, compacts to a fresh snapshot, then truncates the WAL.
This improves crash recovery behavior compared to snapshot-only persistence.
For explicit control, set one of these environment variables:
NEURODIVERGENT_MEMORY_DIRto choose the directory that containsmemories.jsonNEURODIVERGENT_MEMORY_FILEto point at a specific snapshot fileNEURODIVERGENT_MEMORY_MAXto cap total memories (integer; default unlimited)NEURODIVERGENT_MEMORY_EVICTIONto choose eviction policy when max is reached:lru(default)access_frequencydistrict_priority
Mounts at /home/node/.neurodivergent-memory continue to work without any env override — that is the container's node user home and is checked automatically.
⚠️ Breaking change (v0.2.0): The image runs as the
nodeuser and cannot read/root, so previous mounts at/root/.neurodivergent-memoryare silently skipped. Agents may appear to have lost all memories. See Recovering memories after upgrade below.
Recovering memories after upgrade
If you previously mounted data at /root/.neurodivergent-memory, your snapshot is still intact on the host volume. Re-mount it using one of these options:
Option A — explicit /data mount (recommended):
Option B — mount at the path the node user already owns:
No NEURODIVERGENT_MEMORY_DIR override is needed for option B — the server finds the existing snapshot automatically.
For agents: if memories appear missing after upgrading the container, use import_memories to reload from a backup export, or ask your AI assistant to re-run memory_stats after the volume is remounted correctly to confirm restoration.
Multi-Tier Memory Persistence
The server supports a three-tier memory architecture for agents that work across multiple projects. Each tier lives in its own directory and can be synced independently.
The primary server still reads its active snapshot from NEURODIVERGENT_MEMORY_DIR (or the auto-discovered
default). Tier variables are used exclusively by the sync-memories helper.
Tagging memories for sync
Add a persistence:durable tag to any memory that should be promoted to the user or org tier. Memories
without this tag are treated as ephemeral and stay in the project tier.
Use persistence:ephemeral as an explicit opt-out for memories you never want promoted.
Syncing memories between tiers
After a build, milestone, or session — promote durable memories from the project tier to the user tier:
Or use explicit paths:
Full option reference:
Safety note: stop the MCP server for the target tier before running sync — the script writes directly to the snapshot file and will warn if it detects an open WAL for the target directory.
Release Security
- GitHub Actions runs on Node.js 24 LTS for CI and release automation
- npm publishes use OIDC provenance with
npm publish --provenance --access public - Docker images are built with Buildx, published to Docker Hub, and emitted with SBOM and provenance metadata
- GitHub Actions generates artifact attestations for the npm tarball and the pushed container image digest
- Tagged releases upload the npm tarball, checksums, and attestation bundles as release assets
Development RC Channel
Pushes to the development branch publish release candidates using the same npm package name (neurodivergent-memory) and container repositories.
- npm prereleases are published as
0.x.x-rc.Nwith npm dist-tagrc. - npm prerelease suffix
Nusesrun_number.run_attemptto avoid collisions on workflow re-runs. - Docker images are published with immutable
rc-0.x.x-rc.Ntags only, whereNis derived fromrun_number.run_attempt. - GitHub releases for RC builds are marked as pre-release.
These builds are intentionally less stable than the research preview line and should be used only for validation and early integration testing.
Live Readiness Smoke (project_id)
Use the deterministic live smoke harness to validate project_id attribution/scoped retrieval end-to-end:
- Local build target:
- Latest Docker RC target (PowerShell):
The smoke harness exits non-zero on failed assertions and is suitable as a release-readiness gate.
Error Contract
Mutating and lookup tool failures are returned with a stable operator-facing shape embedded in the text response:
The leading summary line is contextual, while the Code/Message/Recovery block remains stable for operators to parse and search. This keeps MCP responses readable in chat clients while giving operators a stable code they can search in logs and release notes. Structured logs are written with Pino to stderr and include the same code field on known failure paths.
Concurrency Safety
Mutating tools are serialized through an async mutex to prevent concurrent write races when multiple agents call the server at the same time.
Write queue behavior:
- Pending write operations are bounded by
NEURODIVERGENT_MEMORY_QUEUE_DEPTH(default:50). - When the queue is full, mutating tools return
NM_E010with a retry-oriented recovery message. - Queue high-water/clear transitions are logged with structured Pino warnings.
WIP guardrail behavior:
store_memorychecks practical in-progress task saturation peragent_idwhen task tags include in-progress markers.- The cap is controlled by
NEURODIVERGENT_MEMORY_WIP_LIMIT(default:1; set0to disable). - Exceeding the cap emits a warning line in the tool response and logs
NM_E011for operator visibility.
Loop Telemetry And Guardrails
The server tracks loop signals and can surface targeted guardrail responses:
- Repetition detection on
store_memorycompares incoming content against the 10 most recent memories (sameagent_idwhen provided) using tokenizer-consistent token-overlap scoring with an exact-match fast path. - Stores that meet the repeat threshold set
repeat_detected: true, incrementrepeat_write_counton the matched memory, and add aNo net-new infowarning to the tool response. - Repeated
logical_analysisreads ofemotional_processingmemories add adistill_memorysuggestion once the configured threshold is crossed. - Read/write ping-pong transitions are tracked in a rolling operation window, increment
ping_pong_counterwhen threshold conditions are met, and can optionally start a temporary cross-district write cooldown. memory_statsnow includes aloop_telemetryblock with:repeat_write_candidates(top 5)ping_pong_candidates(top 5)recent_high_similarity_writes(last 5)
Configuration:
NEURODIVERGENT_MEMORY_REPEAT_THRESHOLD(default:0.85)NEURODIVERGENT_MEMORY_LOOP_WINDOW(default:20)NEURODIVERGENT_MEMORY_PING_PONG_THRESHOLD(default:3)NEURODIVERGENT_MEMORY_DISTILL_SUGGEST_THRESHOLD(default:3)NEURODIVERGENT_MEMORY_CROSS_DISTRICT_COOLDOWN_MS(default:0, disabled)
Performance Benchmark Baseline
Issue #19 adds a deterministic benchmark harness for end-to-end MCP stdio measurements against the built server.
Run it with:
The benchmark:
- Uses an isolated temp persistence directory so it does not mutate your local memory graph.
- Seeds each dataset tier, then measures
store_memorythroughput across 100 writes at the target tier. - Measures
search_memoriesandlist_memorieslatency over 100 iterations at 1k, 5k, and 10k memories. - Measures
traverse_fromlatency at depths 2, 3, and 5 on a connected graph of 500 memories. - Prints the structured JSON report to stdout for automation-friendly capture.
- Writes run-specific outputs to timestamped files under
benchmark-results/. - Also writes rolling latest aliases:
benchmark-results/memory-benchmark-latest.jsonbenchmark-results/memory-benchmark-latest.md
There is also a convenience alias:
The committed baseline is intended as a relative regression reference for RC vs stable comparisons, not as a universal absolute performance guarantee across machines.
To intentionally refresh the committed baseline files in place:
Development
Install dependencies:
Build the server:
For development with auto-rebuild:
Installation
To use with Claude Desktop, add the server config:
On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
For npm:
For Docker:
Fully auto-approved tools:
If you want to use the mcp server in Github Copilot Agent Workflows (github spins up a new VM every time, so cross-workflow memory is non-existent. Session memory is working, but is wiped upon job completion.):
If you want per-project isolation instead of a shared global memory file, mount a project-specific host directory and keep the same container-side target. Use the path separator for your OS:
- Windows:
${workspaceFolder}\.neurodivergent-memory:/data - macOS / Linux:
${workspaceFolder}/.neurodivergent-memory:/data
Note: Replace
/with\on Windows:${workspaceFolder}\.neurodivergent-memory:/data
Docker Runtime
Use an explicit version tag. The published Docker images intentionally do not maintain a floating latest tag.
You can also run the packaged server image directly:
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
The Inspector will provide a URL to access debugging tools in your browser.
Agent Workflow Setup
This repository ships a reusable agent customization kit whose authoring source lives at .github/agent-kit/.
Use the packaged installer to materialize those templates into a consumer repository's .github/... folders instead of tracking a live generated agent file in this repo.
Contents
Install the kit into a project
Install the current packaged kit into the repo you are standing in:
Useful options:
--target <path>installs into a different repository root.--dry-runshows what would be copied without writing files.--forceoverwrites existing destination files.--mode prompt-first|auto-setuprecords the intended install policy in command output while leaving template wording unchanged.
The installer copies templates into standard customization locations such as .github/agents/, .github/instructions/, .github/prompts/, and .github/copilot-instructions.md.
Authoring source and generated files
The source of truth remains under .github/agent-kit/templates/. The installed live agent file .github/agents/neurodivergent-agent.agent.md is intentionally treated as generated consumer state rather than a tracked repo artifact, so remote Copilot updates cannot keep wiping it out in this repository.
Manual copy fallback
Copy the files you need into your project's standard customization locations — do not move them, so the originals remain available as a reference for future agents or contributors.
The right target directories vary by agent platform. Use whatever location your agent natively reads from. Common examples:
.github/agents/for agent definitions.github/instructions/for shared instructions.github/prompts/for prompts.github/root forcopilot-instructions.md
Install policy handshake
Before installing neurodivergent-memory MCP in any project, ask the user which policy to apply:
prompt-first(default) — Ask for explicit approval before installing.auto-setup— Install automatically without prompting.
Update the imported agent file's installation section to reflect the chosen policy. If no preference is stated, default to prompt-first.
Appendix
Here is an example copilot-instructions.md
Example tag set for a durable cross-project memory:
Districts
Available MCP Tools (quick reference)
Persistence
Memories are automatically saved to ~/.neurodivergent-memory/memories.json on every write.
The graph is restored on server startup — no data is lost between restarts.
Memory Quality Guardrails
- Do not stop at "what happened". Important memories should capture why the action was taken, what tradeoff or principle drove it, and whether the insight is reusable.
- Treat
practical_executionas the action log, then pair it withlogical_analysisorcreative_synthesiswhen the deeper rationale should survive longer than the implementation details. - When a debug trail, handoff, or emotional/raw memory is noisy, use
distill_memoryor an explicit follow-up memory to preserve the signal while stripping incidental detail. - Prefer connective synthesis over isolated task logs: link implementation memories back to durable principles such as explicit state over implicit state, bounded growth, or environment-aware validation.
Bootstrap checklist for new agent sessions
- Call
memory_statsto see how many memories exist. - Use
search_memorieswith a broad query to locate relevant prior context. - Check whether recent memories already explain the rationale or durable principle behind the task, not just the last execution step.
- Apply the canonical tag schema when calling
store_memory. - Connect new memories to related existing ones with
connect_memories. - Use
traverse_fromorrelated_tofor associative retrieval rather than repeated searches. - No Quick Task exemption: any file edit, decision, or finding in this repo is memory-worthy — write the memory before moving on. If you catch yourself thinking "this is too small" — that is the trigger, not a bypass.
- No execution-only memory exemption: if a memory says what changed, it should also say why it changed or link to a memory that does.
來源:README.md,提交 229a2e0
工具
0版本歷史
1- v0.1.8最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Memory 整合

Memory.fit
fit.memory官方發布者
託管式 Memory.fit 伺服器,讓 AI 讀取你的訓練、睡眠、恢復與飲食資料,並寫回每週計畫、每日目標和飲食計畫。
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pg官方發布者
pg.ddx.io: the PostgreSQL community's memory 的託管 MCP 服務,由 pg.ddx.io 發布;無需登入;Streamable HTTP;29 個工具。
var.gg Naming Memory
gg.var官方發布者
遠端 MCP 伺服器,可依領域概念推薦並檢索韓、日、中、越、英多語言的程式識別字名稱,並提供 ERD 結構查詢。

Counterparts
ai.counterparts
為 Claude Code 與 Claude Desktop 提供的本地優先長期記憶:助理自行寫下關於你與專案的筆記,並在之後的對話中回想起來。

LAHZE - Persian AI Memory Platform
由 GitHub 帳號 pedramgholizadeh 發布
以波斯語為先的地理記憶平臺:發現地點,起草併發布僅限波斯語的記憶。AI 翻譯