Quick Start
How It Works
| Stage | Purpose | What happens |
|---|---|---|
| receive | Deduplication | Returns key for new messages, None for duplicates |
| claim | Crash protection | Marks entry as being processed |
| complete | Cleanup | Marks successful processing |
When to use which option
| Feature | InboundJournal | InboundDLQ |
|---|---|---|
| When triggered | Every inbound message | Only on agent failure |
| Solves | Webhook redeliveries, crash recovery | Failed LLM calls |
| Performance | Fast dedup check | No overhead until failure |
| Use together | ✅ Journal → agent → DLQ on exception | ✅ Complete durability stack |
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
path | str | Path | required | SQLite file path. Parent dirs auto-created. ~ is expanded. |
max_size | int | 50_000 | Max entries kept. Excess evicted: completed first, then oldest pending. |
ttl_seconds | int | 2_592_000 (30 days) | Completed entries older than this are evicted. |
claim_timeout | int | 300 (5 min) | Claimed entries older than this are considered stale and replayed. |
Per-platform examples
- Telegram
- Discord
- Slack
- WhatsApp
- Email
- AgentMail
Common Patterns
Pattern 1: Dedup-only (webhook redelivery protection)
Pattern 2: Crash recovery + replay loop on startup
Pattern 3: Combining with InboundDLQ for full durability stack
Best Practices
Use the same path across restarts
Use the same path across restarts
The journal’s SQLite file must survive restarts for crash recovery to work. Use an absolute path or a location that persists across deployments.
Tune claim_timeout to match your agent latency
Tune claim_timeout to match your agent latency
Set
claim_timeout to be longer than your p99 agent.chat() latency to avoid false stale entry detection.Call journal.replay() in your bot's startup hook
Call journal.replay() in your bot's startup hook
Always replay stale entries when your bot starts to recover from crashes.
Keep account stable per bot instance
Keep account stable per bot instance
The
account parameter is part of the deduplication key. Keep it consistent for each bot instance.Related
Inbound DLQ
Failure-side durability when agent execution fails
Bot Routing
Multi-channel session routing for complex bot setups

