DEV Community

Sora Terui
Sora Terui

Posted on

I put my AI's memory in Markdown and Git: the failures I fixed along the way

What I built

I built a personal AI operations base: my memory and rules live in plain Markdown, managed with Git, so any AI agent can use them the same way. I started on October 5, 2026, and I have used it every day for about six weeks (about 680 commits so far).

The AI reads this folder to answer, writes records, and can add calendar events and create email drafts. A human sends and deletes. I do.

The design write-up (without private details) is public on GitHub:
https://github.com/sora-uzu/personal-ai-public

Why

Each AI service kept its own memory. I could not see what was stored where, and I could not carry it with me. So I moved the memory into my own files and made the AI the one that reads and writes them. Files are readable, editable, and they survive a change of AI or model.

Three design choices

  1. Separate memory from the AI. The source of truth is one file, AGENTS.md. Claude Code does not read AGENTS.md on its own, so CLAUDE.md imports it with @AGENTS.md.
  2. Limit what the AI reads. Numbered folders separate roles, and the AI reads only what it needs. It never reads everything.
   00-rules/     rules: thinking, output format, recording steps
   01-private/   personal data (outside git)
   02-knowledge/ facts about me that the AI reads while working
   03-output/    things I made
   04-resources/ research notes and original materials
   05-todo/      tasks not started yet
   99-trash/     where files go instead of being deleted
Enter fullscreen mode Exit fullscreen mode
  1. Separate permissions. The AI records, adds calendar events, and drafts emails. Sending and deleting stay with a human. The private folder is outside git.

Three scheduled jobs also run: a morning summary, daily AI/IT news, and a weekly review on Sundays.

Failures I hit, and the rules I wrote

The AI often made plausible-looking mistakes. Each time I turned the cause into a rule in AGENTS.md or 00-rules/.

  • It guessed the time. It said "it's about time for X" without checking. → Before any statement about time, it must run date.
  • It stopped investigating at "no mention of that feature." → I added a fixed order to sources.md: product terms, official support, the previous model, browser check, original text, then ask me.
  • When a tool failed, it rephrased the error as the cause. → It now runs its own diagnostic commands first and states only what it confirmed.
  • Facts and guesses got mixed. → Every answer separates fact, guess, and unconfirmed.
  • Replacing the body of a note with a script made the text tiny. Replacing an existing note shrank the font twice; creating a new note gave the standard size. → Never overwrite the body; create a new note, and record why.

None of these fixes is "ask the AI to be careful." Each one is a written procedure so the same mistake does not happen again. Because the files are the source of truth, the fixes stay even if I change the AI.

Closing

The more you use AI at work and in life, the more "what to remember" and "how much to delegate" become design problems. Keep memory in files, separate permissions, and turn mistakes into rules. I hope this helps someone.

If you do it differently, I would like to hear how.

Top comments (0)