CEREBROFY
Cerebrofy · the Repo Brain

Your AI forgets everything. Your repo shouldn't.

Every session, your assistant wakes up with amnesia and re-reads your code from scratch. Cerebrofy gives the repository its own memory, and your AI asks it instead.

$ uv tool install cerebrofy
$ cerebrofy init && cerebrofy build
    I · The situation

    It's Monday. You ask for one small change.

    Move where cross-session patterns get saved. Twenty minutes of work, you think. Your assistant opens a file. Then another. Then forty more, hunting for the answer the way you'd look for your keys by emptying every drawer in the house.

    Watch the slide. That sweep is every file being read, in order, for one question. And tomorrow it will do the whole thing again.

    Session log · without a brainIllustrative
    09:02 task move where patterns get saved
    09:02 read 40+ files, in order
    09:04 guess who calls what
    09:05 cost ~600,000 tokens for one question
    next day memory empty. start over.
    • 600k

      Cost

      Tokens per question on a 20,000-line codebase, if the assistant reads files.

    • Noise

      Most of what it reads has nothing to do with the task, and it still pays attention to all of it.

    • Guesswork

      Without the real call graph it guesses who calls what. Sometimes it guesses wrong, with total confidence.

    • Amnesia

      The decision you made at lunch, the dead end it hit at three, the pattern it noticed. Gone by morning.

    The model is fine. What it lacks is a memory.

    II · Why a brain

    You don't re-read the library to remember your own street.

    A human brain never re-reads the world. It keeps a map, remembers what happened, works out why things are the way they are, holds goals, and has a feeling for how sure it is. Nature solved this long ago, with specialised regions that talk to each other.

    So we borrowed the idea. Your repository gets one region for each kind of knowing, and your assistant asks the right region instead of searching everywhere. Scroll and watch each one light up.

    Neuron
    A named function, class or module, with a meaning attached.
    Connection
    A call or an import between two neurons.
    Lobe
    A module, with a short written summary of what it does.
    III · What exists today

    Born with the repo. Grows with it.

    Cerebrofy runs on your machine and keeps everything in one SQLite file. No server to host, no account, nothing uploaded. This is what happens when you run cerebrofy build.

    1. Parse

      Tree-sitter reads your code and names every function, class and module as a neuron. No LLM is involved, so the result is the same every time.

    2. Connect

      Calls and imports become typed edges: local calls, external calls and runtime boundaries.

    3. Remember

      Each neuron gets a meaning vector from a small embedding model that runs locally, stored with sqlite-vec.

    4. Summarise

      Each module gets a written lobe summary, ready for an assistant to read in place of the code.

    5. Serve

      One MCP server per machine answers your assistant's questions, routed by whichever folder you are in.

    6. Stay fresh

      Git hooks update the index on commit, push and merge, so you never have to remember to.

    Ask in plain words. Get only what matters.

    Ask "where do cross-session patterns get saved?" Cerebrofy finds the closest neurons by meaning, walks the call graph around them, and hands over just that: a few signatures, their neighbours and the lobe summaries.

    On the slide, the bright points are the modules involved and the rest stay faint. Your assistant never opens them. The answer is about 10,000 tokens, with real names, real paths and real call chains.

    • Blast radiusWhat breaks if this pull request lands?
    • Refactor impactWhat does this refactor really touch?
    • Vulnerability reachWhich code is exposed to this advisory?
    • Knowledge silosWhat does only one person understand?
    • Coverage gapsWhich risky code has no tests?
    • Semantic changelogWhat changed, in words people read.
    • Drift alertsDid the architecture just bend?
    • Review copilotA reviewer that knows the graph.
    • OnboardingWhere should a new hire start?
    • Upgrade navigatorWhat breaks when we bump this dependency?
    IV · What changes

    The same Monday, with a brain.

    Same task. Your assistant asks one question and gets the three neurons involved, who calls them, what was decided about them last month, who owns that lobe, and how sure the index is. It starts with the answer, and so do you.

    Reading raw files~600,000 tokens
    Asking Cerebrofy~10,000 tokens
    Typical 20k LOC repo · figures from the project README

    What you gain

    • About 97% fewer tokens per question than reading files.
    • Grounded answers. Real names, paths and call chains instead of guesses.
    • Memory that outlives the session. Decisions, sessions and learned patterns stay.
    • Blast radius before you edit, not after the incident.
    • Agents that see each other and claim neurons instead of colliding.
    • Private by construction. The database holds neurons, edges, hashes and embeddings. Source never leaves.

    What it costs you

    • One more thing to keep fresh. Hooks automate it, but an index can drift. That is why every answer carries a confidence score.
    • A first-run download. The local embedding model is about 130 MB. After that it works offline.
    • Static analysis has limits. Dynamic behaviour shows up as a runtime boundary, not a resolved call.
    • No unified cross-language graph yet. It is on the roadmap, not shipped.
    • It is a beta. It moves fast, and some edges are still rough.
    • Developers
      Start a task knowing the blast radius. Onboard in an afternoon instead of a month.
    • Tech leads
      See ownership, knowledge silos, health trends and architecture drift without a meeting.
    • Agent builders
      MCP-native, with a tool for each question. Plug it into the assistant you already use.
    V · Your turn

    Give your repo a brain.

    Two commands. It builds locally, hooks itself into git, and your assistant can start asking.

    $ uv tool install cerebrofy
    $ cerebrofy init && cerebrofy build
    Cerebrofy · MIT licence · by Mohamed MorsyDrawn from Cerebrofy's own source