# ChatLab

> A local-first desktop app that imports chat exports from eight platforms and lets SQL and AI agents analyse them on your own machine

- Category: Data & Labeling / Data Wrangling
- Language: TypeScript
- Licence: AGPL-3.0
- Repository: https://github.com/ChatLab/ChatLab
- Website: https://chatlab.fun
- Canonical page: https://ai-tldr.dev/tools/chatlab/

## In short

ChatLab is an open-source desktop application for analysing your own conversation history. It sits in the Data Wrangling category of the Data & Labeling tools and is open-source, written in TypeScript and licensed AGPL-3.0. To get started: install the desktop app.

## Overview

ChatLab is an open-source desktop application for analysing your own conversation history. It imports chat exports, normalizes the different formats into one data model, stores them locally, and then lets you interrogate them two ways: directly with SQL, or through AI agents that call tools against the same data. WhatsApp, LINE, QQ, Discord, Instagram, Telegram, iMessage and Google Chat are supported today, with Messenger and KakaoTalk listed as next.

It is built for large archives. Parsing is stream-first rather than buffered and processing is spread over multiple workers, so million-message imports stay responsive and memory-stable. The pipeline runs in five stages — format detection, stream parsing, local persistence, SQL plus AI query, then visualization — and the visual side ships trend, time-pattern, interaction-frequency and ranking views out of the box. The AI layer is assembled from agents and function calling over 24+ tools rather than one hard-coded model path, so it can search, summarize and analyse records with context instead of only answering from a prompt.

Privacy is the design constraint: raw chat data, indexes and settings stay on the device unless you explicitly send them elsewhere, and there is no mandatory cloud upload. The codebase is a pnpm monorepo on Electron, Vue 3, Nuxt UI and Tailwind, with the business logic in shared packages (`@openchatlab/core`, `@openchatlab/node-runtime`, `@openchatlab/tools`) used by both the desktop app and the CLI so the two cannot drift. Besides the desktop build there is a `chatlab-cli` npm package that serves the same web UI and an API — including a headless mode intended for scripts and AI agents — and a browser-only WASM target. Licensed AGPL-3.0.

## What it does

- Imports and normalizes exports from WhatsApp, LINE, QQ, Discord, Instagram, Telegram, iMessage and Google Chat into one schema
- Stream parsing with multi-worker processing, aimed at million-message histories
- SQL access to the normalized store alongside agent + function-calling workflows over 24+ tools
- Built-in visual views: trends, time-of-day patterns, interaction frequency and rankings
- Local-first — raw data, indexes and settings stay on-device, with no mandatory cloud upload
- Three ways to run it: Electron desktop app, `chatlab-cli` (web UI, API, or headless for scripts and agents), or browser-only WASM
- `clb web --daemon` installs a background service on macOS and Linux that auto-starts on login and restarts on crash

## Getting started

Either install the desktop app or run the CLI. The CLI needs Node.js ≥ 20; the desktop app needs nothing else. Exporting the chat history from each platform is the step before either, and the docs have a per-platform guide.

1. Install the desktop app

   Download the installer for your OS from the official site or GitHub Releases and run it.

```text
https://chatlab.fun/?type=download
https://github.com/ChatLab/ChatLab/releases
```

2. Or install the CLI

   Requires Node.js ≥ 20.

```bash
npm i chatlab-cli -g
```

3. Start it

   `clb web` serves the API and web UI and opens a browser; the headless mode is the one to use from scripts or an AI agent. Common options are --port (default 3110), --host and --token.

```bash
clb web              # API + web UI, opens the browser
clb web --no-open    # API + web UI, no browser
clb web --headless   # API only — for scripts and AI agents
```

4. Run it as a service

   On macOS and Linux the daemon flag installs a system service that starts on login and restarts after a crash.

```bash
clb web --daemon   # install as a system service
clb status         # check it
clb stop           # stop and uninstall
```

5. Export your chats, then import

   Each platform exports differently; ChatLab documents the procedure per platform and the normalized format it maps them into.

```text
https://docs.chatlab.fun/usage/how-to-export
https://docs.chatlab.fun/standard/chatlab-format
```

## When to use it

- Query years of personal or group chat history with SQL without first writing a parser per platform
- Ask an agent to summarize or find patterns across a million-message archive that is too large to scroll
- Keep sensitive conversation data on your own machine while still getting AI analysis of it
- Compare histories from several messaging apps side by side once they share one normalized schema
- Drive the same analysis from a script or another agent through the headless CLI API
