ReceptionistAgent

View as MarkdownOpen in Claude

A front-desk agent that greets callers and transfers them to the correct department by phone number or SIP address. Visitor check-in is opt-in.

1import { ReceptionistAgent } from '@signalwire/sdk';
2
3const agent = new ReceptionistAgent({ /* ReceptionistConfig */ });

ReceptionistConfig

departments
ReceptionistDepartment[]Required

Departments the agent can transfer callers to. Each ReceptionistDepartment has:

  • name (string, required) — department identifier (e.g. "sales").
  • description (string, required) — description shown to the AI.
  • number (string, required) — phone number or SIP address dialed by transfer_call.
greeting
stringDefaults to "Thank you for calling. How can I help you today?"

Initial greeting spoken when the call starts.

voice
stringDefaults to "rime.spore"

Voice identifier passed to addLanguage.

companyName
string

Optional company name appended to the greeting.

checkInEnabled
booleanDefaults to false

When true, registers the check_in_visitor tool.

onVisitorCheckIn
(visitor: Record<string, string>) => void | Promise<void>

Callback fired when a visitor checks in. Receives a record with the fields collected during check-in.

name
stringDefaults to "receptionist"

Agent display name.

route
stringDefaults to "/receptionist"

HTTP route for the agent.

agentOptions
Partial<AgentOptions>

Additional AgentBase options forwarded to the constructor.

Built-in Tools

ToolDescription
collect_caller_infoCollect the caller’s name and reason for calling; stored in global_data.caller_info.
transfer_callDial a department’s number and transfer the caller. The department param is an enum of the configured department names.
check_in_visitorRecord a visitor check-in (only when checkInEnabled is true).

transfer_call uses FunctionResult.connect() to dial the department’s configured number.

Example

1import { ReceptionistAgent } from '@signalwire/sdk';
2
3const agent = new ReceptionistAgent({
4 companyName: 'Acme Corporation',
5 greeting: 'Thank you for calling Acme Corporation. How may I direct your call?',
6 departments: [
7 { name: 'sales', description: 'New orders and pricing', number: '+15551001001' },
8 { name: 'support', description: 'Technical issues', number: '+15551001002' },
9 { name: 'billing', description: 'Invoices and payments', number: '+15551001003' },
10 ],
11 checkInEnabled: true,
12 onVisitorCheckIn: (visitor) => {
13 console.log(`Visitor checked in: ${JSON.stringify(visitor)}`);
14 },
15});
16
17agent.serve();

createReceptionistAgent

1import { createReceptionistAgent } from '@signalwire/sdk';
2
3const agent = createReceptionistAgent({
4 departments: [
5 { name: 'sales', description: 'Orders', number: '+15551001001' },
6 ],
7});