Afterword is a Python CLI for parsing WhatsApp-style chat exports, analyzing them, and turning them into clean monthly source files plus machine-readable JSON. It is especially useful as a preprocessing layer for chat archives, Obsidian vaults, and LLM-driven wiki workflows.
Afterword began as a small chat-analysis project written in August 2020, during the long suspended stretch of the pandemic, as a way of looking back at conversations with friends and finding patterns, memories, and meaning in them. The name fits because this tool comes after the conversation itself: part archive, part reflection, and part attempt to understand what a shared record of talk can say once enough time has passed.
- parses WhatsApp-style exports, including multiline messages
- computes message, participant, monthly, and conversation-level stats
- ranks conversations by
IISandMIS - splits long chats into monthly Markdown files and JSON analytics
- slices a full export into a smaller date/time window for delta workflows
Afterword uses two conversation-ranking scores:
IIS(Interaction Intensity Score) highlights fast, lively exchangesMIS(Meaningful Interaction Score) highlights richer, more sustained conversations
IIS is designed to favor bursty, active exchanges:
IIS = (messages / duration_minutes) × log2(participant_count + 1) × (avg_words_per_message / global_avg_words_per_message)
In practice, IIS tends to surface moments where a lot happened quickly, even if the conversation was short.
MIS is designed to favor deeper conversations with more words, more sustained duration, and more social participation:
MIS =
log2(message_count + 1)
× log2(total_words + 1)
× log2(participant_count + 1)
× (avg_words_per_message / global_avg_words_per_message)
× log2(duration_minutes + 1)
In practice, MIS tends to surface conversations that feel more substantial rather than just fast.
PYTHONPATH=src python3 -m afterword analyze /path/to/chat.txt --format json
PYTHONPATH=src python3 -m afterword split /path/to/chat.txt --output /path/to/output-dir
PYTHONPATH=src python3 -m afterword slice /path/to/chat.txt --start "2026-05-01" --output /path/to/delta.txt- Input is treated as the source of truth.
- Monthly output is deterministic and regenerated from the export on each run.
- Markdown is for reading in Obsidian.
- JSON is for reuse in reports, charts, bots, and downstream tooling.
Afterword works well as a preprocessor for Karpathy-style LLM wikis.
- Export the chat from WhatsApp.
- Run
Afterword analyzeto get global stats and conversation structure. - Run
Afterword splitto produce monthly source files. - Hydrate a wiki timeline from the generated monthly sources.
- Hydrate participant pages from recurring people and their stats.
- Hydrate episode pages from conversation clusters.