Skip to main content

Serverless-native local archive for AI conversations: JSONL truth log + rebuildable SQLite index, searched and read locally, exposed over MCP.

Project description

thread-archive

PyPI CI Python Platform License: MIT

A note from the human in the loop: This app is an experiment to see if vibe coding can produce something robust. If that makes you not trust the project, welcome to the club! I have over 10 years of professional dev experience, but I'll be honest, I haven't read any of the code. Nevertheless I get a lot of benefit from the functionality, and we have pretty good tests, so 🤷🏻‍♀️ (review the project yourself, or ask your AI).

A local-first archive for the AI agents that work on your machine — built by Claude Code, for Claude Code. Every session your agent harnesses record lands in one durable, append-only archive you own, on your own disk — and your agents can search and read all of it, mid-conversation, over MCP.

Your agent's transcripts are temporary by default. Claude Code writes each session to ~/.claude as JSONL, keeps it for 30 days, and deletes it — a sensible default for a harness's working files, a lossy one for the only record of how the work got decided. Nothing searches them in the meantime either.

Quickstart

pip install thread-archive
thread-archive setup

setup discovers this machine's conversation stores and shows what it found — counts, sizes, date ranges — before touching anything. Whatever is still on disk imports as a head start; from then on a background watcher keeps the archive current and the 30-day window stops mattering. It also wires the MCP server into your client. Every choice is skippable.

Minutes after setup, ask mid-conversation:

"what did we decide about the auth flow?"

Your agent searches, reads around the hits, and comes back with what you decided and why — a few thread_search calls and a couple of thread_reads, the way it would work through a codebase it hadn't seen. What it reads is an efficient representation of the conversation itself, not a summary someone made of one. No workflow to adopt, no notes you were supposed to be taking — from here on the record is being written.

What you get

  • Search, two doors, one implementation — MCP tools (thread_search, thread_read) for agents, and the same verbs on the CLI (thread-archive search "auth flow" --since 30d). What you get at a prompt is what your agent gets.
  • Full-text and semantic search, fused and re-ranked, filterable by time, source, tool, and content type; an empty query browses recent activity.
  • Indexed by code, not just by words — ask which conversations worked on a file (thread_search(path='rank.py')), which sessions a commit is made of (thread_search(commit='31bade5')) or a pull request was built from (thread_search(pr=4)), or what a session actually changed.
  • Built like a database, not a folder of exports — plain JSONL as the source of truth, crash-safe writes with intent journaling, built-in backup with nightly restore drills. The index is a disposable projection that rebuilds at any time.
  • Import drift is loud and repairable — when a provider changes its transcript format, coverage checks catch it, raw files are preserved before the provider prunes them, and thread-archive source fix scaffolds the repair for you (or your agent) to finish.
  • No hosted backend. No cloud. No subscription to lose your history to. Every process runs locally, on your machine.

Claude Code is the supported, first-class source. The other harnesses it reads — Codex, Cursor, OpenCode, Grok, and friends — are best-effort and community-maintainable via the plugin API. Web chats (claude.ai, ChatGPT, xAI) import from account exports you download by hand.

Documentation

This is the manual, and it ships inside the package: thread-archive docs lists these pages and thread-archive docs <page> prints one, offline. From a clone, the web viewer serves the same pages at /docs. The links below are those pages on GitHub. (docs/*.md, one level up from them, is the other half — the release process, the bench landscape, the maintainer's dev panels — written for whoever works on this repo, and in no install.)

Scope

Deliberately narrow: one machine, one user, macOS and Linux only. The archive preserves and retrieves — it never writes back to a harness store and never sends a message. Live capture of web chats is out; account exports are the path. The reasoning behind each line is in docs/public/scope.md.

Similar and related projects

Preserving and searching AI conversation history is a crowded space, and a lot of the work in it is good — session-search neighbors (CASS, ctx, deja-vu, episodic-memory, synty, and more), agent memory layers (mem0, Letta, Zep), and the prior art outside AI (notmuch). The annotated survey lives in docs/public/related.md. The short version of the difference: most tools treat the harness's own files as the record and their index as a cache over it; archive treats preservation as the product — its own append-only truth log, backup with restore drills, and unmodeled provider fields preserved verbatim.

License

MIT — see LICENSE. An install carries no third-party source: the web viewer's bundle, which is what vendors any, is dev-only and excluded from the wheel. Its dependencies (all MIT/ISC/BSD) are attributed in src/thread_archive/_web/THIRD_PARTY_NOTICES.md in the repo (regenerate with scripts/gen_third_party_notices.py when frontend dependencies change).

Origin

thread-archive is the standalone member of a larger personal project ("thread"), built to stand on its own — self-contained, no hosted backend or external services. It is alpha software, and the version number says so.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thread_archive-0.0.12rc1.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thread_archive-0.0.12rc1-py3-none-any.whl (870.3 kB view details)

Uploaded Python 3

File details

Details for the file thread_archive-0.0.12rc1.tar.gz.

File metadata

  • Download URL: thread_archive-0.0.12rc1.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for thread_archive-0.0.12rc1.tar.gz
Algorithm Hash digest
SHA256 11788e7ec895b5f0253814a81a3c5a16f25f862ca634ccd92a7e931ec04507e0
MD5 a03b793460ef574707896f769a3c01eb
BLAKE2b-256 97a4b19152f32284f2ed93847f25d617adb9d7d45a94f8154ec33e78b65639d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for thread_archive-0.0.12rc1.tar.gz:

Publisher: publish.yml on ellamental/thread_archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thread_archive-0.0.12rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for thread_archive-0.0.12rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 a37157c8405c14829aa122bce694e6a174405fd1d9e0a530db3cdeb155b0663f
MD5 aa1fbe0a70d0fa813db0b6fa7074fcf1
BLAKE2b-256 f69de5727bc7d76a3afa9b266f96a756d80ed283734bb2eb4590ead09439be13

See more details on using hashes here.

Provenance

The following attestation bundles were made for thread_archive-0.0.12rc1-py3-none-any.whl:

Publisher: publish.yml on ellamental/thread_archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page