Artag.dev
Architecture lab

Engineering lab

Technical case studies in STAR format, an interactive architecture map and notes on the systems I built.

RAG + LLM Router + Channels

Atiende — Multi-Channel AI Agent

295 tests / 40 files · ~30% cache savings
Input contract

Meta Webhook (WhatsApp / IG / Messenger) -> HMAC-SHA256 verified JSON event

Output contract

Grounded tool-call response + Order/Ticket state + Dashboard WebSocket sync

Failure handling / Circuit breaker

Redis message-id deduplication, BullMQ retries with backoff, circuit breaker across Groq/OpenAI fallback, one-click human escalation.

  • 295 tests in 40 files
  • ~30% LLM cost reduction via semantic cache
  • Tenant-isolated pgvector retrieval
Open full case study

Atiende — system architecture

  • Inbound pipeline
    Webhook verification, persistence, deduplication, enqueue
    • Meta webhook
      Signature verification + raw payload storage
    • Deduplication
      Idempotent by message id
    • BullMQ
      Asynchronous processing queue
  • Agent orchestration
    Tool-using agent grounded in catalog data
    • Catalog search (RAG)
      pgvector retrieval per tenant
    • Order creation
      Conversational order flow
    • Knowledge lookup
      Business FAQs and policies
    • Human escalation
      Handoff to the same dashboard
  • LLM router
    Provider selection with circuit breaker and fallback
    • Primary provider
      Groq / OpenAI
    • Fallback provider
      Secondary provider on failure
    • Caching layers
      Prompt, exact and semantic caches
  • Channel adapter
    Response delivery and dashboard sync
    • WhatsApp
      Meta Cloud API
    • Instagram DM
      Meta Graph API
    • Messenger
      Meta Graph API

The full 13-service private map (artag-services) is not public. The diagram above shows the flagship system that is documented.