Files
sirmem/README.md
T

2.1 KiB

sirmem

Small CLI for a file-based knowledge-graph memory used by LLM agents. Plain text in, plain text out; the data is Markdown and TSV you can read and diff.

sirmem init --dir ~/memory/data        # default schema.md
export SIRMEM_DIR=~/memory/data
sirmem new sirlaptop machine
sirmem new my-proj project "My Project"
sirmem alias my-proj owner/repo
sirmem link my-proj uses sirlaptop "dev box"
sirmem rel my-proj
sirmem unalias my-proj owner/repo      # remove an alias
sirmem rm sirlaptop --cascade          # delete an entity (and its relations)
sirmem prefs
sirmem lint

Data dir: schema.md (types and verbs), relations.tsv (sorted, one direction), entities/<id>.md (front-matter + body). Run sirmem --help for all commands.

Build: devbox run build, test: devbox run test. See AGENTS.md. rm <id> refuses while the entity has relations (listed); --cascade removes them too and prints each one. A merge tombstone is never removed while relations or other redirects still point to it, and rm refuses to delete an entity that tombstones point to, or one that is the only applies-to target of a preference (it would silently become "everywhere"); the offending preferences/tombstones are listed.

sirmem lint --clean applies structural fixes only and prints each change: removes unreferenced redirect tombstones, relates-to lines whose pair is also linked by a typed verb, and part-of lines implied by a longer part-of chain. sirmem lint --suggest is read-only and prints numbered candidates (superseded, contradicted, duplicate by normalised label/alias, orphan) with a suggested action for an LLM to review with the user. Both flags can be combined (clean first, then lint, then suggest). Extra over the spec: init command; env SIRMEM_MACHINE overrides the detected hostname.

MIT licensed.

Releases

Prebuilt, statically linked binaries for linux x86_64, linux aarch64 and windows x86_64 are attached to each release (sirmem-linux-x86_64, sirmem-linux-aarch64, sirmem-windows-x86_64.exe, plus SHA256SUMS). There is no macOS build for now. They are cross-built with Nix-provided gcc toolchains (devbox run cross-all).