layer-memory
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Layer Memory
本地优先、Markdown 原生的 AI 代理分层记忆系统。基于 Midway.js 的 MCP 服务,SQLite 存储,pnpm monorepo。
项目架构
layer-memory/
├── packages/
│ └── core/ # 记忆核心库(框架无关)
│ └── src/store/ # 存储层抽象、SQLite 实现、类型定义
├── apps/
│ ├── mcp-server/ # MCP 服务端(Midway.js 4.0)
│ │ └── src/tools/ # 4 个 MCP Tools
├── docs/ # 文档站(dumi 2.x)
├── skill/ # AI Agent skill 定义
├── .husky/ # Git hooks
├── .changeset/ # 版本管理
├── docker-compose.yml
├── Dockerfile
└── pnpm-workspace.yamlMCP Tools
工具 | 说明 | 参数 |
| 存储一条记忆 | key, value, type(可选), tags(可选) |
| 搜索已存储的记忆 | query, type(可选), tags(可选), limit(可选) |
| 导出所有记忆为 JSON | outputPath |
| 从 JSON 文件导入记忆 | inputPath |
记忆类型: working (工作记忆) / persona (人格画像) / fact (事实知识)
Related MCP server: Cortex
快速开始
前置要求
Node.js >= 20
pnpm 10.x(安装:
corepack enable && corepack prepare pnpm@10.15.0 --activate)
安装
git clone https://github.com/Dante926/layer-memory.git
cd layer-memory
pnpm install本地开发
pnpm dev服务启动在 http://localhost:3000,MCP endpoint 在 /mcp。
构建
pnpm build所有包编译到各自 dist/ 目录。
文档站
pnpm docs:devDocker 部署
启动服务
docker compose up -d服务运行在 http://localhost:3000。
数据持久化
记忆数据存储在 Docker volume layer-memory-data 中,容器重启/更新不会丢失。
重新构建
docker compose build
docker compose up -d连接到 AI Agent
Claude Code
在 ~/.claude/settings.json 中配置 MCP:
{
"mcpServers": {
"layer-memory": {
"type": "url",
"url": "http://localhost:3000/mcp"
}
}
}Codex / Cursor
在项目的 .cursor/mcp.json 中配置:
{
"mcpServers": {
"layer-memory": {
"type": "url",
"url": "http://localhost:3000/mcp"
}
}
}使用示例
存储记忆:
调用 memory_store(
key="架构决策",
value="选择 Midway.js 4.0 MCP + SQLite",
type="fact",
tags="项目:layer-memory"
)搜索记忆:
调用 memory_recall(query="架构决策", limit=5)导出备份:
调用 memory_export(outputPath="backup.json")版本管理
本项目使用 Changeset 管理版本:
pnpm changeset # 创建变更记录
pnpm version # 更新版本号
pnpm publish # 发布开发
提交规范
使用 Conventional Commits:
feat:新功能fix:修复chore:工程化docs:文档
代码格式化
pnpm formatThis server cannot be deployed
Maintenance
Related MCP Connectors
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceLocal-first, file-based memory layer for AI agents — one shared Markdown vault across Claude, Codex, Gemini, Cursor and any MCP client. Provides read/write memory tools with an audit trail, per-agent trust levels, and Git sync; no cloud and no lock-in.2MIT
- AlicenseNot gradedqualityDmaintenanceLocal-first AI memory layer with hybrid retrieval and brain-inspired namespaces. Enables agents to save, search, and manage memories directly via MCP tools.7 npmMIT
- AlicenseNot gradedqualityBmaintenancePersonal local AI memory/document MCP that manages short and long-term memories and Markdown documents, with tools for import, search, and retrieval.MIT
- AlicenseBqualityDmaintenanceLocal-first memory server for AI coding agents that stores work sessions, tasks, and durable memories in Markdown files, exposed through MCP tools for session management and memory retrieval.104 npm1MIT