🧠 Asaki Memory Manager
A Cloudflare-native long-term memory layer for AI agents.
Give your coding agents durable memory — preferences, project conventions, decisions, bug fixes, and workflows — without a Docker stack or an external vector database. Just Workers, D1, and Vectorize.

Quick start · Architecture · Integrations · API · Configuration · Security
Why
AI coding agents are far more useful when they remember. But most memory stacks mean standing up a vector DB, a queue, and a service to babysit. Asaki Memory Manager is a single-operator, self-hosted alternative that runs entirely on your Cloudflare account: the Worker is the API, D1 is the source of truth, and Vectorize is a recoverable semantic index. No servers to run, no data leaving your account.
Single-operator by design — this is a personal memory layer, not a multi-tenant/team product. Every query is scoped to one user_id.
Features
- Cloudflare-native — Workers + D1 + Vectorize + Workers AI. Nothing else to host.
- REST-first, MCP-ready — a small HTTP API, plus the same tool surface served over remote MCP straight from the Worker.
- Scoped memory —
global / project / session with strict project & session isolation.
- Hybrid retrieval — Vectorize semantic search fused with a D1 lexical fallback, so search still works when AI/Vectorize are down.
- Classifier-first capture — agents submit pre-distilled candidates directly; local background classifiers queue unsupervised candidates for human review. Server-side raw-text extraction is deprecated compatibility only.
- Human-in-the-loop — unsupervised background classifiers never auto-write; their candidates land in a review queue you approve via a
/memory audit.
- Deterministic dedup guards — exact, subset, and technical-token paraphrase checks run before any LLM decision.
- Self-improving — classifier regression eval turns audit misses into permanent few-shot cases; the extraction eval remains only for the deprecated compatibility path.
- First-class agent integrations — a Claude Code plugin, a Pi extension, and a stdio MCP server for Codex.
Architecture
flowchart TD
A["AI Agent · App · Pi · Claude Code"] -->|"REST / MCP (bearer auth)"| W["Cloudflare Worker<br/>Hono router + auth + rate limit"]
W --> AI["Workers AI<br/>bge-m3 embeddings · LLM merge/ignore decisions"]
W --> D1[("D1<br/>source of truth<br/>memories · events · reviews")]
W --> V[("Vectorize<br/>semantic index + metadata filters")]
V -. "rebuildable from D1<br/>(index_status=pending on failure)" .-> D1
D1 is the source of truth; Vectorize is an index. If a vector upsert fails, the memory is still stored and marked index_status=pending for later backfill — no write is ever lost to an indexing hiccup.
Quick start
Prerequisites
- A Cloudflare account with Workers, D1, Vectorize, and Workers AI enabled
- Node.js 20+ and the
wrangler CLI (installed via npm install)
# 1. Install
npm install
# 2. Create Cloudflare resources
npx wrangler login
npx wrangler d1 create asaki-memory-manager
npx wrangler vectorize create asaki-memory-manager --dimensions 1024 --metric cosine
for p in user_id scope project_id session_id kind; do
npx wrangler vectorize create-metadata-index asaki-memory-manager --propertyName "$p" --type string
done
# 3. Configure Wrangler (then set your D1 database_id in wrangler.jsonc)
cp wrangler.example.jsonc wrangler.jsonc
# 4. Apply migrations
npm run db:migrate:local
npm run db:migrate:remote
# 5. Set the required API auth secret
npx wrangler secret put ADMIN_API_KEY
# 6. Run locally
npm run dev
curl http://127.0.0.1:8787/health
# 7. Deploy
npm run deploy
wrangler.jsonc is gitignored — only wrangler.example.jsonc is tracked. Never commit your real config.
Integrations
Claude Code
Distributed as a self-contained plugin — no manual settings.json hook/MCP editing, no absolute paths (everything resolves via ${CLAUDE_PLUGIN_ROOT}), and the MCP tools come from the remote Worker endpoint, so there's no local process or repo checkout to maintain.
claude plugin marketplace add Asaki14/asaki-memory-manager
claude plugin install asaki-memory@asaki-memory
Set your credentials once in ~/.claude/settings.json: