Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
TL;DR — When
agent.chat() fails (LLM 5xx, timeout, rate-limit) the user’s message is normally lost. Set dlq=InboundDLQ(...) and PraisonAI persists the failed message so you can replay it later.Why you want this
No silent data loss
Failed inbound messages are persisted to a SQLite file before the exception bubbles up.
Operator-friendly replay
A single CLI command (
praisonai bot dlq replay) re-runs failed messages through the agent.Bounded by design
TTL +
max_size keep the queue from growing unbounded; oldest entries evict first.Zero new dependency
Uses only stdlib
sqlite3. Default OFF — your existing bots are untouched.How it flows
Quick start (3 lines)
CLI
API reference
Where the SQLite file lives. Parent directories are created automatically.
Maximum number of entries kept. When exceeded, oldest entries are dropped first.
Entries older than this are evicted on the next
enqueue() or evict_expired().DLQEntry
Methods
- Inspect
- Mutate
- Replay
Real LLM smoke test
Operational notes
Thread safety — every write is guarded by an internal
threading.Lock. SQLite WAL is enabled. Safe to share one InboundDLQ instance across threads.Backward compatible —
BotSessionManager(...) without dlq= behaves exactly as before. No behaviour change for existing bots.Combining with other features
With Cross-Platform Mirror (W1)
With Cross-Platform Mirror (W1)
The DLQ records
platform, user_id, and (if W1’s IdentityResolver is wired) the same user_id resolves the same human across platforms. Replay restores the exact session.With BackoffPolicy (resilience)
With BackoffPolicy (resilience)
For transient failures use
praisonai.bots._resilience.BackoffPolicy to retry inline before falling back to the DLQ. The DLQ is the last resort, not the first.With observability
With observability
Wrap
dlq.enqueue() with your tracer (e.g. OTEL span) to alert on DLQ growth. A non-zero dlq.size() is a great SLO trip-wire.
