AI Receptionist with CRM Lookup

View as Markdown

An intelligent voice receptionist answers incoming telephone calls, looks up caller identity in CRM records, delivers personalized greetings with context from open tickets, creates new leads for first-time callers, and logs call intents.

What it does

  • Identifies incoming callers in real-time using caller ID and CRM lookup
  • Known Customers: Greets patients by name, surfaces open support or billing tickets, and provides tailored assistance
  • New Callers: Automatically provisions new lead records and prompts for contact details
  • Answers general clinic questions (operating hours, location, services, and department directory)
  • Records structured caller intent (billing, sales, support, general) to persistent audit logs
  • Immediately clears audio playback buffers on caller barge-in
  • Concludes calls with a professional closing greeting and hangs up cleanly

This sample

Meridian Clinic AI Receptionist on AgentDuet with Qwen Omni Realtime and CRM backend (Local JSON or live Pipedrive). Full source: agentduet-samples / ai-receptionist.

State flow: NEW → LIVE (answer()) → Qwen Omni bidirectional voice loop + CRM lookup → disconnect() / close()

Prerequisites

  • Python 3.12+
  • Get an API key and connector UUID at agentduet.com
  • Alibaba Cloud DashScope API key (DASHSCOPE_API_KEY) for Qwen Omni Realtime
  • Optional: Pipedrive API token and company domain for live CRM sync

Tutorial

Step 1: Clone the sample

$git clone https://github.com/AgentDuet/agentduet-samples.git
$cd agentduet-samples/use-cases/ai-receptionist

Step 2: Install

$python3.12 -m venv .venv
$source .venv/bin/activate
$pip install -r requirements.txt

Step 3: Configure .env

$cp .env.example .env
AGENTDUET_API_KEY=your-connector-api-key
AGENTDUET_CONNECTOR_UUID=your-connector-uuid
DASHSCOPE_API_KEY=your-dashscope-api-key
DASHSCOPE_REGION=intl
COMPANY_NAME="Meridian Clinic"
CRM_BACKEND=json
# Optional Pipedrive settings
# PIPEDRIVE_API_TOKEN=your-pipedrive-token
# PIPEDRIVE_COMPANY_DOMAIN=your-company

Step 4: Run

$python main.py

Step 5: Place a call and test

  1. Known Customer Test: Call from a number configured in data/customers.json. The receptionist recognizes you by name and mentions your open tickets.
  2. New Caller Test: Call from an unregistered number. The receptionist welcomes you, creates a new lead entry in data/leads.json, and asks for your name.
  3. General Inquiries: Ask about clinic hours or services. The assistant answers immediately and logs your classified intent to data/reception_calls.json.

How it works

When an inbound call arrives, the agent queries the CRM backend by caller telephone number. If a customer profile is found, historical context (name, open tickets, preferred department) is injected into the model’s system prompt before the call is answered. During the conversation, Qwen Omni processes 24 kHz audio bidirectionally and invokes structured tools to fetch tickets, update lead details, and record call intents.

Key APIs

PieceRole
Qwen Omni RealtimeLow-latency speech-to-speech dialogue and function calling
CRM BackendCustomer lookup, ticket retrieval, and lead management
call.caller.audio_stream()Captures caller microphone audio
call.send_audio(chunk)Delivers synthesized receptionist voice
call.clear_send_audio_buffer()Zero-latency barge-in interruption handling
data/reception_calls.jsonPersistent structured audit log of call outcomes and intents