Atiende — Multi-Channel AI Agent
A conversational AI system for WhatsApp, Instagram DM and Facebook Messenger. It answers customers with catalog-grounded RAG, creates orders, escalates to humans and controls LLM spend through multi-level caching.
Role: Team Lead & Full-Stack Developer building applied AI systems
Problem
Small businesses lose sales when they cannot answer customers quickly across messaging channels. Fixed-response bots cannot handle natural conversations, and coupling the product to one LLM provider increases cost and operational risk.
Solution
I designed Atiende as a hexagonal orchestration layer between messaging channels, business tools and AI providers. Messages are persisted before queueing, processed asynchronously and routed through channel and LLM adapters. Catalog, order and escalation tools ground the conversation in business data, while layered caching reduces repeated model calls.
Results
- Three operational channel integrations: WhatsApp, Instagram DM and Facebook Messenger.
- A shared persist-before-enqueue pipeline with deduplication and idempotent processing.
- 295 tests across 40 files covering the core workflows.
- Approximately 30% lower cost per conversation in project benchmarks using prompt, exact and semantic caches.
Architecture
- 01Meta webhook → verification, persistence and deduplication
- 02BullMQ → asynchronous inbound-message processing
- 03Agent orchestration → catalog, order, knowledge and escalation tools
- 04LLM router → primary provider, circuit breaker and fallback
- 05Channel adapter → response delivery and dashboard escalation
Key decisions
Hexagonal boundaries
Channel and model integrations are interchangeable adapters, keeping business logic independent from vendor SDKs.
Persist before enqueue
The webhook acknowledges quickly while durable state and idempotency protect the asynchronous workflow.
Caching as a product feature
Exact and semantic caches sit alongside prompt caching, with business scoping and safeguards for stateful conversations.
Human escalation
The agent can hand a conversation to a person, who answers from the same multi-channel dashboard.
Challenges
- Normalizing different Meta channel contracts without leaking channel-specific logic into the core.
- Handling provider differences in tool calling and model parameters.
- Reducing cache-related risk around personal data, prices and state-changing tools.
Key learnings
- Portable behavior belongs behind a port; provider-specific behavior belongs in its adapter.
- Persisting before asynchronous processing is more important than making a webhook wait for the model.
- Semantic caching needs conservative thresholds, tenant isolation and bypass rules for private or stateful requests.
Limitations & roadmap
- Temporarily offline after the physical server was retired; the case study remains available but there is no live demo claim.
- Meta OAuth onboarding and long-lived production tokens are still on the roadmap.
- The reported cost reduction comes from project benchmarks, not a published customer-wide production study.
Next project
CV Harness — Event-Driven Job Search
Rust + NestJS pipeline for AI job matching and ATS-aware resumes