chatpack
Token-efficient chat export processing for LLM and RAG pipelines.
Website | API Docs | Benchmarks | Export Guide
Table of Contents
Overview
Chatpack parses chat exports from Telegram, WhatsApp, Instagram, and Discord, converting them into token-efficient formats for LLM analysis and RAG ingestion.
Raw chat exports waste 80%+ of tokens on JSON structure, metadata, and formatting. Chatpack removes this noise, achieving 13x compression (92% token reduction) with CSV output.
┌─────────────────┐ ┌─────────────────┐
│ Telegram JSON │ │ Clean CSV │
│ WhatsApp TXT │ ──▶ chatpack ──▶ │ 13x compression │
│ Instagram JSON │ │ LLM-ready │
│ Discord Export │ │ RAG-optimized │
└─────────────────┘ └─────────────────┘
Token Compression Results
| Format | Input | Output | Compression |
|---|---|---|---|
| CSV | 11.2M tokens | 850K tokens | 13x (92%) |
| JSONL | 11.2M tokens | 1.0M tokens | 11x (91%) |
| JSON | 11.2M tokens | 1.3M tokens | 8x (88%) |
Installation
Or add to Cargo.toml:
[]
= "0.5"
See Feature Flags for minimal installations.
Quick Start
use *;
use ;
Documentation
| Guide | Description |
|---|---|
| Export Guide | How to export from Telegram, WhatsApp, Instagram, Discord |
| Benchmarks | Performance metrics and compression stats |
| API Docs | Structs, traits, and functions reference |
Feature Flags
| Feature | Description | Default |
|---|---|---|
full |
All parsers + outputs + streaming | Yes |
telegram |
Telegram JSON parser | Yes |
whatsapp |
WhatsApp TXT parser | Yes |
instagram |
Instagram JSON parser | Yes |
discord |
Discord multi-format parser | Yes |
csv-output |
CSV output writer | Yes |
json-output |
JSON/JSONL output writers | Yes |
streaming |
O(1) memory streaming parsers | Yes |
async |
Tokio-based async parsers | No |
Minimal installation example:
= { = "0.5", = false, = ["telegram", "csv-output"] }
Minimum Supported Rust Version
Rust 2024 edition (rustc 1.85+). MSRV is tested in CI.
Contributing
Contributions welcome! Please:
- Check existing issues
- Open an issue before large changes
- Run
cargo test && cargo clippybefore submitting PRs
License
MIT License. See LICENSE for details.
Try chatpack online - no installation required!