Skip to content

About

Turn a WhatsApp or Telegram chat export into metrics, relationship patterns and cited answers. Local-first: your messages never leave your machine. CLI and HTTP API; dashboard next.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Between Us

Understand a two-person conversation: metrics, relationship patterns, mood and mind over time, and questions answered with citations, from a WhatsApp or Telegram chat export. Local-first, lean, and free to host.

Status: 🏗️ Milestones M0 (foundation), M1 (import) and M2 (analytics) complete: import a WhatsApp or Telegram export and get all 27 metrics for any day, week, month, year or custom period, from the command line or the HTTP API. The web dashboard comes next (M3). See the roadmap.


What it does

Import WhatsApp .txt/.zip (Android & iOS) and Telegram Desktop result.json. Raw files are not kept.
Measure Volume, share of voice, response times, who initiates, streaks, silences, activity heatmaps, sentiment and more, for a day, week, month, year or custom range, compared with the previous period.
Interpret Relationship type and how it is evolving, plus the mood and mind of each person in any period. Every claim links to the messages behind it.
Ask "What were we worried about in March?" Answers are grounded in the chosen period and cite the messages they rely on.
Operate Multi-tenant workspaces, RBAC, audit log, OpenTelemetry traces/metrics/logs, dashboards and alerts as code, pluggable email/push/SMS notifications.

Quick start

Prerequisites: Go (any recent version; the pinned toolchain downloads itself) and Node.js 24.

make dev

This runs the Go API on http://127.0.0.1:7420 and the Vite dev server with hot reload on http://127.0.0.1:5173. To build the single binary with the UI embedded and run it:

make run

Other targets: make test, make lint, make vuln, make check (everything CI runs), make docker.

Import a chat (CLI)

./bin/betweenus import -dry-run "WhatsApp Chat with Bob.zip"

-dry-run shows the detected format, participants, period and warnings without writing anything. Drop it to import (the chat is analysed straight away); add -tz Asia/Kolkata if the phone that exported the chat was in a different timezone from this computer, and -me <key> to mark yourself. Re-importing a newer export of the same chat with -chat <id> adds only the new messages. betweenus chats lists chats and betweenus chats delete <id> removes one with all of its messages. Data lives in your OS's per-user app-data folder (override with BU_DATA_DIR).

See the metrics for any period:

./bin/betweenus metrics <chat id>

That shows the chat's latest month. Use -window week|month|year|all, -anchor 2024-06-01 to pick the period, -window custom -from 2024-01-01 -to 2024-03-31 for a range, and -json for all 27 metrics in full. The same data is served by the HTTP API (betweenus serve, spec in backend/api/openapi.yaml).

No real chat handy? Generate a fictional one:

cd backend && go run ./cmd/synthchat -format whatsapp -n 5000 > /tmp/demo.txt

Configuration is via CA_* environment variables, documented in .env.example.

Design at a glance

flowchart LR
    exp["Chat export<br/>WhatsApp or Telegram"] --> web["Web UI<br/>React + TypeScript"]
    web --> api["Go binary<br/>API + workers"]
    api --> ing["Ingest<br/>detect, parse, normalise"]
    ing --> db[("SQLite local<br/>PostgreSQL hosted")]
    db --> ana["Analytics<br/>daily rollups"]
    db --> ai["Insights and Q&A<br/>LLM optional"]
    ana --> web
    ai --> web
    api -. OTLP .-> obs["Grafana LGTM<br/>or Grafana Cloud"]
    api -. outbox .-> notify["Email, ntfy,<br/>Telegram, SMS"]
Loading
  • Backend: Go, one small binary (betweenus serve | migrate | import | worker).
  • Frontend: React + TypeScript + Vite, embedded in the binary for local use.
  • Data: SQLite locally (zero setup); PostgreSQL on Supabase or Aiven free tier when hosted.
  • AI: Ollama locally by default. Any OpenAI-compatible endpoint or Anthropic can be plugged in, or no LLM at all.
  • Hosting at $0: Vercel (web and Go functions) or a free container host, free Postgres, Grafana Cloud free, GitHub Actions.

Documentation

All design documentation lives in docs/. Start with the requirements.

# Document What's inside
01 Requirements Vision, scope, personas, functional and non-functional requirements, acceptance criteria, open questions
02 Architecture C4 diagrams, backend components, interfaces, request lifecycle, sequence diagrams, deployment profiles
03 Data model ER diagram, schemas for SQLite and Postgres, tenant isolation with RLS, indexes, migrations
04 Metrics catalog Exact definition and algorithm for every metric, time-window semantics
05 AI insights & Q&A LLM providers, relationship profile, mood and mind, summarisation, grounding, Q&A orchestration
06 Observability OpenTelemetry, metrics catalogue, logs, dashboards, alert rules, SLOs, runbooks
07 Deployment Local, Docker Compose and free cloud profiles, verified free-tier matrix, CI/CD, custom domain later
08 Security & privacy Threat model, controls, encryption, erasure, compliance, responsible AI
09 Notifications Notifier adapters (SMTP, ntfy, Telegram, SMS), outbox, providers and self-hosted mail
10 Roadmap Milestones, Gantt chart, exit criteria
— WhatsApp export format Line formats, locale handling, system messages, detection algorithm
— Telegram export format result.json structure and mapping to the canonical schema
— Architecture decisions ADR index
— Feature log What's shipped, what's planned, ideas under consideration
— Changelog Dated history of changes per milestone
— Contributing Repo conventions, commits, comments, tests, docs
— Security policy How to report a vulnerability

Repository layout

between-us/
├── backend/          # Go module: cmd/betweenus + internal/* packages
├── web/              # React + TypeScript + Vite app
├── deploy/           # docker-compose, Vercel config, Grafana dashboards and alert rules (M5/M6)
├── docs/             # All documentation (this index)
├── .github/          # CI, CodeQL, release-please, Dependabot
├── Dockerfile        # Container image (static binary on distroless)
├── Makefile          # Developer entry points (`make help`)
├── README.md
├── CONTRIBUTING.md
└── SECURITY.md

Privacy first

Chats contain another person's words too. By default everything stays on your machine, raw exports are discarded after import, hosted LLMs need explicit opt-in, and message content never appears in logs or telemetry. See Security & privacy.

License

Apache-2.0.

About

Turn a WhatsApp or Telegram chat export into metrics, relationship patterns and cited answers. Local-first: your messages never leave your machine. CLI and HTTP API; dashboard next.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages