I Built the Memory, Now I'm Building the Brain
Three weeks ago I shipped Memory Vault v1.0 — an open-source, self-hosted AI memory system you run yourself. A long-term memory layer for AI assistants. The first product in a planned compounding stack.
Today the second product in that stack exists too. It's called The Brain.
I'll get to what it is in a second. First, the honest part: I didn't announce it the day I started. I built the first milestone in private, on my own, with no audience watching. Three days of focused work, ten merged PRs, then a clean stop. Build-in-public is the long-term plan for this project the same way it was for Memory Vault. But the first week was head-down, because the riskiest part of a new product isn't the announcement — it's whether the thing actually works. Now that it does, I can tell you about it without hedging.
What The Brain is
The Brain is a workflow orchestrator, not an AI agent. It runs Python-defined workflows you author, with full visibility into every step. The intelligence is in the workflow you write; The Brain is the runtime that makes it repeatable and observable. It calls LLMs as steps when needed; it doesn't replace them.
Concretely: you write a Python file that describes a sequence of steps. Each step is a shell command, a Memory Vault query, or a local LLM call. The Brain runs them top-to-bottom, passes output forward between them with named placeholders, and persists every run to Postgres. You inspect runs from the CLI. Successful runs exit 0; failed runs exit 1. It drops straight into cron jobs or CI pipelines.
That's it. That's the whole pitch. There's no autonomous decision-making, no agent loop, no self-direction. It runs what you tell it to run, and it records what happened.
Why I'm building it
Memory Vault is the foundation. The Brain is the layer on top.
Memory Vault stores knowledge and makes it searchable. The Brain takes that knowledge and does something with it. A daily digest workflow pulls recent memories, summarizes them with a local LLM, and writes the result to a file — three step types, one Python file, one command to run. Today you run it manually from the CLI; the next milestone adds cron scheduling so it runs unattended. The same shape generalizes to any "read from memory, reason about it with a local model, write the result somewhere" workflow.
The strategic point: every product in this ecosystem owns its runtime. The Brain doesn't wrap LangChain or LangGraph or CrewAI. The orchestration layer is too load-bearing to depend on someone else's framework — when the framework changes, your workflows break, and the framework changes constantly. Owned runtime, owned database, owned LLM client, owned everything. Five years from now this still runs.
What M1 ships, today
M1 is called "Bare Runner." The name is the honest scope: it's the smallest thing that proves The Brain works end-to-end.
- Run Python-defined workflows from the CLI with
brain run path/to/workflow.py. - Three step types:
ShellStep(subprocess + timeout),MemoryVaultStep(Memory Vault REST),LLMStep(OpenAI-compatible against LM Studio). - Placeholder substitution — steps pass output forward with
{step_name}tokens. A workflow's second step can read the first step's output by name. - Persistent run history in Postgres — every run, every step, every output, every error. One
workflow_runstable with the run's full step-by-step output as a JSONB array. - CLI introspection —
brain historylists past runs,brain show <run_id>shows full step-by-step detail for one run. Run IDs match by prefix. - Strict failure semantics — a workflow halts on the first failed step; the run row always lands in Postgres with a terminal status, even if an executor raises unexpectedly. No partial writes, no lost runs.
- One-command Docker —
docker compose up -dbrings up Postgres and The Brain together, migrations run on boot. - 46 hermetic tests — pytest with a real Postgres test container, MV and LLM HTTP faked via
httpx.MockTransport. The suite is fast, deterministic, and runs anywhere.
The repo has a full quickstart that walks a new user from clone to first run. The first example workflow is two shell steps — no external services, no API keys, guaranteed to run on a fresh install. The second is the real-world digest workflow that uses all three step types.
A run looks like this:
$ docker compose exec brain brain run examples/hello.py
Running workflow 'hello' (2 steps)
✓ greeting
✓ echo_it_back
Run c609f5e0 — success
And inspecting it after:
$ docker compose exec brain brain show c609f5e0
Run: c609f5e0-a8d6-4221-84c0-58c0b5d0460d
Workflow: hello
Status: success
Started: 2026-05-22 19:54:58
Duration: 0.0s
Steps:
✓ greeting
Hello from The Brain
✓ echo_it_back
The previous step said: Hello from The Brain
That's M1. Everything else is built on this foundation.
Who this is for
Developers who run real workflows on their own machines and want LLMs as a step inside those workflows — not as the thing in charge. Solo builders stitching together memory, models, and shell tools who are tired of agent frameworks that change their API every quarter. Anyone who wants every run to be inspectable, every output persisted, and every decision their own to make.
If you've ever written a Python script that calls an LLM, then bolted on a cron entry, then realized you have no record of what it did yesterday — this is for you.
What's next
Milestone 2 is triggers and state — cron schedules, a long-running scheduler daemon, and workflows that read the previous run's output. M2 is the milestone where The Brain becomes worth running unattended.
The full roadmap and milestone progress table live in the repo's README. Each milestone gets a dev-log post here as it ships.
How I'm building it
The same way I built Memory Vault. Scope locked up front in a private plan, milestones decomposed into small slices before any code is written, every slice shipped as a feature branch through a draft PR. Trunk-based. No long-running branches. Every PR is a complete, working piece of the milestone.
What I learned from Memory Vault and carried over: the unsexy weeks are the actual launch. Tests, security, documentation, the discipline to fix root causes instead of bypassing them. Most of v1.0's quality came from that, not from the headline features. The Brain inherits the same standards from day one.
Try it
git clone https://github.com/MihaiBuilds/the-brain
cd the-brain
docker compose up -d
docker compose exec brain brain run examples/hello.py
That's the whole quickstart. The repo has the full version with configuration, Memory Vault wiring, and the real-world digest example.
Follow the build
- Twitter / X: @mihaibuilds
- Blog: mihaibuilds.com
- GitHub: github.com/MihaiBuilds/the-brain
Watch the repo to follow along as each milestone ships.