openthink / home · think team stamp ui-leaf audit @openthink/think · MIT
v0.0.0 think · MIT
[M]AIN
v0.0.0 · open source · MIT

memory for your
AI brain.

Local-first nervous system for AI agents. Engrams in, curated memories out, all in a folder you control.

$npm install -g @openthink/think
requires Node 22.5+ · works with Claude Code out of the box
v3 alpha vector recall · write-time compaction · resident daemon npm install -g @openthink/think@alpha

// one brain, many machines

your laptop — ship a feature, log it
$ think cortex setup --fs ~/Dropbox/think-cortex
Cortex folder: ~/Dropbox/think-cortex
$ think sync "rewrote auth middleware — AES-256-GCM for all session tokens"
[personal] engram saved
$ think sync "fixed race condition in token refresh — concurrent 401s resolved"
[personal] engram saved
$ think curate
2 evaluated, 2 promoted, 0 purged, 0 still pending
your workstation — same folder, synced by Dropbox
$ think recall "auth"
Memories:
Auth middleware was rewritten to use AES-256-GCM encryption for session
tokens. A race condition in the refresh flow was causing concurrent 401s
— fixed by serializing token rotation.
your agent on the workstation picks up where you left off
> Refactor the session middleware
 
! Before I refactor, I should note: I rewrote the auth middleware
on my laptop yesterday with AES-256-GCM and fixed a token refresh
race condition. Let me build on that rather than duplicate it.

// the moment it clicks

you ask your agent to build something
> Build a quick prototype for the new settings page
the agent recalls context and changes course
$ think recall "prototyping"
Memories:
Team retro flagged prototype ambiguity as a top issue — a previous
prototype became a de facto spec with no scope annotations. Action
item: define prototype levels and bring them to engineers earlier.
 
! Before I start, let me pin down the scope. A past retro called
out "quick prototypes" as exactly the shape that caused trouble.

An agent with memory doesn't duplicate work, doesn't contradict decisions, and doesn't repeat mistakes you've already learned from.

// get started

Jump to install to set it up in 2 minutes, or read the concepts to understand the full pipeline.

// concepts

Engrams are physical traces of thoughts.
Memories are the ones worth keeping.
Cortex is the workspace they live in.
Recall plugs you back into them on demand.

[01]

engrams

Physical traces of thoughts — raw work events. Every think sync creates an engram. Stored locally in SQLite. Engrams never leave your machine; they're the substrate the curator reads from.

$ think sync "shipped auth refactor"
[personal] engram saved
[02]

memories

Curated engrams — the ones worth recalling later. The curator reads engrams, weighs them against what's already known, promotes what matters, and drops the rest. Memories are what your future self (or your future agent) actually pulls back.

$ think curate
Evaluating 12 engrams...
12 evaluated, 3 promoted, 9 dropped
[03]

cortex

The workspace your engrams and memories live in. Each cortex is a named scope — personal, work, a team-shared one — with its own SQLite database and its own folder of memories. You can have several and switch between them; the active cortex is where new engrams land.

$ think cortex create personal
Created cortex: personal
$ think cortex switch work
Active cortex: work
[04]

recall

Access your memories on demand — plugs you back into what you saved across past sessions. Searches across memories and local engrams; reads hit local SQLite, so it's instant and offline.

$ think recall "auth"
Memories:
→ Auth refactor shipped — AES-256-GCM tokens...

// v3 alpha — what's new

Three architectural upgrades in @openthink/think@alpha that change the read and write paths.

[v3.1]

vector recall

Recall now runs semantic similarity over a resident bge-small-en-v1.5 embedding model — right entries come back even when the query vocabulary doesn't overlap with stored text. BM25 keyword matching still runs in parallel; results are fused. No external API call; the model is local.

$ think recall "token expiry edge case"
Memories:
→ Auth refactor: AES-256-GCM for session tokens — race condition...
[v3.2]

write-time compaction

The daemon folds each new engram into a single self-contained memory line via an LLM call at write time. No batch curation step required. The result: think recall hits local storage only — sub-100 ms reads, no model call at recall time.

$ think sync "fixed flaky CI timeout in integration tests"
engram saved → compacted in background
[v3.3]

resident daemon

A background daemon keeps the embedding model warm in memory. CLI calls communicate over a Unix socket — no cold-start penalty per recall. The daemon starts on first use and stays resident; think daemon status shows its state.

$ think daemon status
daemon running · model loaded · socket: ~/.think/daemon.sock
[v3.4]

agent integration

A UserPromptSubmit Claude Code hook and an MCP server both talk to the same daemon. Agents get semantic recall injected at prompt-submit time with no cold-start; the MCP surface exposes the same capabilities to any MCP-compatible client.

$ think init --v3
hook + MCP server registered in CLAUDE.md

// architecture

Three tiers of memory, each with a clear job. Engrams capture the moment. Memories distill what matters. Library is the long-term archive for memories you've outgrown but want to keep findable.

+- engrams ----------------+      +- memories ---------------+      +- library ----------------+
|                          |      |                          |      |                          |
|  raw work events         | ───>|  curated memories        | ───>|  offloaded memories      |
|  in SQLite               |      |  as .jsonl files          |      |  for long-term storage   |
|                          |      |                          |      |  and recall              |
|  ~/.think/engrams/       |      |  in your cortex folder,  |      |                          |
|     <cortex>.db          |      |  synced via iCloud /     |      |  forthcoming — the third  |
|                          |      |  Dropbox / Syncthing /   |      |  tier of long-term recall   |
|                          |      |  Drive / any folder      |      |                          |
+--------------------------+      +--------------------------+      +--------------------------+

Local-first by design. All reads and writes go to local SQLite. Engrams never leave the machine — only curated memories propagate, via a folder you already sync. No server, no relay; the folder is the propagation layer.

// install

Two minutes from zero to persistent agent memory.

  1. Install & initialize

    $npm install -g @openthink/think
    $think init

    Requires Node 22.5+. think init writes 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.

    v3 alpha Try the alpha: vector recall, daemon, MCP server
    $npm install -g @openthink/think@alpha

    v3 reads v2 storage. First launch reindexes existing memories into the vector store automatically — no manual migration step.

  2. Point cortex at a folder

    $think cortex setup --fs ~/Dropbox/think-cortex
    $think cortex create personal

    A cortex is your AI's memory workspace. Pass --fs a 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 --fs for offline-only.

    Already on a git-backed setup? think cortex setup <git-remote-url> is still supported and existing setups keep working unchanged — --fs is just the recommended path for new ones.

  3. You're done

    $think sync "shipped the feature"
    $think curate
    $think recall "what did I ship?"

    Agents log work with think sync. Curation promotes the important stuff to memories. Recall pulls them back next session. think cortex sync writes 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>           Log a work event
think sync -e <key> <msg>     Log an episode-tagged event
think log <message>            Log a note (--category, --tags)
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 remote
think cortex pull              Pull remote memories to local
think cortex sync              Push + pull
think cortex status            Show sync state

think curate                   Run curation (--dry-run to preview)
think curate --episode <key>   Curate episode into narrative memory
think curate --consolidate     Compress older memories into summary
think monitor                  Show promoted vs dropped engrams
think recall <query>           Search memories + engrams
think memory                   Show memories (--history for timeline)
think pull <cortex>            Read memories from another cortex

think curator edit             Edit personal curator guidance
think curator show             Show current guidance
think pause                    Suppress engram creation
think resume                   Re-enable engram creation

think migrate-data             Import git memories into local SQLite
think init                     Set up CLAUDE.md for auto-logging
think export                   Export entries as sync bundle
think import <file>            Import sync bundle
think audit                    Show sync audit log
think config show              Print configuration
think config set <key> <val>   Update a config value
think update                   Update to latest version

// where things live

think · ready
↑↓nav select ggithub iinstall ?help