Skip to content

calebini/afterword

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Afterword

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.

What It Does

  • parses WhatsApp-style exports, including multiline messages
  • computes message, participant, monthly, and conversation-level stats
  • ranks conversations by IIS and MIS
  • splits long chats into monthly Markdown files and JSON analytics
  • slices a full export into a smaller date/time window for delta workflows

Conversation Scores

Afterword uses two conversation-ranking scores:

  • IIS (Interaction Intensity Score) highlights fast, lively exchanges
  • MIS (Meaningful Interaction Score) highlights richer, more sustained conversations

IIS

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

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.

Commands

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

Notes

  • 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.

Chat Wiki Workflow

Afterword works well as a preprocessor for Karpathy-style LLM wikis.

  1. Export the chat from WhatsApp.
  2. Run Afterword analyze to get global stats and conversation structure.
  3. Run Afterword split to produce monthly source files.
  4. Hydrate a wiki timeline from the generated monthly sources.
  5. Hydrate participant pages from recurring people and their stats.
  6. Hydrate episode pages from conversation clusters.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages