Skip to main content

Cross-project on-disk memory store for AI coding agents (stdlib-only, SQLite/WAL).

Project description

๐Ÿง  mindkeep

Release License Python Tests Platform Zero deps

Crash-safe, per-project long-term memory for AI coding agents. Zero runtime dependencies ยท SQLite + WAL ยท Python โ‰ฅ 3.9 ยท MIT

Give your agents a real memory: facts, ADRs, preferences and session recaps that survive across runs, machines and Ctrl-C. All stored locally in plain SQLite files you can read, back up or git diff.

โœจ Features

  • ๐Ÿ”’ Crash-safe โ€” WAL + 30s flush, survives SIGKILL
  • ๐Ÿ—‚ Per-project isolation โ€” one SQLite file per repo hash
  • ๐ŸŒ Global preferences โ€” user tastes follow you across projects
  • ๐Ÿ›ก Secrets redactor โ€” 11 credential patterns scrubbed by default
  • ๐Ÿชถ stdlib-only core โ€” no deps at runtime, pip stays quiet
  • ๐Ÿ”Œ CLI + Python API โ€” mindkeep show or from mindkeep import MemoryStore
  • ๐Ÿ“ฆ JSON export/import โ€” portable, inspectable, diffable

๐Ÿ” Verify before running

One-line curl | bash / iwr | iex is convenient but executes remote code blindly. For anything production-sensitive, download first, review, then run:

Windows (PowerShell):

iwr https://github.com/AllenS0104/mindkeep/releases/latest/download/install.ps1 -OutFile install.ps1
# open install.ps1 in your editor and review it, then:
.\install.ps1

macOS / Linux:

curl -fsSL https://github.com/AllenS0104/mindkeep/releases/latest/download/install.sh -o install.sh
# open install.sh in your editor and review it, then:
bash install.sh

Every GitHub Release ships a SHA256SUMS file alongside the wheel / sdist / install scripts, so you can pin to a tagged version and verify integrity:

curl -fsSL -o SHA256SUMS https://github.com/AllenS0104/mindkeep/releases/latest/download/SHA256SUMS
sha256sum -c SHA256SUMS --ignore-missing
# PowerShell equivalent
Get-FileHash -Algorithm SHA256 .\install.ps1
# compare the output against the matching line in SHA256SUMS

๐Ÿš€ Quickstart

Option A ยท One-shot install (recommended)

Windows (PowerShell):

iwr https://raw.githubusercontent.com/AllenS0104/mindkeep/main/install.ps1 | iex

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/AllenS0104/mindkeep/main/install.sh | bash

The installer checks Python โ‰ฅ 3.9, installs pipx if missing, adds the scripts dir to your PATH, and runs mindkeep doctor so you know it works.

Option B ยท Manual via pipx

pipx install git+https://github.com/AllenS0104/mindkeep.git

Option C ยท Offline wheel

Grab the .whl from the Releases page:

pip install --user ./mindkeep-0.2.0-py3-none-any.whl

Verify

mindkeep --version
mindkeep doctor

๐ŸŽฌ Real-world scenario

A day in the life of an AI coding agent that doesn't lose its mind on Ctrl-C. Reads use the CLI; writes use the Python one-liner (the CLI is intentionally read-only โ€” agents call the API directly).

# === Session 1 โ€” agent opens a checkout API repo ===
$ cd ~/code/checkout-api
$ mindkeep where
data_dir: ~/.local/share/mindkeep ยท project=7c4e1a9f0b3d

# agent thinking: "before I touch anything, what do I already know?"
$ mindkeep show --kind facts --limit 20
(no rows yet)

# agent thinking: "user just confirmed JWT RS256 over HS256. Persist it."
$ python -c "from mindkeep import MemoryStore; \
    s = MemoryStore.open(); \
    s.add_fact('auth.method: JWT RS256 โ€” rotated quarterly via KMS', tags=['auth','security']); \
    s.add_adr('RS256 over HS256', \
              decision='Use asymmetric JWT signing (RSA-256).', \
              rationale='Downstream services verify without sharing the secret.'); \
    s.close()"

# === ~~~ โšก process killed (laptop sleep / SIGKILL / OOM) ~~~ ===

# === Session 2 โ€” agent reboots, same repo ===
$ cd ~/code/checkout-api
$ mindkeep show --kind facts
content="auth.method: JWT RS256 โ€” rotated quarterly via KMS"  tags=auth,security  2026-04-27T09:42:11Z
# agent thinking: "good, I remember. Continue where I left off."

# === Session 3 โ€” agent switches to a different repo ===
$ cd ~/code/admin-portal
$ mindkeep where
data_dir: ~/.local/share/mindkeep ยท project=2e8b6d04ac17   โ† different ID
$ mindkeep show --kind facts
(no rows yet)   โ† admin-portal has its own memory, untainted by checkout-api

Each repo gets its own SQLite file. Crash, switch context, reboot โ€” your agent's memory follows the project.


๐Ÿค– Plug into your AI agent

Wire mindkeep into whichever agent you use. Two recipes below; the pattern (recall on start, store on decision) is identical for any other tool.

GitHub Copilot CLI

Drop this into ~/.copilot/copilot-instructions.md (or your repo's AGENTS.md):

## Project memory

At session start, load prior decisions for this project:
  mindkeep show --kind facts --limit 20
  mindkeep show --kind adrs  --limit 10

When you make architectural decisions or capture user preferences, persist
them via the Python API (the CLI is intentionally read-only):
  python -c "from mindkeep import MemoryStore; s=MemoryStore.open(); \
             s.add_fact('<short claim about the project>', tags=['<topic>']); s.close()"
  python -c "from mindkeep import MemoryStore; s=MemoryStore.open(); \
             s.add_adr('<short title>', decision='<the decision>', rationale='<why>'); s.close()"

Forget secrets โ€” the redactor handles them, but don't rely on it.

Claude Code

Add the same pattern to ~/.claude/CLAUDE.md (or wrap it as a project skill):

# Project memory

Before answering, check project memory:
  mindkeep show --kind facts --limit 10
  mindkeep show --kind adrs  --limit 10

After confirming a decision with the user, persist it via the Python API:
  python -c "from mindkeep import MemoryStore; s=MemoryStore.open(); \
             s.add_adr('<short title>', decision='<the decision>', rationale='<one-paragraph rationale>'); s.close()"

Full CLI surface and Python API are in docs/USAGE.md.


๐Ÿ“– Documentation

Full docs live in docs/ โ€” start at the portal for role- and task-based navigation.

Guide One-liner
INSTALL 4 ways to install, enterprise & air-gap, doctor diagnostics
USAGE CLI reference + Python API + 8 cookbook recipes
UNINSTALL Backup, removal, PATH restore, compliance exit
FAQ 22 questions across 5 categories
TROUBLESHOOTING 19 symptoms in symptom / cause / diagnose / fix form

See also: ARCHITECTURE.md ยท CHANGELOG.md ยท CONTRIBUTING.md


๐Ÿ“– Usage / ไฝฟ็”จๆ–นๅผ

CLI โ€” ๅ‘ฝไปค่กŒ

Eight subcommands, all --help-friendly:

list      list all known projects
show      show rows for a project  (--kind facts|adrs|preferences|sessions|all)
clear     delete rows from a project
export    dump a project to JSON
import    load a JSON dump into a project
where     print data_dir and current project id
doctor    run environment health checks
upgrade   pull the latest release (pip/pipx auto-detected)

One full example โ€” inspect the current repo's memory:

cd ~/code/my-app
mindkeep where              # โ†’ C:\Users\you\AppData\Roaming\mindkeep ยท project=a1b2c3d4e5f6
mindkeep show --kind facts --limit 5
mindkeep export ./my-app-memory.json

Python API โ€” ็จ‹ๅบๅŒ–่ฐƒ็”จ

from mindkeep import MemoryStore

with MemoryStore.open() as store:          # resolves project from cwd
    store.add_fact("stack: Postgres 15 + FastAPI", tags=["stack"])
    store.add_adr("use RSA-256 for JWT",
                  decision="Sign JWTs with RS256.",
                  rationale="Asymmetric keys let downstream services verify without sharing the secret.")
    store.set_preference("style.quote", "single", scope="user")

    for row in store.list_facts(tag="stack"):
        print(row["value"])

The store auto-flushes every 30 seconds, on close(), and on atexit / SIGTERM. Secrets are redacted before they hit disk.


๐Ÿ— How it works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Your agent process                                         โ”‚
โ”‚                                                             โ”‚
โ”‚   MemoryStore โ”€โ–บ SecretsRedactor โ”€โ–บ SQLite (WAL mode)       โ”‚
โ”‚        โ”‚                                  โ”‚                 โ”‚
โ”‚        โ””โ”€โ”€ flush scheduler (30s) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ–ผ
        <data_dir>/
          โ”œโ”€โ”€ projects/
          โ”‚     โ”œโ”€โ”€ a1b2c3d4e5f6.db      โ† repo A (hashed path)
          โ”‚     โ”œโ”€โ”€ a1b2c3d4e5f6.meta.json
          โ”‚     โ””โ”€โ”€ 9f8e7d6c5b4a.db      โ† repo B
          โ””โ”€โ”€ preferences.db             โ† cross-project user tastes
  • Project ID = first 12 hex chars of sha256(git-remote || abs-path)
  • data_dir = %APPDATA%\mindkeep\ (Windows), ~/Library/Application Support/mindkeep/ (macOS), or $XDG_DATA_HOME/mindkeep/ (Linux). Override with $MINDKEEP_HOME.
  • Crash safety = WAL + synchronous=NORMAL + atomic rename for .meta.json + atexit/SIGTERM flush hooks

See ARCHITECTURE.md for the full contract and ADRs.


โ“ FAQ

The 4 most-asked questions are inline below. For the full 22-question FAQ (getting started, usage, security, internals, troubleshooting) see docs/FAQ.md.

Q: If I Ctrl-C the CLI, do I lose data? A: No. WAL mode flushes on every commit; the 30-second scheduler plus atexit / SIGTERM hooks guarantee durability. SIGKILL is safe too โ€” SQLite replays the WAL on next open.

Q: Is it safe to store prompts and errors in here? A: Yes. SecretsRedactor is on by default and scrubs 11 classes of credentials before write: PEM private keys, JWTs, GitHub PATs (classic + fine-grained), AWS access & secret keys, Google API keys, Slack tokens, OpenAI keys, Azure storage keys, plus a generic password|token|api_key=โ€ฆ sweep. Still โ€” don't store secrets on purpose.

Q: I installed it but mindkeep isn't found. A: Run python -m mindkeep doctor โ€” it prints the exact PATH it expects. Usually it's fixed by opening a new terminal (installers edit PATH for future shells). See docs/TROUBLESHOOTING.md for more.

Q: How do I upgrade / uninstall? A: mindkeep upgrade (auto-detects pipx vs pip). To remove: pipx uninstall mindkeep. Your data in data_dir is not deleted โ€” see docs/UNINSTALL.md for a clean wipe.


๐Ÿ›  Development

git clone https://github.com/AllenS0104/mindkeep.git
cd mindkeep
pip install -e ".[dev]"
pytest

PRs welcome โ€” please run pytest and keep the stdlib-only rule for src/mindkeep/ (dev-deps are fine).


๐Ÿ“œ License

MIT โ€” see LICENSE.

๐Ÿ‘ค Author

Built by Allen Song (@AllenS0104) with help from a fleet of AI sub-agents (architect, coder, ops, PMO, UX inspector โ€” see .github/agents/). The stdlib-only constraint is intentional: a memory layer shouldn't depend on a memory of dependencies.

Issues, ideas, PRs welcome at github.com/AllenS0104/mindkeep/issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mindkeep-0.2.0.tar.gz (51.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mindkeep-0.2.0-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file mindkeep-0.2.0.tar.gz.

File metadata

  • Download URL: mindkeep-0.2.0.tar.gz
  • Upload date:
  • Size: 51.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mindkeep-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ec111e02904bd30b8a128c9eb74edf12eae78b15fb595f4db54803795e5c34f0
MD5 a6cf7130f28cb9124769acd6bc9fb199
BLAKE2b-256 5f1643f725330ff760bc785f692df3f801f88a6d821989c656fab7e422dbf16c

See more details on using hashes here.

File details

Details for the file mindkeep-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mindkeep-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mindkeep-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 829c1c621bf83f4d42420a9f93d073a1dbf0aeb0fc9245da6fc6966bacb64eb1
MD5 7a3c6227476e5b567597e155ef60aab8
BLAKE2b-256 b6f13960de970aa92086fb0c5a43fbc71fae6e812c342d1d6a5985ab8822cfff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page