Documentation
Browse documentation

Using memory

Branches and pins

In a git repository, MemIndex records which branch each note was written on, so your next session starts with the work on the branch you are on. You can also pin a note so it opens every session.

At the start of a session the panel opens with the branch you are on, how many notes are tagged on that branch and in the project, and then your recent notes. Notes from the current branch come first, notes from other branches follow, and nothing is hidden. Search ranks the same way. The first time the service starts after an update, earlier notes get a branch from your git reflog where one can be found; the rest stay untagged.

[memindex] recent context · feature/payment · shop · 4:12pm
tagged: 38 on branch · 232 on project · source: startup

📌 Pinned on this branch
#411 ⚖️ Charge in the smallest currency unit [shared]
   ↳ Rounding bugs in v1

Pin a note and every session start shows it first, with an optional one-line reason of up to 200 characters. A pin belongs to the branch you made it on. Once that branch is merged into your default branch (MemIndex checks the git history, so a branch you only cut and never committed to does not count), its pins become project-wide at the next session start, and npx memindex unpromote puts them back. If a pinned branch is deleted, the pin stays in the panel marked [branch gone: <name>].

npx memindex pin 411 --why "Rounding bugs in v1"
npx memindex pin 411 --project-wide
npx memindex unpin 411                  # this branch's pin; add --project-wide or --all for the others

Agents can do the same with the pin_memory and unpin_memory tools. On MemIndex hosting, hooks send the branch with each event and the server ranks search and startup context the same way. Pins are local for now. Set MEMINDEX_SEND_BRANCH_TO_HOSTING to false to keep branch names on your machine, or MEMINDEX_BRANCH_MEMORY_ENABLED to false to turn all of this off.

Next steps