karthik.dev
Back to projects
AI

Cody — WhatsApp AI Sales Agent

Production multi-turn, tool-calling WhatsApp AI agent with live monitoring dashboard

PythonFlaskClaude Haiku (Anthropic API)Multi-Turn Tool-CallingWhatsApp Business APILive Monitoring Dashboard

Overview

Cody is a production WhatsApp AI agent deployed at CodeMyFYP, built on Flask and the Claude API. It handles real sales conversations around a defined sales-assistant persona — processing INR/UPI pricing queries, mirroring Hindi/Hinglish based on detected user language, and managing vacancy/job-related queries as the dominant traffic type. Includes a live monitoring dashboard for observing tool invocations and failure modes.

Problem

Sales conversations on WhatsApp were handled manually, creating bottlenecks for pricing queries, vacancy information, and language-specific (Hindi/Hinglish) customer support. Teams lacked real-time visibility into conversation health and agent failure modes.

Solution

A multi-turn, tool-calling WhatsApp agent built on Flask and Claude Haiku. Tool-calling logic handles pricing lookups, vacancy queries, and language detection. A live monitoring dashboard gives the team real-time visibility into every conversation, tool invocation, and failure mode.

Architecture

  1. 1Flask webhook endpoint receives WhatsApp Business API messages
  2. 2Claude Haiku (Anthropic API) with multi-turn conversation context
  3. 3Tool-calling layer: pricing tools, vacancy query tools, language detection
  4. 4Hindi/Hinglish language mirroring based on detected user language
  5. 5Live monitoring dashboard — conversations, tool invocations, failure modes in real time
  6. 6Conversation state persisted across turns for coherent multi-turn sessions

Technical Challenges

  • Designing tool schemas precise enough to prevent Claude from hallucinating pricing or vacancy data.
  • Implementing language detection reliable enough to mirror Hindi/Hinglish consistently without misclassification.
  • Building a monitoring dashboard that surfaces tool-call failures without cluttering the operator view.

Results

  • Automated the dominant traffic type — vacancy and pricing queries — reducing manual sales workload.
  • Live monitoring dashboard gave real-time production visibility into agent health.
  • Successfully processed real user conversations with multi-turn coherence and correct tool invocations.