> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monolex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Exports

> Use Kernel CLI 0.26.11 to ingest, read, search, measure, and export WhatsApp conversation archives through the embedded monochat reader.

# Chat Exports

`kernel-cli chat` turns a human conversation export into a local, searchable
data source. Version 0.26.11 supports WhatsApp `_chat.txt` files and exported
ZIP archives.

## One export, two sides

```text theme={null}
WRITE SIDE                                      READ SIDE

WhatsApp app pack                               kernel-cli chat
gesture export-chat ──▶ .zip / _chat.txt ──▶ ingest ──▶ local chat store
                                                         │
                                      list · read · search · stats · export
```

The app pack operates the application and produces an export. The chat reader
owns analysis after the file exists. Keeping those roles separate means the
reader never needs to automate WhatsApp merely to answer a question about an
already exported conversation.

## Start with an export

```bash theme={null}
kernel-cli gesture export-chat --app WhatsApp
kernel-cli chat ingest ~/Downloads/"WhatsApp Chat - Team.zip"
kernel-cli chat list
```

`ingest` accepts a ZIP, a bare `_chat.txt`, or a directory containing the
export. Add `--name "team group"` when the automatic name is not useful.
`<chat>` arguments accept a unique slug prefix.

## Command map

| Command                                 | Result                                                                    |
| --------------------------------------- | ------------------------------------------------------------------------- |
| `kernel-cli chat ingest <path>`         | Validate and add one export to the local store                            |
| `kernel-cli chat list`                  | Chats, message counts, participants, and date ranges                      |
| `kernel-cli chat show <chat>`           | Metadata, participants, first/last message, and detected timestamp format |
| `kernel-cli chat read <chat>`           | Conversation messages with optional sender and date filters               |
| `kernel-cli chat search <chat> <query>` | Substring search across message bodies                                    |
| `kernel-cli chat stats <chat>`          | Per-sender messages, characters, media, edits, and hour histogram         |
| `kernel-cli chat timeline <chat>`       | Per-day activity and optional reply-latency analysis                      |
| `kernel-cli chat export <chat>`         | Filtered Markdown, JSON, or CSV output                                    |

Every verb supports `--json` for machine-readable output.

```bash theme={null}
kernel-cli chat read team --sender "Alice" --since 2026-07-01 --limit 100
kernel-cli chat search team "release date" --json
kernel-cli chat stats team
kernel-cli chat timeline team --reply-latency
kernel-cli chat export team --format csv
```

## The parser proves what it can

```text theme={null}
raw line
   │
   ├─ valid next timestamp ───────────────▶ new message
   ├─ timestamp jumps backward over 24h ─▶ forwarded quote / continuation
   ├─ no sender ──────────────────────────▶ system message
   └─ no header ──────────────────────────▶ multiline continuation
```

WhatsApp exports do not include a locale marker. The reader detects date order
and 12/24-hour form from the file and reports the result in `chat show`.
Ambiguous data is labeled as assumed instead of silently presented as proven.

The parser also:

* removes bidirectional formatting marks that commonly appear in exports;
* joins multiline bodies until the next valid message header;
* distinguishes media, deleted, edited, and system messages;
* keeps forwarded headers inside the forwarding message when accepting them as
  real headers would make time move backward by more than 24 hours;
* refuses an ingest that produces zero messages.

The chronology guard prevents phantom participants and misleading reply-time
statistics while leaving room for real timezone travel.

## Storage and ownership

```text theme={null}
original export bytes ── stored locally ── parsed on demand
                                 │
              kernel-cli chat ◀──┴──▶ standalone monochat
```

Chats live under `~/.monochat/chats/` by default; set `MONOCHAT_DIR` to choose
another store. The original text is the durable source. Kernel CLI and the
standalone `monochat` frontend share the same reader and store, so a chat
ingested through either frontend is visible to both. Installing standalone
`monochat` is optional when Kernel CLI is already present.

Only `ingest`/`import` writes chat-store files. List, show, read, search, stats,
timeline, and export are read-only over existing chat data.

<Warning>
  In Kernel CLI 0.26.11, the verb-scoped audit hook for `chat ingest` is not yet
  wired. The ingest still writes only the disclosed local chat-store files, but
  it does not yet enter Kernel CLI's mutating-command audit log. Treat that as a
  known verification gap rather than assuming the BRAVE banner covers it.
</Warning>

## MCP

The typed `chat` MCP tool exposes the same actions:

```text theme={null}
action = list | show | read | search | stats | timeline | export | ingest
```

`ingest` is the only mutating action. The other actions read local files and do
not reach the network. The MCP tool and CLI route into the same embedded reader,
so their parser and store behavior do not diverge.

## Current boundary

The shipped adapter reads WhatsApp text exports. KakaoTalk, Telegram, and
iMessage are future adapters over the same conversation model; Kernel CLI
0.26.11 does not claim support for them. WhatsApp text exports also contain no
reaction history, so the reader does not invent reactions.

<CardGroup cols={2}>
  <Card title="Verified Input" icon="keyboard" href="/kernel-cli/verified-input">
    Prove stable app state between keyboard steps.
  </Card>

  <Card title="Workflows" icon="route" href="/kernel-cli/workflows">
    Export through an app pack, then verify the resulting artifact.
  </Card>
</CardGroup>
