BO
boyangwang/digest
Sleep Digest Bot ๐
Standalone Telegram bot that collects OpenClaw conversation transcripts nightly,
generates intelligent summaries via Doudou (OpenClaw AI agent), and writes
them to an Obsidian vault for archival.
AI agents: read AGENTS.md first.
Commands
| Command | Description |
|---|---|
/digest |
Start or update nightly digest |
/sleep |
Run reflection, finalize, goodnight |
/status |
Check current state |
/reflect |
Re-run reflection on latest digest |
Architecture
โ Full details: docs/architecture/overview.md
Telegram โ main.py โ collector.py โ collection_engine.py (parallel)
โ
llm.py โ openclaw agent (per session)
โ
recorder.py โ Obsidian vault
โ (/sleep)
reflection.py โ workspace memory files
Development
5-Step Lifecycle (Mandatory)
- Intake โ PRD in
specs/, assign DIGEST-XXX ID - TDD โ Write failing tests first
- Implement โ Make tests green
- E2E โ
python3 tests/run_e2e.py --verbose - Deploy โ
launchctl kickstart -k gui/$(id -u)/com.digest-bot
Quick Commands
# Unit tests (run files individually โ bulk hangs on async)
python3 -m pytest tests/test_recorder.py -v
python3 -m pytest tests/test_reflection.py -v
python3 -m pytest tests/test_collection_engine.py -v
python3 -m pytest tests/test_derived_sessions.py -v
# E2E (bot must be running, Telegram Desktop open)
python3 tests/run_e2e.py --verbose
python3 tests/run_e2e.py --test collection
# Restart
launchctl kickstart -k gui/$(id -u)/com.digest-bot
# Logs
tail -f /tmp/digest-bot.logProject Structure
digest-bot/
โโโ AGENTS.md # AI agent onboarding (read first)
โโโ README.md # This file
โโโ TODO.md # Work tracking (active + completed)
โโโ main.py # Bot entry, commands, state machine
โโโ collector.py # Transcript reader + message extractor
โโโ collection_engine.py # Parallel, retriable collection
โโโ llm.py # LLM interface (sync + async)
โโโ recorder.py # Digest file writer (YAML + markdown)
โโโ reflection.py # Nightly reflection orchestration
โโโ config.py # Constants, paths, SGT timezone
โโโ scheduler.py # APScheduler: timed collections
โโโ stt.py # Voice transcription (Whisper)
โ
โโโ specs/ # Active PRDs only
โโโ docs/
โ โโโ architecture/ # System design, format spec, testing strategy
โ โโโ completed/ # Archived PRDs and historical specs
โโโ tests/ # Unit (test_*.py) + E2E (run_e2e.py)
โโโ scripts/ # Utilities
Service
| Item | Value |
|---|---|
| LaunchAgent | ~/Library/LaunchAgents/com.digest-bot.plist |
| Log | /tmp/digest-bot.log |
| Git remote | github-digest:boyangwang/digest.git |
| Output | NotesVault/Artificial-Colloquia/Doudou-Digest/ |
PRD Template
# DIGEST-XXX: <Title>
> **Status:** ๐ด Draft
> **Priority:** P1
> **Tasks:** 0/N complete
> **Created:** YYYY-MM-DD
## Problem Statement
## Tasks
- [ ] **T1** โ description
## Acceptance Criteria
## Files to ModifyTest counts: 159 (134 unit/integration + 25 E2E) โ 2026-03-03
On this page
Languages
Python98.9%JavaScript1.1%
Created March 1, 2026
Updated March 7, 2026