AI second brain

I built AI second brain (aka BRAIN) because I kept running into the same limitation with AI assistants: every conversation could be valuable, but the context was fragmented across sessions, tools and models. Important decisions, ideas and project knowledge were easy to lose, and every assistant only had part of the picture.

My goal was to build an external memory that I could inspect, control and share across AI agents. Instead of relying on the opaque memory of a single platform, BRAIN transforms natural conversations into structured, reusable knowledge.

How I built it

BRAIN is a Model Context Protocol (MCP) server that stores information as lightweight JSON objects connected by weighted relationships.

Objects represent projects, tasks, ideas, technologies, resources or preferences, and include metadata such as priorities, deadlines and archive history. Rather than being a note-taking tool, BRAIN acts as a persistent knowledge graph that AI agents can search, navigate and extend.

To make this memory understandable for humans, I also built a visual interface that displays the graph as a galaxy of connected nodes. It makes it easy to inspect relationships, browse related concepts, review recent changes and spot isolated nodes that should probably be linked.

One interesting aspect is that BRAIN was used to build itself. Every feature request, bug report, architectural decision and UI improvement became a node inside the graph. Completed work was archived instead of deleted, so the project now contains its own development history.

What inspired me

More than building another productivity tool, I wanted to explore a different way of collaborating with AI.

During development I naturally split my workflow into two roles:

  • ChatGPT for brainstorming, research, architecture and feature design.
  • Codex for implementing the resulting tasks inside the repository.

Once an idea was mature, ChatGPT generated detailed implementation tasks that were stored in BRAIN. Codex then picked them up and focused purely on writing code.

This workflow turned out to be surprisingly effective. It also kept token usage low, which mattered to me. Most of the reasoning happened in ChatGPT, while Codex sessions stayed focused on implementation. BRAIN became the shared memory between both environments.

Recent versions of the Codex desktop application have started merging ChatGPT and Codex workflows by allowing ChatGPT conversations to be opened directly inside Codex. I think that's an interesting direction, but I personally still prefer keeping a clear separation of responsibilities: ChatGPT as my thinking environment, Codex as my engineering workspace, and BRAIN as the durable bridge between them.

What I learned

One of the biggest lessons was that memory quality depends far more on structure than quantity.

Early versions either created too many isolated nodes or merged unrelated information into oversized project pages. Through many iterations, I refined a set of rules:

  • search before creating new information;
  • avoid true duplicates;
  • create independent nodes whenever an idea has its own lifecycle;
  • actively build relationships instead of treating them as optional metadata.

I also learned that documentation and implementation easily drift apart. Testing the MCP in real conversations exposed obsolete rules and assumptions that had to be rewritten so the documentation always reflected the actual tools and data model.

Challenges

The hardest challenge wasn't technical—it was deciding what deserves to become long-term memory. Recording everything creates noise, while recording too little makes the system useless. BRAIN therefore focuses only on durable information such as projects, decisions, constraints, preferences and reusable knowledge.

Building a graph that remains intuitive was another challenge. Search behaviour, graph layout, node selection, mobile interactions and visual feedback all required several iterations before the experience felt natural.

Preparing the project for open source was equally important. I cleaned the repository, removed personal data, documented the setup, translated the project into English and designed an onboarding process so someone else can start from an entirely empty brain.

Looking ahead

BRAIN is already available as an open-source project that developers can self-host and connect to multiple AI assistants.

My current focus is on making the project more robust and easier to adopt: improving the onboarding experience, refining the documentation, and continuing to evolve the MCP tools and graph visualization through real-world usage.

Longer term, I want to explore automatic synchronization with conversations, documents and workspaces while continuing to extract only durable knowledge, rather than indexing everything.

Ultimately, BRAIN is my attempt to give users ownership of their AI memory: a transparent, structured knowledge graph that can be shared across assistants instead of being locked inside a single platform.

Built With

Share this project:

Updates