← Writing

Building Mímir: a personal AI agent that actually holds context

A terminal AI agent starts every conversation from zero. You explain your setup, your preferences, and the shape of the problem — then close the terminal and it's all gone. Next session you do it again.

So I built one that doesn't forget. I named it Mímir, after the well Odin traded an eye to drink from. It's five days old as I write this, so take what follows as a design note, not hard-won experience.

The core idea: memory is just files in git

No vector database, no embedding pipeline, no RAG. The agent's memory is a directory of markdown files in a git repo:

mimir/
├── CLAUDE.md           # identity, tone, standing rules
├── .claude/rules/      # always-loaded behavioral constraints
├── .claude/skills/     # on-demand workflows (empty so far)
└── memory/
    ├── notes.md        # facts I've told it
    ├── preferences.md  # how I want things done
    └── goals.md        # what we're working toward

Every session starts by reading memory/notes.md and memory/preferences.md. When I tell it something durable, it appends to the right file and commits. The commit log becomes an audit trail of everything the agent believes about me, and I can revert a bad memory the same way I revert bad code.

If your agent's memory isn't in version control, you can't see what it learned, and you can't undo what it learned wrong.

Rules beat prompting

The single highest-leverage file is CLAUDE.md. Not because it's clever, but because it's constraining:

That last one matters more than everything else combined. An agent with shell access and no autonomy boundary is a loaded gun pointed at your filesystem. An agent that asks before rm but installs packages without a permission prompt is genuinely useful.

The gotchas slot

There's a Gotchas section at the bottom of the always-loaded config, reserved for mistakes the agent makes more than once. The theory is a very short feedback loop: it gets something wrong, I add one line, it stops.

Mine is still empty. That's either a good sign or evidence I haven't been watching closely enough — ask me in a month.

What it actually does

So far: it set up my n8n instance, wrote the trigger helper and workflow registry, and built a scheduled crypto digest workflow. The intended scope is wider — system administration on Arch, research, keeping the project backlog straight — but that's the work it has actually done.

It also built this website, including the page you're reading.

What I'm watching for


← All posts