Skip to main content


Terrier

Terrier

Local-first memory for your coding agents.

One SQLite file. Zero dependencies. No cloud, no account, no telemetry.

PyPI CI Python 3.10+ Zero dependencies MIT


Every Claude Code session you run leaves a transcript on disk — prompts, decisions, dead ends, fixes. Terrier digs through all of them (plus your markdown notes), indexes everything into a single FTS5 database, and lets you ask questions about your own past work:

$ terrier search "memory leak gateway"
┌ 2026-06-14 09:32 · api-gateway · 3f9a2c1d · assistant
│ fix the memory leak in the gateway
└ the [leak] came from the connection pool never releasing … capped it at 50 and added an idle reaper …
  • "Have I tried fixing this before? What was attempted?"
  • "Why did I bump that timeout to 30s? Git history says nothing."
  • "What did I actually get done this week?" → terrier recap

Install

pip install terrier-kb

Python ≥ 3.10, standard library only. Works on Windows, macOS, Linux.

Usage

terrier ingest                     # index all Claude Code transcripts (incremental)
terrier ingest --notes ~/notes     # also index a markdown folder (remembered)
terrier search "breakout stop loss" -n 5
terrier search "docker" -p myrepo -d 30   # filter by project, last 30 days
terrier recap -d 7                 # digest of the last week, per project
terrier graph --open               # interactive HTML knowledge graph
terrier status                     # what's in the burrow

Auto-ingest

terrier hook install

Adds a SessionEnd hook to ~/.claude/settings.json: every finished session is re-indexed automatically. Your memory stays current without thinking about it. terrier hook remove undoes it.

Knowledge graph

terrier graph renders your entire base as a self-contained HTML file — projects, sessions, notes, and the shared vocabulary that links them, laid out with a force simulation on a plain <canvas>. No CDN, no build step; the file works offline and can be committed, mailed, or dropped in a wiki.

terrier graph — projects, sessions and shared vocabulary

How it works

~/.claude/projects/**/*.jsonl ─┐
                               ├─► ~/.terrier/terrier.db (SQLite + FTS5)
your markdown folders ─────────┘        │
                                        ├─ terrier search   (BM25, cited snippets)
                                        ├─ terrier recap    (per-project digest)
                                        └─ terrier graph    (HTML force graph)

Ingestion is incremental — a file is re-read only when its mtime or size changes. Tool spam, progress events, and injected system reminders are filtered out; only human prompts and assistant prose are indexed. Bodies are capped at 20 kB so a stray file dump can't bloat the index.

Why not just grep?

You can! Terrier is roughly grep with a memory: ranked results (BM25), snippets with highlights, project/date filters, a weekly digest, a graph view, and an auto-updating index — while staying a single file you can delete at any time (~/.terrier/).

Inspired by Stash, which does this as a full multi-agent cloud product. Terrier is the opposite corner of the design space: everything runs on your machine, and rm -rf ~/.terrier is a full account deletion.

License

MIT

Metadata

Release files for terrier-kb 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terrier-kb 0.1.2
File Size Uploaded
terrier_kb-0.1.2.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for terrier-kb 0.1.2
File Interpreter ABI Platform
terrier_kb-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 36.5 kB

Release files / terrier_kb-0.1.2.tar.gz

Download URL terrier_kb-0.1.2.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6a3bad1077d2a4510280ec7101014e8cbc4ead0377375761ec9bf496f76306ee
BLAKE2b-256 checksum
How to use checksums
101a773fc69b423a4ab4ecd07c2b79f0655bcde11f4bd97eefcb5f54849e975f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

Release files / terrier_kb-0.1.2-py3-none-any.whl

Download URL terrier_kb-0.1.2-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5378f7bf875bc2c404a7745013a8481768622ca6cbbd5a52294515d174c535d
BLAKE2b-256 checksum
How to use checksums
1c3996550377da9b602955a638231b885c40be20db859fee64ca55bc3cced76c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page