people-memory-mcp

people-memory-mcp

An MCP server that gives AI agents a private, durable memory of people, providing a personal people graph in PostgreSQL with tools to search, remember, and connect people, plus imports from LinkedIn, Google Contacts, and WhatsApp, and a browser UI.

Category
访问服务器

README

People Memory

Give your AI agent a private, durable memory of everyone you know.

People Memory is a personal people graph with an MCP server, PostgreSQL schema, optional REST API, browser UI, importers, and agent skills. It remembers people across conversations, retrieves someone as soon as you mention them, records durable facts, and asks before it merges ambiguous identities.

Your data stays in your PostgreSQL database. The repository contains no hosted service, telemetry, contact data, or credentials.

What it does

  • Maps people, organizations, relationships, affiliations, identifiers, facts, and interactions.
  • Gives Codex, Claude Code, and other MCP clients semantic tools plus guarded SQL.
  • Teaches the agent to look up names before answering and save durable facts during every chat.
  • Imports LinkedIn Connections, Google Contacts, and WhatsApp chat exports.
  • Can enrich records through connectors the user approves, including Gmail, Calendar, and Drive.
  • Runs fully local with Supabase CLI or in the cloud with any PostgreSQL database.
  • Recommends a free Supabase project because it includes Postgres, Auth, REST, and a local stack.
  • Includes a full-screen relationship graph and searchable directory.
  • Refuses uncertain merges and conflicting overwrites until the user decides.

How it fits together

flowchart LR
  Agent["Your existing agent"] --> MCP["People Memory MCP"]
  MCP --> PG[("PostgreSQL")]
  Agent --> Connectors["Optional Gmail / Calendar / Drive / WhatsApp connectors"]
  Connectors --> MCP
  UI["Private graph UI"] --> Supabase["Supabase Auth + REST"]
  Supabase --> PG
  API["Optional REST API"] --> PG

The MCP server provides live reads and controlled writes. The bundled skills provide the behavior: when to retrieve, what to remember, how to import, when to ask, and how to upgrade safely.

Quick start

Requirements: Python 3.11+, uv, Docker, and the Supabase CLI.

git clone https://github.com/michelgrolet/people-memory-mcp.git
cd people-memory-mcp
uv sync --extra api --extra dev
supabase start
supabase db reset

supabase status prints the local database URL, API URL, and browser publishable key. Save the database URL in ~/.config/people-memory/.env:

PEOPLE_MEMORY_DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres
PEOPLE_MEMORY_ENABLE_RAW_SQL=false
PEOPLE_MEMORY_DEFAULT_SOURCE=agent

The file is read automatically and should have mode 0600.

Set your owner email before using the UI:

update app_settings set value = 'you@example.com' where key = 'owner_email';

Then configure the browser app:

cp web/config.example.js web/config.js
# add the API URL and publishable key printed by `supabase status`
python3 -m http.server 4173 --directory web

Open http://127.0.0.1:4173. Local signup emails appear in Supabase Mailpit, whose URL is also printed by supabase status.

Connect an agent

The interactive wizard detects Codex and Claude Code:

uv run people-memory setup

Or add the server directly.

Codex:

codex mcp add people-memory \
  --env PEOPLE_MEMORY_ENV_FILE="$HOME/.config/people-memory/.env" \
  -- uvx --from git+https://github.com/michelgrolet/people-memory-mcp people-memory-mcp

Claude Code:

claude mcp add -s user people-memory \
  -e PEOPLE_MEMORY_ENV_FILE="$HOME/.config/people-memory/.env" \
  -- uvx --from git+https://github.com/michelgrolet/people-memory-mcp people-memory-mcp

Start a new agent session after adding an MCP server. Install or invoke setup-people-memory from the plugin to add the durable memory rule, choose imports, connect optional data sources, and verify the complete flow.

Install the agent skills from a clone

Codex discovers skills in ~/.agents/skills; Claude Code uses ~/.claude/skills. Symlink every People Memory skill so updates to the clone are picked up automatically:

mkdir -p "$HOME/.agents/skills"
for skill in "$PWD"/skills/*; do
  ln -s "$skill" "$HOME/.agents/skills/$(basename "$skill")"
done

Use ~/.claude/skills instead for Claude Code. Restart the agent, then ask it to run setup-people-memory. The repository is also packaged as a Codex plugin for marketplace or team distribution.

MCP tools

Tool Purpose
search_people Search names, organizations, roles, cities, identifiers, summaries, and facts
get_person Return a complete person record, or candidates when a name is ambiguous
remember_person Create or update a person without silent duplicate merges or overwrites
add_fact Save typed or free-form facts with source and confidence
record_interaction Record a call, message, meeting, meal, or other dated interaction
connect_people Record how two people know each other
find_intro_path Find warm introduction paths into an organization
stale_contacts Find strong relationships that have gone quiet
read_query Run one guarded SELECT for advanced analysis
write_query Run one guarded INSERT, UPDATE, or DELETE

Raw SQL is disabled by default. If enabled, it rejects multiple statements, DDL, dangerous functions, multiple data-changing operations, and UPDATE/DELETE without a WHERE clause. read_query also runs inside a read-only transaction with a bounded result set.

Imports

Official exports are the safest default. They are inspectable and do not require sharing account passwords.

uv run people-memory import linkedin ~/Downloads/Connections.csv
uv run people-memory import google ~/Downloads/contacts.csv
uv run people-memory import whatsapp ~/Downloads/chat.txt --self-name "Your Name" --date-order dmy

Imports resolve email or phone first, then name. They fill missing values and never overwrite a conflict silently. The import-contacts skill can inspect unfamiliar CSV columns and guide the user through ambiguous matches.

Optional connectors

People Memory does not collect Gmail, Calendar, Drive, or WhatsApp credentials. The enrich-people skill uses connectors already authorized in the user's agent. It asks which sources may be read, limits the time range, shows what it plans to save, and marks every fact with its source.

Supported patterns include:

  • Gmail: participants, signatures, organizations, and last interaction dates.
  • Calendar: meetings, attendees, locations, and interaction dates.
  • Drive: user-selected documents that mention known people.
  • WhatsApp: official exports by default; a self-hosted MCP bridge is optional.
  • Browser agents: Codex in Chrome or Claude in Chrome can help configure Supabase and inspect the UI.

See docs/connectors.md for the permission and identity rules.

Hosted Supabase

Create a free Supabase project, then apply the checked-in migrations:

supabase login
supabase link --project-ref YOUR_PROJECT_REF
supabase db push

Set owner_email, enable the desired Auth providers, and deploy web/ to a static host. The browser uses only the publishable key. Row-level security rejects every account except the configured owner. The MCP server uses a direct PostgreSQL URL stored outside Git.

For an existing non-Supabase PostgreSQL database, apply only supabase/migrations/20260803000000_core.sql and use the optional API for browser access.

Optional REST API

uv run --extra api people-memory api --host 127.0.0.1 --port 8765

Set PEOPLE_MEMORY_API_TOKEN to require Authorization: Bearer .... Keep the API on loopback unless you put it behind TLS, authentication, rate limits, and backups.

Skills

  • setup-people-memory: choose local/cloud deployment, configure an existing agent, select imports, offer approved connectors, start the UI, and verify the install.
  • remember-people: retrieve on name mention and save durable human facts during conversation.
  • import-contacts: import and deduplicate official exports.
  • enrich-people: use approved Gmail, Calendar, Drive, browser, or WhatsApp connectors.
  • maintain-people-memory: audit duplicates, conflicts, stale ties, and data quality.
  • upgrade-people-memory: back up, migrate, upgrade the MCP/UI/skills, and verify data.

If the user does not already have an agent, the setup skill can create a minimal Codex or Claude Code workspace from templates/ and connect People Memory to it.

Privacy and safety

This database contains third-party personal data. Treat it accordingly.

  • One database per person is the default design.
  • Hosted UI access is restricted with Supabase Auth and forced row-level security.
  • The browser publishable key is safe to expose only because RLS is enabled.
  • The service-role key and PostgreSQL password must never enter browser code or Git.
  • Connector access is opt-in per source. Imported and inferred facts keep provenance.
  • Delete archives a JSON snapshot in deleted_records before cascading dependent rows.
  • Back up before schema upgrades or bulk merges.

Read docs/privacy.md and SECURITY.md before exposing any component to the internet.

Development

uv sync --extra api --extra dev
uv run ruff check .
uv run pytest --cov=people_memory
supabase db reset

The project uses the current stable v2 line of the official MCP Python SDK and the latest Supabase migration workflow.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选