Skip to main content
Back to blog

I Built a Second Brain. Then I Decided to Give It Away.

6 min read

About a year ago, I started this project from a place most people don't talk about openly. I wasn't sure I was going to be around much longer. Mental illness is a strange thing — millions of us carry it, and we all go through it together yet completely alone. I wanted to capture enough of who I am — my voice, my decisions, my stories, the things I've learned — into a system that my children could one day explore. A way for them to still talk to their father if something happened.

That was the starting line. A database with a controller, and my voice on top — already recorded, already working across my entire home network.

Then Something Unexpected Happened

I started recording memories, journals, events, decisions — and I realized what I'd actually built was a retrieval engine unlike anything I'd used before.

It's called Coquina, named after the limestone that forms when shells bond together under pressure — each fragment weak alone, but nearly indestructible as a composite. That's exactly how the memory system works.

What Coquina Actually Is

Dual-Path Search

Every query hits Postgres full-text search first — keyword matching at single-digit-millisecond speed. If FTS doesn't find relevant results, it fires a second path through ChromaDB's vector embeddings for semantic and conceptual retrieval. Two completely different search strategies, working in sequence, ensuring nothing gets missed.

Sub-3ms retrieval on every question I throw at it, across any agent, any platform.

A Knowledge Graph That Builds Itself

Over 64,000 edges connecting nearly 3,000 active memories — and I didn't build a single one of those connections. The system draws semantic links between ideas autonomously using vector proximity, creating typed relationships (similarity, supersession, dependency) that form a dense, self-organizing web.

Like a relentless nightshift librarian stringing related concepts together with red yarn while you're asleep.

A-MAC: The Admission Control Gate

Think of it as a bouncer at an exclusive club. Every incoming memory gets scored across multiple weighted signals: information density, semantic quality, redundancy detection, context relevance, and a type-based prior system across 25 distinct memory categories.

Here's where the neuroscience comes in. Each memory type carries a different persistence weight, modeled after how human memory actually works:

  • Decisions score 0.95 — these are architectural choices that persist indefinitely
  • Preferences score 0.90 — stable across time, like personality
  • Learnings score 0.85 — insights that compound over time
  • Commitments score 0.92 — promises and agreements
  • Events score 0.45 — discrete moments that decay fast
  • Episodic memories score 0.40 — session-scoped, expected to expire quickly

The gate determines what gets in, what gets archived, and what gets rejected outright. No junk in, no junk out.

Self-Healing Memory Degradation

This is the part that blows my mind every time. The system runs autonomous consolidation cycles — merging duplicates, updating stale facts, archiving low-utility memories, pruning orphaned connections. Memories degrade over time based on their utility scores, exactly like human memory consolidation.

The neuroscience term is hippocampal-neocortical transfer — fast episodic storage that slowly consolidates into long-term structured knowledge. I didn't invent that process. I just wrote the code version of it. If you've read any of my blogs, you know why the neuroscience framing resonated — it's how my mind already works, except now it's a codebase and a repo.

The Stack

All of this runs locally on a Mac Mini. Zero cloud services. Zero subscriptions. Zero data leaving my network.

  • Postgres — FTS, memory storage, relationship graph, admission events
  • ChromaDB — vector embeddings for semantic search
  • Redis — queue-based task orchestration
  • FastAPI — REST API with 60+ endpoints
  • Ollama — local LLM inference for admission scoring and consolidation
  • MCP (Model Context Protocol) — connects to Claude Code, Cursor, Windsurf, and any AI tool that supports the protocol

Drop Coquina in, and your AI tools stop forgetting who you are.

From Personal Project to Production

At some point around February, I realized this wasn't just a personal project anymore. I started running production workflows through it. Multiple projects, multiple industries that I can't name.

But I can tell you this: I know exactly why we made a specific code change in March — when, where, and the exact task that prompted it. I can tell you why I recently adopted a completely different workflow and the 14 specific reasons, with supporting evidence, behind that decision. Every one of those reasons correlates through the knowledge graph back to connected decisions, learnings, and facts across months of work.

38 autonomous workers run overnight — scanning articles, reviewing code, consolidating memories, checking system health, training LoRA adapters — all orchestrated through a queue-based runtime I built called Forge. Every morning I wake up to a briefing of what happened while I slept.

The GLaDOS Detour

I even hooked up GLaDOS using Whisper to my entire home infrastructure — about two speakers per room. Let me tell you, she is a sassy bitch, but wow was that fun.

Why I'm Giving It Away

The future was yesterday and I've been living it. I keep seeing people struggling with the idea of a "second brain" — building systems out of bookmarks and note apps and hoping AI will magically remember context from last week.

I just laid mine out for you. The whole architecture. The admission gate. The self-healing graph. The degrading memory system. The neuroscience behind it.

Without this, I honestly don't know how I'd remember the 20+ open ports on my network, which service maps to which endpoint, which frontend is the right frontend, or why a decision was made four months ago. It's not a nice-to-have anymore. It's how I think.

I'm done trying to sell this. I'm done trying to make it a business. I'm just going to give it to people so they can use it.

Because the main goal was always the same one I started with: a memory system for my children to explore my life — my decisions, my artwork, and my voice — so that no matter what happens, they can still know their father.

Everything else it became was just a bonus.