Personal Brain
An MCP server that gives your AI agent memory of your professional network.
[PyPI]
[Python]
[Tests]
[License: MIT]
Personal Brain loads your LinkedIn connections into a graph in FalkorDB. Claude Code, or any MCP client, can then look up who you know, find who can introduce you to whom, and remember who you met. A 3D viewer shows the graph as a galaxy.
This command needs a database with your network in it. See the quick start.
[Personal Brain demo: a galaxy of 19k nodes answering questions]
Try the live demo. All connections in it are made up, and its companies and events are only example names.
After every event you meet people. Two weeks later you forget who they were, what they work on, and who could introduce you to whom. Your agent can now remember that for you. Your agent cannot delete anything: only you can, with personal-brain forget.
Everything runs on your laptop.
Quick start: a sample network in 5 minutes
You need uv and FalkorDB. uvx downloads the right Python for you.
The made-up sample network has 241 invented people, startups and events, in the same file formats as a real LinkedIn export. You can try everything before you download your own data.
1. Start FalkorDB. Run it in Docker, or see FalkorDB Cloud:
2. Load the sample, and add the server to Claude Code:
Try:
- "Who in my network works at Kestrel Graph?"
- "Who did I talk to about agent memory?"
- "Who could introduce me to someone at a well-funded startup?"
- "I met Oskar Mensah at the Graph & RAG Meetup. He's building agent memory." (There are two Oskar Mensahs, so it asks which one.)
Other MCP clients: the server runs over stdio. Most clients take this config:
FalkorDB Cloud
A free FalkorDB Cloud instance works without Docker. Pass its URL to the server, and add --cloud to load and export:
Or put FALKORDB_URL=... in ~/.personal-brain/.env.
The MCP tools
uvx personal-brain mcp gives your agent three tools on one graph:
No tool deletes, so text hidden in a LinkedIn headline cannot make your agent delete anything. It could still lead an agent to save a fake note, so each tool tells the agent to treat that text as data, and personal-brain notes shows what was saved, newest first. No instruction can fully stop this. To delete, run the command yourself. It asks first, unless you add --yes, and it also updates the viewer's files if you have them:
Every write hangs off a Note node, so you can trace each fact to the note that made it. Running personal-brain load again with a new LinkedIn export keeps your notes and what they added. If the new import has the same fact, the import wins, and someone you saved who is now in the import becomes one person. --force drops your notes. load --sample asks before it replaces a real network, and --yes skips the question. PB_GRAPH picks the graph (default network). If FalkorDB is not running, the server still starts, and each tool says how to start it. It runs on macOS and Linux. Windows is not supported.
Each new LinkedIn export also tells you what changed. personal-brain load prints who changed jobs since the last load, and your agent can ask for it later. If your export has message dates, your agent can answer "who did I lose touch with". It reads only the date, not the message. personal-brain followups lists what you still have to do.
The 3D viewer
Run personal-brain export, then personal-brain view, and open http://127.0.0.1:8765. It works offline, because three.js is included.
- Shows your whole network as a galaxy in WebGL (tested with 19k nodes and 117k edges), with a 2D / 3D toggle.
- Time-lapse: watch your network grow, connection by connection, with your events popping up.
- Ask the graph: a question types itself, then its Cypher query, then the answer lights up with light pulses along the paths. Example questions:
- Which founders did I meet at events in the last year?
- Who in my network works at big tech?
- Who can warm-intro me to people at well-funded startups?
- Which startups host AI events, and who do I know there?
- Who should I invite to my podcast on agents and memory?
- Which upcoming agent events can I speak at through people I know?
- Remember: type "Met Maya from Supabase at AI Engineer Summit, runs developer events" and it is written to FalkorDB live and appears in the galaxy.
- Live view: keep
personal-brain view open while your agent works. Each person it looks up or saves lights up in the galaxy.
- Demo mode: the whole show hands-free (press
D).
How it works
- Your LinkedIn export gives connections (with the date you connected), your messages (only counts are used, never text), your posts, jobs and schools.
- Optional files in
data/enriched/ add each connection's full job history, schools and skills, company funding, and upcoming events. They use the JSON format of sample_data/enriched/. This repo has no tool to collect them; everything works without them.
- load_graph.py builds the graph and infers:
KNOWS between two connections who worked at the same company or studied at the same school for 3+ months at the same time (at big schools, same start year only), who work at the same company now (when there is no job history), or who are in the same group chat.
Event nodes: days when you added 5+ connections are probably events. Name them in my_brain.json.
Topic interests (AI agents, agent memory, knowledge graphs, founders, investors, podcasts…) from headlines and skills.
- With enriched files only:
- Years of experience per technology from job titles and descriptions.
well_funded startups: private, active, at most 5,000 people, and a Series round or 8+ investors.
City from each profile's location, at metro level ("Berlin Metropolitan Area" and "Berlin" are one city; Palo Alto and San Jose are "SF Bay Area").
- Who hosts each upcoming event: a host who is your connection (LinkedIn match), or a company where you know people (host is the company, a host works there, or the title names it, like "Notion x Clover").
- export_graph.py + layout_graph.py export the graph to JSON and compute a 2D layout (igraph DrL). In 3D, each node type sits on its own layer.
- export_stories.py runs the "Ask the graph" Cypher queries on FalkorDB and saves the answers and timings for the viewer.
Graph schema
Build your own
1. Get your LinkedIn data. LinkedIn > Settings > Data privacy > Get a copy of your data.
Two choices:
- Connections only: usually ready in about 10 minutes. You get people, their current company and title, and the day you connected. That is enough for the graph, events and the agent tools.
- Download larger data archive: ready in about a day. It adds your messages (only counts are used), posts, jobs and schools.
Unzip it into ~/.personal-brain (the folder name contains LinkedInDataExport). If there are several, load reads the newest. personal-brain --help shows your data folder. To use another folder, set PB_HOME.
Or start empty. Skip the import. The MCP server creates you in an empty graph, and the graph grows as you tell your agent who you met.
Optional: copy my_brain.example.json to ~/.personal-brain/my_brain.json to name your events and skip companies.
2. Build the graph and the viewer data. Add --cloud to both when you use FalkorDB Cloud:
3. Open it.
Open http://127.0.0.1:8765. Keys: 2 / 3 switch views, T time-lapse, B big bang, D demo, Esc reset.
To explore in the FalkorDB Browser instead, see docs/demo_queries.cypher.
Work on the code
You need Python 3.10 or newer, uv and Docker. In a clone, your data folder is the clone itself, and Claude Code reads .mcp.json from any folder inside it.
Then, in another terminal, run the tests. They use throwaway graphs:
Your data stays yours
- Your data stays in
~/.personal-brain, outside the package. Only you can open that folder. In a clone, the export, data/, .env and my_brain.json are in .gitignore. Never commit them.
- Message text is never read into the graph, only how many messages you exchanged with each person and the date of the last one.
data/viewer/graph.json in your data folder holds real names. Share screenshots, not that file.
- The local server listens on
127.0.0.1 only and serves only data/viewer/.
Files
This is an early project. It has tests and CI, but commands and tools may still change before 1.0.
Contributing
See CONTRIBUTING.md. To report a security problem, see SECURITY.md.
License
MIT, see LICENSE. three.js in src/personal_brain/viewer/vendor/ is MIT too (its own LICENSE file).