Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Brain — a knowledge base your coding agent maintains for you

A brain is a small git repository where an AI coding agent (GitHub Copilot, Claude Code, Cursor, …) accumulates the knowledge that lives in your head and nowhere else: business rules, the why behind decisions, internal vocabulary, team context. Code records what; the brain records why.

Every time you explain context to your agent during a conversation, that explanation is worth keeping. This repo gives the agent a place — and a process — to keep it.

How it works

  • One fact per file. Each note is a small markdown file with a few lines of frontmatter and the fact itself, including the why.
  • One index. MEMORY.md lists every note in one line each. Agents read the index first, then open only the notes relevant to the task.
  • Save automatically, announce loudly. The agent saves a note whenever you explain something not derivable from the code, and tells you in one line what it saved — so you keep your flow but can veto bad notes immediately.
  • Explicit triggers as the backbone. Proactive capture is best-effort; the /remember command is the guarantee. /garden prunes and merges notes every few weeks.

Setup

  1. Use this template (button above) to create your own brain repo — private if it will contain anything sensitive.
  2. Clone it locally and add it to your editor workspace alongside the project you work on (in VS Code: File → Add Folder to Workspace…, then save the multi-root workspace). The agent can only read/write files inside the workspace.
  3. Copy the instruction block from snippets/copilot-instructions.md into each work repo's .github/copilot-instructions.md (or your org-level custom instructions). Adjust the brain folder name if yours differs.
  4. The prompt files in .github/prompts/ travel with the brain: as long as the brain folder is in your workspace, /remember and /garden are available in Copilot Chat.

Layout

MEMORY.md           the index — one line per note, agents read this first
business/           domain rules and how the business actually works
decisions/          "we chose X over Y because…", dated
glossary/           internal vocabulary, acronyms, who-owns-what
projects/<name>/    per-project knowledge not derivable from its code
templates/note.md   the note format
snippets/           instruction block to copy into work repos

Note format

---
name: short-kebab-case-slug
description: one-line summary used to decide relevance
type: business | decision | glossary | project
---

The fact itself, in a few sentences. Always include the WHY —
that is the part the code never records.

Rules of the garden

  • Don't save what the repo already records — code structure, git history, READMEs. Only what exists in people's heads and conversations.
  • Update over duplicate. Before writing a new note, check the index for an existing one that covers it.
  • Wrong notes get deleted, not corrected around.
  • Convert relative dates to absolute ("next quarter" → "2026-Q3").
  • No secrets. Never store credentials, tokens, or personal data.

About

A knowledge base your AI coding agent maintains for you - one fact per file, an index, and /remember + /garden prompts

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors