Local-first agent-session corpus

Mine your
agent sessions.

Agentmine is long-term memory for your AI coding agents. It turns your local Claude Code, Cursor, Codex, Gemini CLI, Qwen Code, Cline, Kilo Code, Goose, and OpenCode sessions into one searchable SQLite corpus — resume prior work, recall how you solved something before, and reconstruct what a past session did.

$ npm i -g agentmine

Requires Node 24+ · MIT licensed · no native build

agentmine — similar
$ agentmine similar "auth redirect loop" 
{
  "version": 1,
  "status": "success",
  "command": "agentmine similar",
  "data": {
    "mode": "fts",
    "rows": [{
      "session_id": "demo--auth-redirect",
      "reconstruct_command": "agentmine session demo--auth-redirect --md"
    }]
  },
                "traceId": "00000000-0000-7000-8000-000000000001",
  "_meta": { "duration_ms": 18 }
}

Queries

Ask your history anything

Every question is one command with a JSON envelope on stdout. Here are six you'll reach for.

What was I working on — can I pick up where I left off?

$ agentmine sessions --root-only --since 1d

The recent sessions in this project, newest first — reopen one and continue with context.

Have I solved a task like this before?

$ agentmine similar "auth redirect loop"

Full-text by default; hybrid semantic search after you build a local index.

What did that past session actually do?

$ agentmine session <id> --turn-range 1:20

Replay a prior session's messages and tool calls as JSON or markdown.

When did I change this — and in which session?

$ agentmine fts "checkout redirect"

Full-text search across every session to trace a change or decision back to its source.

Which commands keep failing?

$ agentmine top commands --failed

Ranked shell failures, so you can fix the recurring ones.

Which skills actually get used?

$ agentmine top skills

Adoption of the reusable instructions you've set up.

Pipeline

Four steps, all local

For file-based sources, agentmine ingest runs steps 1–3. OpenCode, Kilo Code, and Goose start at normalize; the quick start lists each command. No LLM is called in the default path, and every step is safe to rerun.

  1. 01

    Mirror your transcripts sync

    Copies file-based transcript stores into Agentmine's data directory. Nothing leaves your machine.

  2. 02

    Parse to one schema normalize

    Turns file or live SQLite source data into canonical sessions, messages, and tool calls — skipping anything unchanged by content hash.

  3. 03

    Build the fact tables extract

    Rebuilds derived tables — files touched, shell commands, tool errors, corrections, skills — in transactions.

  4. 04

    Ask your history query

    Browse with stats, top, fts, similar, and workflows — every command already emits JSON for agents.

Principles

Private by default. Made for agents.

Local-first & private

  • Reads local stores, writes local SQLite under your data directory.
  • Redacts high-confidence secrets before storing searchable text.
  • No LLM call in the default sync → normalize → extract path.
  • Optional local embeddings via Ollama — semantic search that never leaves the box.

Agent-first CLI

  • One JSON envelope on stdout, including warnings; progress events on stderr.
  • Stable error codes with retry guidance. Non-interactive by default.
  • Read-only SQL — only SELECT, WITH, EXPLAIN.
  • Schema discovery built in: agentmine schema.
  • Ships a bundled skill so your agent knows when to reach for it — set it up.

Sources

Reads the tools you already use

Start mining.

Install the CLI, point it at your history, and query.

$ npm i -g agentmine
$ agentmine ingest --source claude-code
$ agentmine stats