Skip to main content

chatstrata

chatstrata

A personal, queryable archive of your AI conversations across providers.

Every conversation you've had with Claude, ChatGPT, or any other LLM is a record of how you think, what you're working on, and how that's changed over time. Most of that record lives scattered across browser exports, hidden JSONL files, and SaaS dashboards you don't fully control. chatstrata pulls it into one place, normalizes it, and lets you actually query and analyze it.

The name is from "strata" — layers of conversation deposited over time, with the deeper layers telling you who you were.

Why this exists

LLM providers collect rich data about how you interact with their models and use it (in aggregate) to improve the experience for everyone. chatstrata is the same idea, but for an audience of one: you. Your conversations, on your machine, queryable on your terms.

Concretely, with chatstrata you can:

  • Find every conversation where you discussed a topic, across providers.
  • See how your prompting has changed over months or years.
  • Audit every bash command you ran through Claude Code, grouped by project.
  • Build a corpus that helps you brief a new model on who you are and what you care about.
  • Identify abandoned projects, dropped threads, recurring patterns.

Status

Alpha. Published on PyPI. Includes adapters for Claude Code, claude.ai exports, Codex CLI, and OpenCode, plus scheduled background sync so your archive stays current without manual runs. The architecture is built so that adding more sources (ChatGPT exports, Cursor, etc.) is the work of one adapter — see docs/adapter-guide.md.

Quickstart

Requires Python 3.10+. We recommend uv — it's the fastest way to get started (no virtualenv wrangling, no dependency conflicts).

1. Install

uv tool install "chatstrata[embeddings]"
Alternative: pipx
pipx install "chatstrata[embeddings]"

2. Initialize and ingest

chatstrata init                  # create the local DuckDB archive
chatstrata ingest --auto         # auto-detect transcripts and generate embeddings

3. Set up background sync

Never think about syncing again — chatstrata can keep your archive up to date automatically in the background:

chatstrata schedule install              # sync every 15 minutes (default)
chatstrata schedule install --interval 1h   # or pick your own interval
chatstrata schedule status               # check that it's running

On macOS this installs a launchd agent that runs chatstrata ingest --auto on the configured interval. Logs go to ~/Library/Logs/chatstrata/. On Linux it installs a systemd user timer (chatstrata-sync.timer); logs go to the journal (journalctl --user -u chatstrata-sync.service), and loginctl enable-linger keeps it running while you are logged out. To stop background sync:

chatstrata schedule uninstall

4. Query your archive

chatstrata stats
chatstrata query "SELECT model, COUNT(*) FROM messages GROUP BY model"

The default database lives at a platform-appropriate user data directory (e.g. ~/.local/share/chatstrata/chatstrata.duckdb on Linux). Override with CHATSTRATA_DB or --db. Run chatstrata paths to see the exact paths for your machine.

MCP server

chatstrata ships an MCP server that exposes your archive to MCP-aware clients (Claude Desktop, etc.) through a single read-only query tool plus a chatstrata://schema resource. The client can then write and run SQL against your conversations directly.

1. Install with MCP support

uv tool install "chatstrata[embeddings,mcp]"
# or: pipx install "chatstrata[embeddings,mcp]"

2. Create and populate the archive

The MCP server reads an existing database; make sure you've ingested something first:

chatstrata init
chatstrata ingest --auto
chatstrata paths               # note the database path for the next step

If you installed without the embeddings extra, use chatstrata ingest --auto --no-embed or install the extra before running auto mode.

3. Point your MCP client at chatstrata

The installed chatstrata-mcp executable speaks MCP over stdio. If you use uvx, clients can run the published package without needing the absolute path to that executable.

For Claude Code, run:

claude mcp add --transport stdio --scope user chatstrata -- uvx --from "chatstrata[mcp]" chatstrata-mcp

Or ask chatstrata to print the command:

chatstrata mcp config claude-code

For Claude Desktop, add an entry to its mcpServers config (Settings → Developer → Edit Config):

{
  "mcpServers": {
    "chatstrata": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "chatstrata[mcp]", "chatstrata-mcp"]
    }
  }
}

You can generate that JSON with:

chatstrata mcp config claude-desktop

If CHATSTRATA_DB is omitted, the server falls back to the default platform path. To pin the MCP server to a specific database, pass --db when generating the setup snippet:

chatstrata mcp config claude-desktop --db /absolute/path/to/chatstrata.duckdb

Restart the client. The chatstrata server should appear with a query tool available; ask it something like "what topics have I discussed most this month?" and it will query your archive.

Data model

chatstrata normalizes every conversation into the same shape regardless of source:

  • conversations — one per session/thread
  • messages — one per turn (user, assistant, system)
  • content_blocks — one per content unit within a message (text, tool_use, tool_result, thinking, attachment)
  • tool_calls — denormalized view of tool_use blocks for easy querying
  • raw_events — the source data, line-for-line, for re-parsing without re-ingestion

See docs/schema.md for the full schema.

Auto ingest

chatstrata ingest --auto scans every installed adapter's default location, ingests the sources it finds, and then generates missing message embeddings. For each source, the first auto run does a full ingest; later auto runs switch that source to incremental mode and skip unchanged files.

Embedding uses a local sentence-transformers model. The first embedding run may download the model if it is not already cached; transcript content is not sent to chatstrata or a hosted inference API.

Use explicit source commands when you need a custom path or a provider export that has no default location:

chatstrata ingest claude_export --path ~/Downloads/claude-export/
chatstrata ingest claude_code --path ~/alternate/.claude/projects --incremental

Database maintenance

Repeated updates and deletes can leave unused space inside a DuckDB file. Rewrite the live data into a compact database with:

chatstrata compact

Stop scheduled ingestion, MCP servers, and other chatstrata processes first. The command verifies core table counts, rebuilds the full-text index, atomically swaps the compacted database into place, and retains the original as a timestamped backup. After checking the compacted database, delete that backup to release the disk space. Pass --no-backup to remove it automatically after verification.

Labelling with a classifier (optional)

chatstrata label runs TypeSafe's Jev classifier over your archive and stores typed answers in a labels table. The built-in packs classify every tool call's failure mode (compare harnesses and tools, e.g. omp edit vs Claude Code Edit) and every message you wrote (corrections, frustration, whether you said what "done" looks like).

uv tool install "chatstrata[jev]"
export TYPESAFE_API_KEY=...
chatstrata label run tool-failures --source omp --dry-run --show-state
chatstrata label run tool-failures --source omp --limit 200
chatstrata label summary tool-failures --by tool

This sends the selected content to the TypeSafe API, so it always shows an estimate and asks first. You can write your own packs as TOML files (no code) and drop them in your packs directory; the bundled cyber pack is a worked example that flags security-related tool calls so you can filter them out. See docs/labeling.md.

Adding a source

Each source (Claude Code, ChatGPT export, etc.) is an adapter that implements a small protocol: discover() finds available conversations, parse() turns them into the canonical record types. See docs/adapter-guide.md for the worked example using Claude Code.

Adapters can be contributed as PRs to this repo or as standalone pip packages that register via entry points.

Privacy

Your transcript content stays on your machine. Standard ingestion and querying make no network calls. The one exception is the opt-in chatstrata label command, which sends the items you select to the TypeSafe API after showing an estimate and asking for confirmation. Semantic search uses local embeddings; the first run may download the configured sentence-transformers model if it is not already cached. DuckDB's VSS extension is optional, and chatstrata only installs that extension when CHATSTRATA_INSTALL_DUCKDB_VSS=1 is set.

If you want to share queries or notebooks publicly, an optional redaction layer (uv tool install "chatstrata[redact]") wraps Microsoft Presidio with chatstrata-specific recognizers for API keys, file paths, and other things that commonly appear in LLM transcripts. See docs/redaction.md.

Contributing

Contributions welcome. Especially valuable: new source adapters. See CONTRIBUTING.md.

License

Apache 2.0. See LICENSE.

Metadata

Release files for chatstrata 0.4.0

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

Source distribution (sdist)

Source distribution for chatstrata 0.4.0
File Size Uploaded Provenance Actions
chatstrata-0.4.0.tar.gz 638.6 kB With provenance Details for chatstrata-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chatstrata 0.4.0
File Interpreter ABI Platform Actions
chatstrata-0.4.0-py3-none-any.whl Python 3 none any Details for chatstrata-0.4.0-py3-none-any.whl

Total release size: 751.9 kB

Release files / chatstrata-0.4.0.tar.gz

Download URL chatstrata-0.4.0.tar.gz
Size 638.6 kB
Tags Source
SHA-256 checksum
How to use checksums
17f01e1647ce843f8384a7559bc8d025eb8a49e6223acd7afdf692dd8ce8c135
BLAKE2b-256 checksum
How to use checksums
5c7cccb429840e66a925bd640f1b3c6f51ad794a5061effba9ac5d2a34a8ae5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 5, 2026.

Transparency log

Release files / chatstrata-0.4.0-py3-none-any.whl

Download URL chatstrata-0.4.0-py3-none-any.whl
Size 113.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
105a3f3a2d8c392c121b5b3001f303e8265e95334b00c09ac5d83604625ea448
BLAKE2b-256 checksum
How to use checksums
2aca3574635b18618d59b31a541f2180452dbc5f3320586fa5b789b624af9cb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 5, 2026.

Transparency log

Security for chatstrata 0.4.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for chatstrata-0.4.0.tar.gz

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 Oct 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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