Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/retellai-reference-architecture

@0d57af8
Run it yourself

Retell AI reference architecture — AI voice agent and phone call automation. Use when working with Retell AI for voice agents, phone calls, or telephony. Trigger with phrases like "retell reference architecture", "retellai-reference-architecture", "voice agent".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/retellai-reference-architecture

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesarchitecture-examples.md

≈851 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Architecture Implementation Examples

Agent and LLM Configuration

import Retell from 'retell-sdk';

const retell = new Retell({ apiKey: process.env.RETELL_API_KEY! });

// Create LLM with personality and tools
async function createAgentLLM() {
  const llm = await retell.llm.create({
    model: 'gpt-4o-mini',
    general_prompt: `You are Sarah, a friendly appointment scheduling assistant.

Instructions:
- Greet callers warmly and ask how to assist
- Collect: name, preferred date/time, reason for appointment
- Confirm all details before booking
- Keep responses under 2 sentences
- Be conversational, not robotic`,
    begin_message: "Hi there! This is Sarah from scheduling. How may we assist today?",
    general_tools: [
      {
        type: 'end_call',
        name: 'end_call',
        description: 'End call when conversation is complete',
      },
      {
        type: 'custom',
        name: 'book_appointment',
        description: 'Book an appointment after collecting all details',
        url: `${process.env.BASE_URL}/api/retell/book`,
        parameters: {
          type: 'object',
          properties: {
            name: { type: 'string', description: 'Caller name' },
            date: { type: 'string', description: 'Preferred date' },
            time: { type: 'string', description: 'Preferred time' },
            reason: { type: 'string', description: 'Appointment reason' },
          },
          required: ['name', 'date', 'time'],
        },
      },
    ],
  });

  return llm;
}

Voice Agent Setup

async function createVoiceAgent(llmId: string) {
  return retell.agent.create({
    agent_name: 'Appointment Scheduler',
    response_engine: { type: 'retell-llm', llm_id: llmId },
    voice_id: 'eleven_labs_rachel',
    language: 'en-US',
    responsiveness: 0.8,
    interruption_sensitivity: 0.7,
    enable_backchannel: true,
    voice_speed: 1.0,
    voice_temperature: 0.5,
  });
}

Tool Function Endpoints

import express from 'express';
const app = express();

// Tool function: book appointment
app.post('/api/retell/book', express.json(), async (req, res) => {
  const { name, date, time, reason } = req.body.args;

  const booking = await bookAppointment({ name, date, time, reason });

  res.json({
    result: `Appointment booked for ${name} on ${date} at ${time}. Confirmation number: ${booking.id}`,
  });
});

// Webhook: call events
app.post('/api/retell/webhook', express.json(), async (req, res) => {
  const { event, call } = req.body;

  if (event === 'call_ended') {
    await saveCallRecord({
      callId: call.call_id,
      duration: call.end_timestamp - call.start_timestamp,
      transcript: call.transcript,
      sentiment: call.call_analysis?.sentiment,
    });
  }

  res.json({ received: true });
});

Outbound Calls

async function makeOutboundCall(
  toNumber: string,
  agentId: string,
  metadata?: Record<string, string>
) {
  return retell.call.createPhoneCall({
    from_number: process.env.RETELL_PHONE_NUMBER!,
    to_number: toNumber,
    override_agent_id: agentId,
    metadata,
  });
}

Quick Agent Test

// Create a web call for testing (no phone needed)
const webCall = await retell.call.createWebCall({
  agent_id: agentId,
  metadata: { test: 'true' },
});
console.log(`Test call URL: ${webCall.call_id}`);

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides reference architectures and code examples for Retell AI voice agents. It is generally safe but includes architectural patterns for processing call transcripts and webhooks that represent a surface for indirect prompt injection, a standard risk for LLM-integrated voice systems.

  • Socket2mo

    1 alert: gptAnomaly

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago
What it can do
Reads files Edits files Runs commands
version
1.9.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "retellai",
  "voice",
  "telephony",
  "ai-agents"
]
All 6 allowed tools
ReadWriteEditBash(npm:*)Bash(curl:*)Grep
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/retellai-reference-architecture