A four-part, build-it-yourself walkthrough of the WhatsApp lead-qualification agent I shipped at a CRM for small businesses. Each post takes one layer of the system and shows the real code, the tradeoffs, and the honest limits. The theme running through all four: the durable-execution, orchestration, and evaluation features you are told to adopt a platform for are usually separable from the parts you actually need, and the parts you need are a table, a lease, a lock, strict contracts, and a human reading transcripts.
Read them in order:
- Durable agent runs on Postgres and Celery - the engine: a Postgres row, a lease for crash safety, and a lock, instead of a workflow platform.
- Conversational AI agents: reply to conversations, not messages - the loop: debounce message bursts, poll the conversation, and treat every exit as a designed outcome.
- Putting an LLM in production: structure, cost, and prompt-injection defenses - the LLM layer: one job per call, completion the model can’t fake, a reliability sandwich, and untrusted-input defenses.
- Evaluating an LLM agent before you have eval infrastructure - the evals: 90 lines, four scripted scenarios, and a human judge that produces the rubric.