Local memory for AI agents

Your agent rediscovers the same things every session.
Pinky remembers.

Knowledge in Markdown, versioned in git. Hybrid BM25 + semantic search. 100% local and offline. Agent-native via MCP.

Zero lock-in. You keep the .md files · the index rebuilds itself · $0 per query.

The problem

Agents have no memory. You explain it to them over and over.

Every session, your agent trips over the same gotcha, re-decides what was already decided, re-reads what was already read. Pinky gives it durable, auditable memory — without sending your code anywhere.

Source of truth

The .md files with frontmatter that the agent (or you) writes. Readable, versioned in git, reviewable with git diff. It’s yours and it stays with you.

↓ pinky reindex

Disposable cache

A SQLite index (FTS5 + sqlite-vec) derived from the Markdown. If it corrupts or the model changes, it rebuilds itself. Nothing critical lives only here.

↑ 100% regenerable

Why Pinky

Four things almost nobody combines at once.

Local and offline, hybrid, markdown-as-truth, and agent-native. The others have one or two.

01

100% local and offline

Local ONNX embeddings, or a deterministic embedder with no network. In-process SQLite, zero daemon. Ideal for sensitive or regulated code that can’t leave the machine.

--hash-embed → no network, ever
02

Real hybrid retrieval

BM25 finds the exact match (pg_pool_timeout); the vector finds the similar ("the pool hangs"). Fused with Reciprocal Rank Fusion.

measurable quality: hit@k + MRR
03

Markdown = source of truth

The index is cache; the .md files are the truth. Zero lock-in: you keep readable files. Audit what your agent learned with a git diff.

reindex rebuilds everything
04

Agent-native

Standard MCP server with 7 tools (brain_search, brain_save, brain_update…). Plus Claude Code hooks. Not an app — infrastructure.

any MCP client · the CLI works alone
05

Stays healthy

Semantic dedup, staleness decay, code↔knowledge backlinks, pruning telemetry, and an evergreen validator. Fights entropy; not a dumping ground.

pinky dedup · stale · telemetry
06

Zero-ops, one binary

No mandatory Docker, no services, no database to manage. One disposable brain.db file and three small Rust binaries.

curl | sh → running in <2 min
The knowledge loop

Create → index → search → maintain.

The agent searches before acting, saves what it discovers, and leaves a diary when done. Knowledge grows on its own as you work.

CREATE

A .md is born

The agent (guided by a rule), the stop hook, or you. YAML frontmatter + Markdown body.

INDEX

reindex

Parse → chunk → embed → SQLite. Incremental: only re-embeds what changed.

SEARCH

brain_search

Hybrid BM25 + vector, RRF fusion, optional lexical rerank, filters by project/type/tag.

MAINTAIN

healthy

Dedup, staleness, diary rollups, pruning telemetry, quality eval.

One index, three entry points

For you, for the agent, and for Claude Code.

pinky

CLI

  • reindex
  • search
  • save
  • dedup
  • review
  • stale
  • rollup
  • backlinks
  • eval
  • stats
  • snapshot
  • doctor
  • watch
  • sync

Full CLI reference →

pinky-mcp

MCP server

  • brain_search
  • brain_save
  • brain_update
  • brain_delete
  • brain_feedback
  • brain_similar
  • brain_stats

The agent’s memory. Registered in Claude Code (or any MCP client) with pinky init.

Tools, arguments and how to connect it →

pinky-hooks

Claude Code hooks

  • session-start
  • pre-read
  • pre-write
  • stop → diary

They inject context before read/write and write a diary when done. Time-budgeted: they never block.

More than a search box

A memory that maintains itself.

It doesn’t just save and search: it understands time, learns what’s useful, and protects its own quality.

Knowledge with a timeline

Mark what supersedes what (supersedes) and ask "what did we know on that date?" with search --as-of. The old stops confusing you, but stays auditable.

Learns what’s useful without being asked

The stop hook correlates which entries the agent actually re-read and marks them useful. pinky stats --value shows you what the brain is giving you.

Obsidian-style knowledge graph

It understands your notes’ [[wikilinks]]: search --links promotes what’s linked to the top results. A graph’s value without dragging in a graph DB.

Sync the brain across machines

pinky sync versions the knowledge in git and auto-resolves diary and frontmatter conflicts. Your team shares the same memory.

7 tools for the agent to maintain itself

Not just brain_search and brain_save: also brain_update, brain_delete, brain_feedback, and brain_similar. The agent curates its own memory.

Quality measured and protected in CI

The eval harness reports hit@k, MRR, and nDCG over a golden set; CI fails the build if relevance drops. It never degrades silently.

Where it fits

Pinky vs. the alternatives.

Pinky Platform memory Vector-DB SaaS grep + notes
Local / offlineYesNoNoYes
Hybrid BM25 + vectorYesNopartialNo
Portable Markdown (no lock-in)YesNoNoYes
Agent-native (MCP)YespartialNoNo
Zero-ops (one binary)YesYesNoYes
Cost per query$0included💲$0

Pinky is the only one combining local + offline, hybrid, markdown-as-truth, and agent-native at the same time.

Token economics · measured

Up to ~34× fewer tokens per query.

Context tokens pulled in per knowledge query, same scenario, measured on a real 16-doc corpus (~59 KB).

No memory re-reads the code to rediscover~17.200 tok 45×
Plain Markdown grep + read the matching files~12.900 tok 34×
Pinky brain_search top-3, ranked snippets~380 tok

Measured with the pinky binary: brain_search --json payload vs. grep + read the files vs. re-reading the code (tokens ≈ chars/4). It’s the retrieval payload; on larger corpora the gap widens.

Performance · measured

Fast and lightweight. Real numbers, not marketing.

One Rust binary, no runtime, no daemon. Everything below is measured and reproducible with pinky bench and pinky eval on your machine.

21,5 MBOne binary
Rust, no runtime
8,7 msSearch p95
engine, 1k entries
0,962nDCG
measured quality
~13 MBRAM
lexical path
$0Per query
100% offline
0Deps
no Docker or Python
Entries Indexing DB size Search p50 Search p95
1.0000,4 s10 MB8,1 ms8,7 ms
10.0004,8 s104 MB49,4 ms52,7 ms
100.00056,6 s1,03 GB470,9 ms494,6 ms

The real case of a personal or team brain (1k–10k entries) has plenty of headroom: p95 < 55 ms end to end. At 100k the brute-force KNN is around ½ s — usable, with binary quantization on the roadmap (justified ≥ 50k). Latency and quality measured with the deterministic embedder (pure engine); the ONNX semantic model is optional —downloaded once— or run with --hash-embed and no model. MacBook Apple Silicon, release build.

More than token savings

What you gain, not just what you save.

Your agent stops repeating the same bugs

Gotchas are injected before it writes code. Fewer re-committed mistakes — not just fewer tokens.

You stop re-explaining the same things every session

Knowledge persists and accumulates; a new dev or agent starts out knowing what the team already learned.

Your code never leaves your machine

100% local and offline: it unlocks sensitive or regulated projects a SaaS couldn’t touch. $0 per query.

You audit what your agent learned

Markdown versioned in git: review it with a git diff in a PR. Zero lock-in — you keep the files.

Knowledge doesn’t rot

Dedup, staleness decay, and pruning telemetry; the CI eval fails the build if relevance drops.

Zero-ops, and it never gets in the way

One binary, no daemon; pinky init in one command; the hooks are time-budgeted and never block your agent.

Production-ready

Verifiable trust, not promises.

Signed, reproducible, auditable, and tested offline. What a regulated team reviews before adopting a tool.

01

Index encryption at rest

Opt-in feature with SQLCipher (AES-256, page-level): the brain.db is encrypted. The key travels via the environment; opening with the wrong one fails cleanly, never corrupts.

encrypted-index · PINKY_INDEX_KEY
02

Verifiable backup

An agent with write access can destroy months of knowledge. snapshot makes a tar.gz + SHA-256 manifest; restore verifies every checksum before writing a byte.

pinky snapshot · restore
03

Signed, reproducible releases

Binaries signed with minisign + mandatory SHA-256 checksum. Bit-for-bit reproducible builds (pinned toolchain) and a CycloneDX SBOM per release.

minisign · SBOM · reproducible
04

Air-gap verified, not promised

pinky doctor --airgap fails if anything would need the network. And a CI job runs index + search inside an isolated network namespace: the claim is proven on every push.

pinky doctor --airgap
05

No version surprises

The .md files are the stable interface; the index is disposable. An old binary over a newer index fails clearly instead of operating silently.

docs/VERSIONING.md
06

Audited supply chain

cargo-deny in CI (RUSTSEC advisories + licenses + sources), GitHub Actions pinned by commit hash, and publish = false so nothing leaks to crates.io.

cargo deny check
Who it’s for

When knowledge can’t leave your network.

Regulated code

Fintech · health · defense · government

Airgapped or on-prem: embeddings run locally and nothing leaves the machine. The agent’s memory complies without exfiltrating code.

Years-long projects

Solo devs and small teams

The agent inherits accumulated gotchas, decisions, and patterns. Instant onboarding: a new dev (or agent) starts out knowing what the team already learned.

Living diary

A changelog that writes itself

The stop hook leaves a diary entry per session; rollups build the weekly/monthly summary with no LLM.

Truly multilingual

Spanish + Italian

The multilingual-e5-small model covers ES and IT: search in one language, find what was written in another.

Quickstart

From zero to memory in four commands.

Linux x86_64 and macOS Apple Silicon have prebuilt binaries. Other platforms: build from source.

curl -fsSL https://releases.pinkybrain.dev/install.sh | sh
# 1 · set up the project: creates documentation/ and registers the MCP
pinky init

# 2 · index the knowledge (hybrid search, multilingual model)
pinky reindex documentation

# 3 · search — or let the agent use the brain_search tool
pinky search "timeout closing the postgres pool"

# 4 · reopen the project in Claude Code → the 'pinky' MCP is available

Already have it? Update with pinky update (verified download from the CDN).

All installation options (manual download, Docker, source) →

Honest objections

What you’re surely wondering.

Aren’t local embeddings worse than OpenAI’s?

For retrieval, the hybrid BM25 + vector closes the gap: BM25 nails exact terms and the vector handles semantics. And quality is measurable — the eval harness reports hit@k and MRR, and CI fails the build on a relevance regression.

What if the database gets corrupted?

The index is disposable: pinky reindex rebuilds it entirely from the .md files. Plus there are schema- and embedding-model version guards: if something doesn’t line up, it warns and regenerates — it never corrupts silently.

Does it only work with Claude Code?

The core is agnostic and MCP is an open standard: it works with any MCP client, and the CLI works on its own. The hooks, though, are Claude Code-specific today.

Is it really offline? You mention a model that downloads.

The ONNX model (~450 MB, optional) downloads once, then everything runs offline. If you want zero-network and zero-model from minute one, use --hash-embed: a deterministic embedder that never touches the network and runs in ~13 MB of RAM (a bit less precise, ideal for airgapped/CI).

Does it scale to a large multi-year project?

Measured and reproducible (pinky bench): at 10,000 entries the full hybrid search is ~50 ms (p95); at 1,000, ~9 ms. The bottleneck isn’t volume: it’s organization and retrieval, which is exactly what Pinky solves.

Is the setup complicated?

curl | sh installs the binaries; pinky init leaves the project ready with the MCP registered using relative (relocatable) paths. No baked-in absolute paths, no touching code.