Skip to main content

ChatArchive Architecture

ChatArchive is designed as a hybrid desktop application utilizing Tauri 2 for system interaction, Rust for performance-critical ingestion, SQLite for local relational state, and React for a lightweight, interactive frontend.


Application Stack

graph TD
subgraph UI [React Frontend / TS]
A[App.tsx Reader] -->|API Adapter| B[archiveApi.ts]
A -->|Search & Filter| C[Client-side Search]
end
subgraph Core [Tauri 2 / Rust Backend]
B -->|Tauri Commands| D[commands.rs Boundary]
D -->|SQLite Operations| E[db.rs State Engine]
D -->|File Ingestion| F[importer.rs OpenAI Importer]
end
subgraph Storage [Local Disk / Library]
E -->|Writes Metadata| G[(chatarchive.db)]
F -->|Extracts Files| H[JSON / Asset Library]
end
  • Frontend: Written in React, TypeScript, and TailwindCSS (or Vanilla CSS). It loads static indices for navigation and renders individual conversation files.
  • Backend (Tauri 2 / Rust): Owns system interactions, database schema migrations, and high-performance ingestion.
  • Durable State (SQLite): SQLite serves as the source of truth for all user metadata: bookmarks, custom tags, favorite flags, scroll positions, and search tables.
  • Document Library: The folder structure keeps raw data portable, allowing you to back it up or move it without losing your metadata.

Library Layout

When initialized, ChatArchive creates a unified library folder on your disk. You can back up this folder, move it to another drive, or open it in a text editor:

ChatArchive/
├── archives/
│ └── openai-2026-02/ <-- Individual ingested archive
│ ├── raw/ <-- Original conversations.json backup
│ ├── conversations/ <-- Normalized, individual JSON files (one per chat)
│ ├── assets/ <-- Copied images and attachments
│ ├── exports/ <-- Extracted markdown outputs
│ └── manifest.json <-- Ingestion metadata and sizes
├── chatarchive.db <-- SQLite database (tags, stars, search index)
└── settings.json <-- User settings and path configurations

Normalized Data Model

To support multiple AI providers in the future (ChatGPT, Claude, Gemini, etc.), ChatArchive does not read raw provider logs. It normalizes all imports into a standard, neutral schema:

1. ArchiveIndex

The top-level summary catalog, containing lists of conversations, search snippets, dates, and total counts. This powers the Dashboard statistics.

2. ConversationFile

A complete individual conversation, stored as an independent JSON file (identified by UUID). Keeping conversations isolated in files prevents memory bloat in the reader UI.

3. ArchiveMessage

Represents a single message inside a conversation:

  • role: user, assistant, system, or tool
  • content: Extracted text blocks
  • blocks: Structured segments separating text, code cards, and execution results
  • assets: Lists of local or missing images referenced in the message
  • hidden: Boolean flag marking system prompts or raw tool logs

4. ArtifactIndex

A compiled table mapping code blocks, document-like Markdown, links, and assets across the entire library. This allows the search engine to perform scoped queries (such as "find Python code containing pandas") without parsing thousands of conversation files.