Skip to content

Repository files navigation

Rin

Rin

Memory system for AI agents. A single 126 MB rin.exe that lets any AI — Claude Code, Cursor, or anything else — read and write persistent project memory. New sessions pick up where the last one left off, no re-explaining required.

English · 简体中文


License Version Platform Tests

Zero-dependency single file · git-based storage · agent-agnostic


✨ Highlights

🧠 Persistent memory rin remember captures project experience; the next session just runs rin list / rin read / rin search and continues right where you stopped.
🔄 Switch agents painlessly Memory lives in a storage layer independent of any agent software. Run out of quota or switch tools? A new agent runs rin status + rin read handoff/xxx and picks up seamlessly (the handoff memo mechanism exists exactly for this).
🤝 Multi-agent sharing Every AI in a project shares one memory pool — no duplicated work.
🔒 Privacy isolation The memory store is forcibly separated from your code repo. Pushing code to GitHub never leaks memory.
📦 Zero dependency A single file with the Node runtime and git embedded — copy it anywhere and run. New-session AIs self-onboard with rin guide.
🪓 Built-in code management Ships a full git (rin git ...) for versioning code when needed.

The storage format and path conventions are fully shared with the harness memory integration (<cwd>/.dsh-memory + ~/.dsh/memory); the harness keeps its smart front-end, this repo is the independent storage core.

🚀 Quick start

The intended way — hand the exe to your AI agent

Rin is built for agents, not for humans typing commands. Copy the exe path into your agent's prompt (Claude Code, Cursor, or any agent that can run commands), and the agent reads the exe itself:

Your memory tool is at D:\path\to\rin.exe. Use it to save and read project memory across sessions: run rin.exe guide first to learn the commands, then rin.exe remember <id> -t <title> --content <text> to save what we learn, and rin.exe list / rin.exe read <id> in future sessions to pick up where we left off.

The agent will run rin.exe guide (the embedded handbook) to self-onboard, then use rin remember / rin list / rin read / rin search on its own — no manual setup, no new-session briefing needed.

Pro tip: drop rin.exe somewhere stable (e.g. C:\Tools\rin.exe) and reference that fixed path from your agent's project instructions (AGENTS.md), so every agent session uses the same memory pool.

Option A — download the single-file exe

  1. Grab rin.exe from the latest release.
  2. Put it somewhere stable and hand that path to your agent (see above). To sanity-check it yourself: rin.exe --versionrin.exe guide.

Option B — from source (Node ≥ 24)

npm install
npm run build:sea        # builds rin-dist/rin.exe (SEA single file)
rin <command>            # or: node src/cli.ts <command>

📖 Command reference

Command Purpose
rin remember <id> -t <title> --content <text> Save a memory node
rin read <id> / rin list / rin search <q> Retrieve memory (--json supported)
rin timeline <id> / rin log History of a node / the whole store
rin diff <id> <revA> <revB> / rin revert <id> --to <rev> Inspect / roll back revisions
rin branch / rin checkout / rin merge / rin archive / rin remove Store management
rin init Init memory + code repo + privacy isolation + AGENTS.md in one step
rin status Memory overview (self-guiding for new agents)
rin git ... Pass-through to the embedded git for code version control
rin script add/list/show/run/rm/refresh Manage test/tool scripts as memory nodes
rin guide / rin help / rin --version Handbook / usage / version

Output contract: success → data on stdout, exit 0; failure → error on stderr, non-zero exit (--json mode prints {"error": ...}). No crash-stack leaks.

🏗️ Project layout

Rin/
├── LICENSE                 # GPL-3.0-or-later
├── THIRD-PARTY-NOTICES.md  # license notices for embedded/build deps
├── src/                    # source (cli, memory-service, git-backend, …)
├── tests/                  # node --test suite (70 passing)
├── scripts/                # build script + concurrency stress test
├── docs/                   # AGENT-GUIDE.md (embedded into the exe) + interop test pack
├── rin-dist/               # the one deliverable: rin.exe (126 MB single file)
├── dist/                   # build artifacts (generated, don't touch)
├── .cache/                 # MinGit cache for builds (drop MinGit-*-64-bit.zip here)
└── .dsh-memory/            # this project's workspace memory store (own git repo)

🔧 Building

npm install
npm test              # unit tests (real git smoke)
npm run build:sea     # builds rin-dist/rin.exe

build:sea resolves the embedded git source in this priority order:

  1. An official MinGit zip in .cache/ (MinGit-*-64-bit.zip, from the Git for Windows site)
  2. A Git for Windows install pointed to by RIN_GIT_ROOT
  3. Auto-detected from git on PATH

If none is found the embed is skipped and the exe falls back to git on PATH.

🧪 Tests & roadmap

  • 70 tests, all green: GitBackend, MemoryService, CLI end-to-end — real git throughout.
  • Roadmap: ✅ decoupled GitBackend · ✅ MemoryService core · ✅ rin CLI · ✅ SEA single-file distribution · ⬜ npm publish (as rin-cli) · ⬜ harness core dedup.

📄 License

GNU General Public License v3.0 or later — see LICENSE. Third-party component licenses (embedded Node.js, MinGit, build deps) are in THIRD-PARTY-NOTICES.

About

Memory system for AI agents - a single-file CLI (Node SEA, embedded git) with git-based storage, agent-agnostic

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages