Memory files
Weavekeep keeps each project's decisions and facts in two Markdown files. You can read and edit them; your edits go back into memory.
Where they live
Each project gets its own folder under ~/.weavekeep/memory/:
~/.weavekeep/memory/
shop-3f2a91c0/
decisions.md
facts.md
_user/
decisions.md
facts.mdThe folder name is the project folder's name plus the first 8 characters of a hash of its full path, so two checkouts both called shop do not share memory. What you saved for every project (weavekeep remember --user, or scope: "user" from the agent) goes in _user/: decisions in _user/decisions.md, facts in _user/facts.md. Those are shown in every project, and they never name the project you saved them from.
To print the folder for the project you are in (inside a git repository, that is the repository, even from a subfolder):
weavekeep memory pathThe files appear after the first decision or fact is saved for the project.
The format
decisions.md has one decision per line:
# Decisions: /home/you/projects/shop
<!-- Weavekeep memory. Edit freely: change a line to update it, delete a line to forget it, add a "- " line to add one. -->
- Use Drizzle for queries, never raw SQL <!-- wk:01a1600e-0ff8-7350-965d-febcf4b1dcee -->
- Payments go through Stripe Checkout <!-- wk:01a1600e-1053-70e4-8e88-452e43d63996 -->_user/decisions.md looks the same, with the heading # Decisions: user scope (all projects). A line you add there applies to every project.
New decisions are added at the end of the file. At session start the agent sees them newest first, last line first, so when there are more than fit, the oldest are left out. The file keeps its order.
A decision saved with its own subject starts with it: - **docs** decision: Use American spelling. Without a subject the line is just the text.
The questions an agent saves with a decision or fact (the questions of remember, so search finds it by the words you would ask with) are not in the files: they are only searched, never shown. When you reword a line, the reworded decision keeps them. A line you add by hand has none.
facts.md has one fact per line, as **subject** relation: value:
# Facts: /home/you/projects/shop
<!-- Weavekeep memory. Edit freely: change a line to update it, delete a line to forget it, add a "- " line to add one. -->
<!-- Format: - **subject** predicate: value -->
- **staging-db** uses: postgres <!-- wk:01a1600e-10b2-7282-a74f-a8a67917fd41 -->Rules:
- An entry is a line that starts with
-or*at the very start of the line. - Anything else (headings, paragraphs, indented lines) is yours. Weavekeep never changes it.
- The
<!-- wk:… -->comment at the end of a line is the entry's id. It ties the line to its row in the database. Leave it in place. - Each entry is one line. Line breaks inside a saved value become spaces.
Editing
Open the file in any editor. You can also run:
weavekeep memory openThis opens decisions.md in $VISUAL or $EDITOR, and applies your changes when the editor closes. Without either variable, it uses your system's default app (xdg-open on Linux, open on macOS), or prints the path.
| You do | Weavekeep does |
|---|---|
| Change the text of a line | Replaces that memory. The old version is marked as replaced, and the line gets a new id |
| Delete a line | Forgets that memory |
Add a - line | Saves it as new memory and adds an id comment to the line |
In facts.md, a new line must follow the **subject** relation: value form. A bullet that cannot be read is left exactly as you wrote it and reported:
✓ 1 added, 1 updated, 0 removed ~/.weavekeep/memory/shop-3f2a91c0
! 1 bullet could not be read and was left as written.Nothing is ever deleted from the database. A removed or changed line marks the old entry as replaced or forgotten. See Forget and export.
Caution
Secrets you type into a memory file are removed when the file is read in. If an API key ends up in decisions.md, it is replaced with [REDACTED:…] in memory, in the file itself once it is rewritten, and in what the agent sees.
When changes are picked up
Your edits are read in:
- at the start of the next agent session in that project,
- when the agent calls
recallor the memory server starts, - when you run
weavekeep searchin that project, - when you run
weavekeep memory sync.
To apply them right away:
weavekeep memory syncWhen the file and the database both changed, your edits are read first, so they win. Then the file is rewritten from the database, which adds ids to new lines and adds entries saved since.
A very large file (over 256 KB) or a big batch of changes (over 500) is imported in the background instead of during session start, so the session still starts fast.
Commands
| Command | What it does |
|---|---|
weavekeep memory path | Print this project's memory folder |
weavekeep memory sync | Apply your edits now and refresh the files |
weavekeep memory open | Open decisions.md in your editor, then apply the edits |
Each takes --project <path> to work on another project. See CLI commands.