memkin
Memkin is a local-first personal memory graph server providing AI agents with 36 MCP tools to read, write, and explore structured memories derived from chats, meetings, emails, and coding sessions.
🔍 Search & Retrieval
query— Semantic/fuzzy search across all memory using natural languagesearch— Exact keyword search for known identifiers or phrasesget_page_context— Read a specific memory page with tags, links, backlinks, and timelinetimeline_feed— Browse the global timeline with date, source, and keyword filtersexplore_graph— Traverse the knowledge graph to discover dependencies, collaborators, and related entities
🧠 Synthesis & Insights
recall/synthesize— Generate cited, gap-aware summaries or composed answers from memoryprep_for_person— Goal-conditioned communication strategy based on a person's passively inferred profiledaily_report— Cross-channel daily report covering decisions, todos, completed work, pending replies, and reminderstroubleshoot— Step-by-step playbook walkthrough for a given problemget_session_context— Load working memory summary at session start to quickly resume context
✍️ Writing & Memory Updates
put_page— Create or idempotently update a durable memory page with markdown contentadd_timeline_entry— Append a dated event to an existing pagemanage_links— Add/remove directed graph relationships (e.g., mentions, depends_on) between pagesmanage_tags— Add/remove classification tags on memory pages
👤 Person & Entity Management
get_entity_profile/list_signals_by_entity— Retrieve full profiles and all signals for people, projects, or toolslink_person_alias/remove_person_alias/list_person_handles— Manage known aliases and handlesmerge_persons/recanonicalize_person— Merge duplicate person pages or rename canonical slugs
⚙️ System
get_health— Check server status, page/chunk counts, MCP version, and capability flags
Allows bidirectional synchronization between Memkin's memory pages and an Obsidian vault, enabling editing of memory pages in Markdown and importing changes back.
Allows using a local Ollama instance for generating vector embeddings, keeping data fully private without external API calls.
Allows using OpenAI's API for LLM-based signal extraction and vector embeddings for the memory system.
AI Agent 的会话没有跨会话记忆:每次新会话都需要重新解释你是谁、项目背景、既有决策。Memkin 把散落在飞书(私信、群聊、邮件、日历、文档、任务)和 AI 编程会话(Claude Code、Codex、Hermes)里的信息提取为结构化信号——实体、决策、任务、发现、知识、关系——存入你自己机器上的知识图谱,并通过 MCP 提供给任何 Agent 查询和写回。数据全程保留在本机。
核心特性
人物记忆 / Personal CRM:结构化人物档案、生日与联系方式、往来和话题、原始记录与事件双时间线;手动整理优先,AI 建议经确认后应用,纠错保留历史。见人物记忆指南
飞书采集:私信、群聊、邮件、日历、文档、任务、消息搜索共 7 个源,增量采集 + 历史回填。见飞书采集指南
AI 会话采集:Claude Code(
~/.claude/projects/)、Codex(~/.codex/)、Hermes/OpenClaw(~/.openclaw/agents/)MCP 服务器:36 个工具(默认暴露 15 个高意图工具),支持 stdio 与 Streamable HTTP 两种传输。见 MCP 接入指南
信号提取:LLM Pipeline 提取 7 类结构化信号,双层噪声过滤(规则 + LLM 打分),每条信号可溯源到原始消息
混合检索:tsvector 全文(支持中文)+ pgvector 向量,RRF 融合排序
知识图谱:信号锚定到实体(人、项目、工具),有向链接图,跨平台人物身份归并
隐私:写入前脱敏(可逆 / 不可逆双轨),存储零云依赖(PGLite 嵌入式数据库),可选 Ollama 本地嵌入
常驻服务:
memkin up注册开机自启 daemon,定时采集,带运行历史与告警记忆巩固:hot → warm → cold 分层轮转、死链修复、偏好推断
Obsidian 双向同步:导出为 Markdown vault,编辑后导回
Web UI:Dashboard、时间线、力导向知识图谱、搜索
完整清单见功能清单。
Related MCP server: suasor
快速上手
一键安装(推荐,注册为后台常驻服务):
curl -fsSL https://raw.githubusercontent.com/AndreLYL/memkin/main/scripts/install.sh | sh脚本依次执行:安装 Node 运行时(如缺失)→ npm install -g memkin → 打开浏览器 setup 向导(填入 LLM API Key)→ memkin up 注册开机自启后台服务,并把 MCP 配置写入本机已安装的 AI 客户端(Claude Code、Codex、Hermes/OpenClaw)。
临时试用(不安装后台服务):
npx memkin start # 无配置时自动进入 setup 向导,完成后启动服务并打开 Web UI服务管理与卸载:
memkin status # 查看后台服务状态
memkin down # 停止服务并取消开机自启
memkin down && memkin uninstall && npm rm -g memkin # 完全卸载前置条件:Node.js >= 18(安装脚本会自动处理)。
接入 AI Agent
memkin install 把 MCP 配置和记忆使用指令写入本机 AI 客户端,支持 Claude Code、Claude Desktop、Cursor、Codex、Windsurf、Hermes/OpenClaw:
memkin install # 探测已安装的客户端并接入
memkin install --agent claude-code # 指定单个客户端
memkin install --dry-run # 预览将修改的文件
memkin extract --source claude-code # 把历史会话提取为记忆
memkin hooks install # (可选)Claude Code 自动召回 hooks接入后重启客户端即可。传输方式(stdio / Streamable HTTP)、手动配置和 hooks 说明见 MCP 接入指南。
使用场景
以下问题均可在接入 Memkin 的 Agent 中直接提问,回答带 [n] 引用,可溯源到原始消息:
问题 | 使用的工具 |
"明天要见张总谈续约,该注意什么?" |
|
"生成今天的日报" |
|
"智驾为什么无法激活?" |
|
"memkin 项目现在进展如何?" |
|
"上周和这位同事聊了什么?" |
|
界面预览
架构
数据流为 5 层:数据源采集 → 信号提取 → 本地存储 → 接口输出;人物身份、记忆巩固、调度三个模块横切各层。
层 | 内容 |
配置与上手 | TUI 配置中心 / 浏览器向导,自动检测与连接测试 |
采集 | 飞书 7 源 + Claude Code / Codex / Hermes,增量 + 历史回填 |
信号提取 | 分块 → 双层噪声过滤 → LLM 抽取 → 打分 → 隐私脱敏 |
记忆存储 | PGLite + pgvector,混合检索(全文 + 向量 + RRF) |
接口 | CLI、MCP、REST API、Web UI、Obsidian |
运行平台:macOS / Linux / Windows(默认 PGLite,零外部依赖)。可选的自管理本地 Postgres 引擎支持 macOS(arm64 / x64)与 Linux(x64 / arm64)。详见架构详解。
常用命令
命令 | 说明 |
| 启动(无配置时自动进入 setup) |
| 后台服务:注册开机自启 / 停止 / 状态 |
| 接入 AI 客户端 |
| 从数据源提取信号 |
| 搜索记忆 |
| 环境诊断 |
完整命令见 CLI 参考。
文档
路线图
更多数据源:钉钉、企业微信、微信聊天记录、本地文档
提取质量:跨 block 共享上下文、加权准入评分、按实体聚合叙事
自然语言问答
Web UI:记忆编辑(当前只读)、信号溯源审计视图
致谢
Memkin 的设计与实现受益于以下项目:
lark-cli —— 飞书开放平台官方 CLI,Memkin 的飞书 user 态采集构建在它之上
GBrain —— brain-first 检索约定、自布线知识图谱与带引用的合成回答
OpenHuman —— Memory Tree 层级压缩与 Obsidian 互通的设计
mem0 —— Agent 记忆层的先行者
与它们相比,Memkin 侧重:飞书等中国职场工具的采集、本地优先零云依赖、Agent 经 MCP 读写。
贡献
Bug 报告和功能建议请提交 issue。开发流程见 CONTRIBUTING.md。
License
Available Tools
23 toolsadd_timeline_entryAdd Timeline EntryA
add_timeline_entry
Append a dated memory event to an existing page.
When to use: record project progress, decisions, or notable events.
When NOT to use: full page replacement; use put_page.
Returns: ok plus slug/date/summary.
On error: fix invalid date or find the correct page slug.
Inputs: date (required), slug (required), summary (required), detail, +2 more. Returns: ok, date, slug, summary
daily_reportDaily Report (Cross-Channel)A
daily_report
Generate a synthesized cross-channel daily report in 7 fixed sections.
When to use: 'help me write today's daily report' — aggregate the day's signals (mail / IM / calendar / docs) into 今日概览 / 今日完成 / 推进中 / 我的待办 / 待回复与被@ / 人脉动态 / 明日提醒.
When NOT to use: arbitrary recall; use recall/query.
Returns: a SynthesisResult with sections[] + answer + citations + gaps.
On error: ensure the date is a valid ISO date.
Inputs: date.
explore_graphExplore Memory GraphA
explore_graph
Explore graph relationships around a page.
When to use: understand dependencies, mentions, collaborators, and nearby entities.
When NOT to use: raw page content; use get_page_context.
Returns: focus node, graph nodes, and edges with bounded depth.
On error: search for the correct slug first.
Inputs: slug (required), depth, direction. Returns: edges, focus, nodes
get_entity_profileGet Entity ProfileA
get_entity_profile
Full profile for an entity: signals + timeline.
When to use: need a comprehensive view of a person, project, or tool. Returns: entity page with all linked signals and timeline.
Inputs: entity_slug (required).
get_healthGet HealthA
get_health
Return Memkin MCP health and capability metadata.
When to use: diagnose database counts, MCP version, and legacy tool exposure. When NOT to use: retrieve memory content; use read tools. Returns: status, page/chunk counts, MCP version, and legacy setting. On error: inspect server logs.
Inputs: no named parameters. Returns: pages, chunks, status, read_only, +4 more
get_page_contextGet Page ContextA
get_page_context
Read a page plus nearby memory context.
When to use: after finding a slug and needing page, tags, links, backlinks, timeline, or chunks in one call.
When NOT to use: broad recall without a slug; use query or search first.
Returns: page, tags, limited related context, and provenance.
On error: if the slug is missing, search for the correct slug first.
Inputs: slug (required), limit, include. Returns: page, tags, links, chunks, +3 more
get_session_contextGet Session ContextA
get_session_context
Load working memory for session bootstrap.
When to use: at the start of every session to understand what is active and pending. Returns: recent activity summary for the given day window.
Inputs: days.
link_person_aliasLink Person AliasA
link_person_alias
Add an alias handle to a canonical person page.
When to use: link a new identifier (email, feishu_open_id, nickname) to a person. Returns: ok plus current handles.
Inputs: kind (required), value (required), canonical_slug (required), strength.
list_person_handlesList Person HandlesA
list_person_handles
List all handles for a canonical person.
When to use: check known aliases for a person. Returns: array of handles with kind, value, and strength.
Inputs: canonical_slug (required).
list_signals_by_entityList Signals by EntityA
list_signals_by_entity
List all signals anchored to an entity.
When to use: retrieve decisions, tasks, knowledge, etc. for a specific person/project/tool. Returns: signals with type, title, and summary.
Inputs: entity_slug (required), limit, signal_types.
manage_linksManage LinksA
manage_links
Add or remove graph links between pages.
When to use: maintain relationships such as mentions, depends_on, or works_on.
When NOT to use: tagging; use manage_tags.
Returns: ok plus action/from/to.
On error: search for missing page slugs before retrying.
Inputs: to (required), from (required), action (required), type, +2 more. Returns: ok, to, from, action
manage_tagsManage TagsA
manage_tags
Add or remove tags on a page.
When to use: classify memory pages with stable tags.
When NOT to use: graph relationships; use manage_links.
Returns: ok plus action/slug/tags.
On error: search for the page slug or provide at least one tag.
Inputs: slug (required), tags (required), action (required). Returns: ok, slug, tags, action
merge_personsMerge PersonsA
merge_persons
Merge one person into another, moving all handles.
When to use: two person pages represent the same individual. Returns: ok plus merged handles.
Inputs: from (required), into (required).
prep_for_personPrep for Person (Communication Strategy)A
prep_for_person
Prepare goal-conditioned communication strategy for a person from their passively-inferred communication profile.
When to use: before talking to someone — get evidence-cited, ethical suggestions on how to communicate with them, optionally toward a specific goal.
When NOT to use: raw facts about the person; use get_entity_profile/query.
Returns: a SynthesisResult (cited suggestions + gaps). Suggestions only — never manipulation. Profiling is passive and local; the four-color shell is a popular mapping, not a clinical diagnosis.
On error: ensure the person page slug exists.
Inputs: person (required), goal.
put_pagePut PageA
put_page
Create or update a Memkin page idempotently.
When to use: write a durable memory page.
When NOT to use: append a dated event; use add_timeline_entry.
Returns: ok, slug, changed flag, content hash, previous hash, and updated_at.
On error: fix slug or non-empty content.
Inputs: slug (required), content (required). Returns: ok, slug, changed, updated_at, +2 more
querySemantic Memory QueryA
query
Semantic search across Memkin memory.
When to use: fuzzy, conceptual recall across people, projects, decisions, tasks, and prior work.
When NOT to use: exact keyword matching; use search instead. Do not look for source-specific tools; use filters.
Returns: ranked results with slug, title, type, snippet, score, and provenance.
On error: broaden filters or retry with fewer constraints.
Inputs: query (required), to, from, type, +7 more. Returns: results
recallRecall Memory (Synthesized)A
recall
Recall a synthesized, cited summary about an entity, query, or time window.
When to use: a quick composed recall with citations and gap flags.
When NOT to use: raw snippets; use query/search.
Returns: a SynthesisResult (answer + citations + gaps).
On error: provide at least one of entity, query, or time.
Inputs: time, query, entity.
recanonicalize_personRecanonicalize PersonA
recanonicalize_person
Rename a person's canonical slug.
When to use: correct or update a person's canonical page slug. Returns: ok plus updated handles.
Inputs: to (required), from (required).
remove_person_aliasRemove Person AliasA
remove_person_alias
Remove a handle from any person.
When to use: correct a wrong alias assignment. Returns: ok.
Inputs: kind (required), value (required).
searchExact Memory SearchA
search
Keyword search across Memkin memory.
When to use: exact words, identifiers, tokens, page titles, or known phrases.
When NOT to use: fuzzy conceptual recall; use query instead.
Returns: ranked keyword matches with provenance.
On error: simplify the query or relax filters.
Inputs: query (required), to, from, type, +7 more. Returns: results
synthesizeSynthesize MemoryA
synthesize
Synthesize a cited, gap-aware answer from memory using an intent template.
When to use: you want a composed answer (not raw snippets) about an entity, time window, or query.
When NOT to use: raw ranked snippets; use query/search.
Returns: answer with inline [n] citations, citations[], and gaps[] (stale / missing).
On error: ensure the intent is registered and the scope is non-empty.
Inputs: intent (required), scope.
timeline_feedTimeline FeedA
timeline_feed
Read global timeline memories.
When to use: recent activity reviews, date-bounded recall, and source-filtered timeline scans.
When NOT to use: page-specific context; use get_page_context.
Returns: timeline entries with slug, title, type, summary, time, snippet, and provenance.
On error: fix invalid date filters and retry.
Inputs: to, from, type, limit, +7 more. Returns: entries
troubleshootTroubleshoot (Playbook)A
troubleshoot
Walk through a troubleshooting playbook in one shot.
When to use: '怎么排查 X' — pull the matching playbook pages, ordered along their precedes chain, into a step-by-step procedure with branch meanings ('命中 X → 含义/下一步').
When NOT to use: general recall; use recall/query.
Returns: a SynthesisResult with ordered steps + [n] citations + gaps.
On error: rephrase the symptom or save a playbook page first.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools have distinct purposes, but there is some overlap among retrieval tools (query, search, recall, synthesize) which could confuse an agent. However, descriptions clearly differentiate them by use case.
Tool names mix patterns: some use verb_noun (add_timeline_entry, get_page_context), while others are single verbs (query, recall, search, synthesize, troubleshoot). This inconsistency adds cognitive load.
23 tools is reasonable for a memory management system covering pages, persons, graph, timeline, and synthesis. No obvious bloat or sparsity.
Covers core CRUD for pages but lacks delete operations and a dedicated create_person tool. Also missing a list_tags or list_all_pages tool, leaving some gaps in the surface.
Maintenance
Related MCP Connectors
Persistent, portable memory for AI assistants — your private memory graph, from any MCP client.
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
A second brain for your AI agent. Shared memory for your team's AI agents, plus public and private knowledge bases — works with ChatGPT, Claude, Cursor and any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceLocal-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 gradedqualityBmaintenanceA local-first AI secretary that gathers your work context into private memory and enables AI agents to search and summarize it over MCP.18 npmMIT
- FlicenseNot gradedqualityCmaintenanceA local-first, privacy-preserving centralized memory hub for AI agents — MCP-compatible, zero cloud egress.3-
- AlicenseNot gradedqualityDmaintenanceLocal-first memory server that stores notes, contacts, and future data as a unified entity graph, providing hybrid retrieval (vector + keyword) for AI assistants via MCP.4MIT