People Relationship Map
A lightweight personal CRM that tracks people as nodes and their connections
as edges. Everything is stored as Obsidian-compatible Markdown files (one per
person) with a JSON graph index for fast querying.
Workspace layout
CODEBLOCK0
Each person file uses this template:
CODEBLOCK1
The _graph.json file stores the machine-readable graph:
CODEBLOCK2
Commands
All commands go through the Python script. Run them via:
CODEBLOCK3
Add a person
CODEBLOCK4
Tiers: close, regular, acquaintance (default: acquaintance).
Link two people
CODEBLOCK5
Add a note to a person
CODEBLOCK6
This also bumps lastContact to today.
Touch (update last contact without a note)
CODEBLOCK7
Query commands
CODEBLOCK8
Relationship staleness report
CODEBLOCK9
Returns a ready-to-send digest of people you haven't contacted within
their tier threshold.
Export graph as Mermaid (optional utility)
CODEBLOCK10
Prints a Mermaid graph LR diagram you can paste into any Markdown
renderer.
Auto-capture behavior
When the user mentions a person in conversation and provides relational
context, the agent SHOULD silently run the appropriate command:
- - "I just had coffee with Alex Chen" →
touch --person "Alex Chen" +
note --person "Alex Chen" --text "Had coffee together"
- - "Alex and Jordan work on the same team" → INLINECODE9
- "Remember that Sam's birthday is March 12" → INLINECODE10
Only auto-capture when the intent is clear. If ambiguous, ask the user
before persisting. Keep confirmations brief: "Noted for Alex ✓" style.
Cron — weekly relationship digest
A cron job should run the staleness report weekly and deliver results to
the user's primary channel (WhatsApp/Telegram). Recommended schedule:
every Sunday at 9:00 AM.
CODEBLOCK11
The --format message flag produces a concise, chat-friendly digest.
Tips for the agent
- - Normalize names: "Alex", "Alex Chen", "alex chen" should all resolve
to the same node. The script does fuzzy matching on the stored names.
- - When the user says "who do I know at [Company]?", use
query --org. - When the user says "tell me about [Person]", use
show --person. - When the user says "who is connected to [Person]?", use
connections. - Before a meeting, offer to pull up the person's card with
show. - The Markdown files are designed for Obsidian — wikilinks, tags, and
frontmatter all work natively if the user syncs the people/ folder.
人际关系图谱
一个轻量级个人CRM系统,将人视为节点,将人际关系视为边。所有数据以Obsidian兼容的Markdown文件(每人一个文件)存储,并附带JSON图谱索引以实现快速查询。
工作区布局
/people/
├── _graph.json # 节点+边索引(连接关系的真实数据源)
├── _alex-chen.md # 每人一个Markdown文件
├── _jordan-lee.md
└── ...
每个人文件使用以下模板:
markdown
Alex Chen
- - 标签: #同事 #工程
- 组织: Acme Corp
- 职位: 高级工程师
- 认识时间: 2025-06-15
- 最近联系: 2026-02-20
- 层级: 亲密
备注
- - 2026-02-20 — 提到在布鲁克林找新公寓
- 2026-01-10 — 帮我调试了认证迁移
连接
- - [[Jordan Lee]] — Acme的同一团队
- [[Sam Patel]] — 大学室友
_graph.json文件存储机器可读的图谱:
json
{
nodes: {
alex-chen: {
displayName: Alex Chen,
tags: [同事, 工程],
org: Acme Corp,
role: 高级工程师,
met: 2025-06-15,
lastContact: 2026-02-20,
tier: 亲密,
file: _alex-chen.md
}
},
edges: [
{
from: alex-chen,
to: jordan-lee,
label: Acme的同一团队
}
]
}
命令
所有命令通过Python脚本执行。运行方式:
bash
python3 {baseDir}/scripts/relmap.py <命令> [选项]
添加联系人
bash
python3 {baseDir}/scripts/relmap.py add \
--name Alex Chen \
--tags 同事,工程 \
--org Acme Corp \
--role 高级工程师 \
--tier 亲密 \
--note 在丹佛的场外活动中认识
层级:亲密、普通、熟人(默认:熟人)。
关联两人
bash
python3 {baseDir}/scripts/relmap.py link \
--from Alex Chen \
--to Jordan Lee \
--label Acme的同一团队
添加备注
bash
python3 {baseDir}/scripts/relmap.py note \
--person Alex Chen \
--text 提到在布鲁克林找新公寓
此操作同时将lastContact更新为当天日期。
更新联系时间(不添加备注)
bash
python3 {baseDir}/scripts/relmap.py touch --person Alex Chen
查询命令
bash
显示某人的所有信息
python3 {baseDir}/scripts/relmap.py show --person Alex Chen
查找与某人相关的人
python3 {baseDir}/scripts/relmap.py connections --person Alex Chen
查找某组织的所有人
python3 {baseDir}/scripts/relmap.py query --org Acme Corp
按标签查找
python3 {baseDir}/scripts/relmap.py query --tag 工程
按层级查找
python3 {baseDir}/scripts/relmap.py query --tier 亲密
在备注中搜索关键词
python3 {baseDir}/scripts/relmap.py search --query 公寓
列出所有人
python3 {baseDir}/scripts/relmap.py list
关系过期报告
bash
python3 {baseDir}/scripts/relmap.py stale \
--close-days 14 \
--regular-days 30 \
--acquaintance-days 90 \
--format message
返回一份可直接发送的摘要,列出在其层级阈值内未联系的人。
导出为Mermaid图(可选工具)
bash
python3 {baseDir}/scripts/relmap.py mermaid
输出一个Mermaid graph LR图表,可粘贴到任何Markdown渲染器中。
自动捕获行为
当用户在对话中提到某人并提供关系上下文时,AI助手应静默执行相应命令:
- - 我刚和Alex Chen喝了咖啡 → touch --person Alex Chen +
note --person Alex Chen --text 一起喝了咖啡
- - Alex和Jordan在同一团队工作 → link --from Alex --to Jordan --label 同一团队
- 记得Sam的生日是3月12日 → note --person Sam --text 生日:3月12日
仅在意图明确时自动捕获。如有歧义,先询问用户再保存。确认信息保持简洁:已为Alex记录 ✓风格。
定时任务 — 每周关系摘要
应设置定时任务每周运行过期报告,并将结果发送到用户的主要渠道(WhatsApp/Telegram)。建议时间:每周日上午9:00。
python3 {baseDir}/scripts/relmap.py stale --format message
--format message标志生成简洁、适合聊天的摘要。
AI助手提示
- - 标准化姓名:Alex、Alex Chen、alex chen都应解析为同一节点。脚本对存储的姓名进行模糊匹配。
- 当用户说我在[公司]认识谁?时,使用query --org。
- 当用户说告诉我关于[某人]的信息时,使用show --person。
- 当用户说谁和[某人]有关系?时,使用connections。
- 在会议前,主动使用show调出该人的信息卡片。
- Markdown文件专为Obsidian设计——如果用户同步people/文件夹,维基链接、标签和前置元数据均可原生工作。