Skip to main content

A personal, queryable archive of your AI conversations across providers

Project description

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

Early alpha. v0 includes adapters for Claude Code, claude.ai exports, Codex CLI, and OpenCode. 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+. DuckDB is installed as a Python dependency; you do not need to install a separate DuckDB server or CLI.

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

# Create the local DuckDB archive and show detected sources
chatstrata init

# Auto-detect local app transcripts, ingest them, and generate embeddings
chatstrata ingest --auto

# See what's there
chatstrata stats

# Run a query
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

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. 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.

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

chatstrata-0.2.0.tar.gz (602.6 kB view details)

Uploaded Source

Built Distribution

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

chatstrata-0.2.0-py3-none-any.whl (72.9 kB view details)

Uploaded Python 3

File details

Details for the file chatstrata-0.2.0.tar.gz.

File metadata

  • Download URL: chatstrata-0.2.0.tar.gz
  • Upload date:
  • Size: 602.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatstrata-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4b23997bc77f8c002bf08eadfe8c8511e331451013197a847d39193041708b1f
MD5 0c1388f48f6f37c69c6c766ec3aa3c35
BLAKE2b-256 d079b79986b3f6c42d7445308167c04f0057768f2e1fc26c9229056045693e90

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatstrata-0.2.0.tar.gz:

Publisher: publish.yml on brandonbosch/chatstrata

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

File details

Details for the file chatstrata-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: chatstrata-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 72.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatstrata-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0624fa89753f3a9a346b653f922011eb4d4cf49fbbc7435d71addeed43d8e2be
MD5 ca1fa38c528b0816f193edd1a4f01344
BLAKE2b-256 ac0b1e429ace459bf3c8e3fe3d86498c3746d13eb2153df4bbf5074196054457

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatstrata-0.2.0-py3-none-any.whl:

Publisher: publish.yml on brandonbosch/chatstrata

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