continuous alignment
for agentic systems.
Before an agent acts, it thinks about your system. It recalls what's been decided, done, and learned across every session and machine you run. The think cli allows you to log retrospectives for codebase footguns and gotchas so your agents quit falling for them. Alignment at runtime is a context problem — and think provides injectable context through intelligent vector recall.
// one mind, many workers
// alignment, in practice
"Merge the PR" meant stamp-gated merge — and the agent knew, because another session already learned it. An aligned agent does what you meant, not just what you typed: it doesn't contradict settled decisions, doesn't repeat a mistake another agent already made, and never needs the same correction twice.
// get started
Jump to install to set it up in 2 minutes, or read the concepts to understand the full pipeline.
// concepts
Memories are written when meaningful pieces of work are completed.
Retros capture what the agent would do different next time.
Cortex is a workspace that those memories and retros live in.
Recall injects memories and retros into a fresh agent.
memories
The primary write. Every think sync stores a memory directly to a local file. A background LLM folds each new entry into a single self-contained summary (write-time compaction), so every memory stands on its own and reads stay fast.
retros
What an agent would do different next time, recorded where the next agent will find it. think retro captures a footgun, gotcha, or convention scoped to a codebase; think brief surfaces them at task start for whoever works there next — you, or an agent that has never run there before.
cortex
The workspace your memories and retros live in. Each cortex is a named scope — personal, work — with its own local database and its own folder of JSONL files that propagates memories between your machines. You can have several and switch between them; the active cortex is where new writes land.
recall
The read path. think recall pulls the memories and retros relevant to the task at hand — and agents don't have to ask: a UserPromptSubmit hook injects context at prompt-submit, and an MCP server gives any agent mid-turn recall. Reads are pure local lookups: sub-100 ms, offline, no model call.
vector embedding
Why recall finds the right thing. Every entry is embedded with a local bge-small-en-v1.5 model and searched by semantic similarity, fused with BM25 keyword matching — the right memories come back even when the query shares no vocabulary with the stored text. A resident daemon keeps the model warm, and embeddings never leave your machine.
cloud
How one mind spans machines. Point your cortex at any folder you already sync (iCloud, Dropbox, Syncthing) and memories propagate on their own — or sync through a hub: self-host one against the open wire protocol, or use think cloud, the managed hub (coming soon). Local is the source of truth either way.
// architecture
Three stages, each with a clear job. Writes go through the daemon and get compacted. The local store answers every read. The cortex folder carries memories to your other machines.
+- write ------------------+ +- local store ------------+ +- propagation ------------+ | | | | | | | think sync | ───>| memories + events + | ───>| memories as .jsonl | | → daemon (socket) | | vector index, all in | | in your cortex folder, | | → compaction (LLM) | | one SQLite file | | synced via iCloud / | | | | | | Dropbox / Syncthing / | | | | ~/.think/index/ | | Drive / any folder | | | | <cortex>.db | | | +--------------------------+ +--------------------------+ +--------------------------+
Local-first by design. All reads and writes go to local SQLite. Pending events never leave the machine — only memories land in the cortex folder and propagate across machines. No server, no relay; the folder is the propagation layer.
// install
Two minutes from zero to persistent agent memory.
-
Install & initialize
$npm install -g @openthink/think$think initRequires Node 22.5+.
think initwrites auto-logging instructions into your project's CLAUDE.md — your agents start logging work immediately. The curator and summary features use the Claude Agent SDK and require a Claude subscription.Upgrading from v2? v3 reads v2 storage. First launch reindexes existing memories into the vector store automatically — no manual migration step.
-
Point cortex at a folder
$think cortex setup --fs ~/Dropbox/think-cortex$think cortex create personalA cortex is your AI's memory workspace. Pass
--fsa path inside any sync tool you already use (iCloud, Dropbox, Google Drive, Syncthing) and the same memories will land on every machine you own. The folder is created if it doesn't exist. Skip--fsfor offline-only.Already on a git-backed setup?
think cortex setup <git-remote-url>is still supported and existing setups keep working unchanged —--fsis just the recommended path for new ones. -
You're done
$think sync "shipped the feature"$think recall "what did I ship?"Agents log work with
think sync— each entry is stored as a memory immediately, no curation step needed. Recall pulls it back next session.think cortex syncwrites memories out to the folder so your other machines can pick them up.
// docs
Reference, source, and where to find help.
// all commands
think sync <message> Record a memory (-e <key> to tag an episode) think recall <query> Search memories (semantic + keyword) think memory Show memories (--history for timeline) think list List entries (--week, --since, --category) think summary AI summary (--raw for plain text) think delete Soft-delete entries think cortex setup [--fs <path> | <repo>] Configure backend (or no args for offline) think cortex create <name> Create a cortex think cortex list Show all cortexes think cortex switch <name> Set active cortex think cortex current Show active cortex think cortex push Push local memories to the folder think cortex pull Pull memories from the folder think cortex sync Push + pull think cortex status Show sync state think retro <content> Record a durable repo-scoped lesson think brief [query] Task-start brief: context + repo retros think event <message> Record a long-term event (deploy, decision, milestone) think long-term Manage long-term memory events think dashboard Status dashboard with an AI prompt box think pull <cortex> Read memories from another cortex think daemon Manage the resident daemon (start/stop/status) think reindex [cortex] Rebuild the vector index from the raw log think hook Manage the Claude Code hook (install/uninstall) think mcp Manage the MCP server (install/uninstall) think curate Promote pending events into memories (--dry-run) think curate --episode <key> Curate an episode into a narrative memory think curate --consolidate Compress older memories into a summary think monitor Show what got promoted vs dropped think curator edit / show Personal curator guidance think pause / resume Suppress / re-enable writes think init Set up CLAUDE.md for auto-logging think migrate-data One-time import of git memories into SQLite think log <message> Log a pending event (deprecated — use sync) think serve Boot the proxy for external event sources think subscribe Manage external-source subscriptions think export / import Sync bundles between devices think audit Show sync audit log think config show / set View or update configuration think update Update to latest version
// links
- githubgithub.com/OpenThinkAi/think-cli
- npmnpmjs.com/package/@openthink/think
- v3 designgithub.com/OpenThinkAi/think-cli/blob/main/docs/think-v3.md
- issuesgithub.com/OpenThinkAi/think-cli/issues
- licenseMIT
// where things live
- ~/.think/data directory (override with
$THINK_HOME) - index/<cortex>.dbper-cortex SQLite (memories, events, vector index, sync state)
- daemon.sockUnix socket the CLI uses to talk to the resident daemon
- curator.mdpersonal curator guidance
- cortex folderJSONL files for synced memories (path you set with
--fs) - ~/.config/think/config.json