Skip to main content

Overview

Agents are AI-powered conversational assistants that handle customer interactions. Each agent has its own personality, context, knowledge base, and integrations. Agent information is included in the Business endpoint response. This page documents the agent structure and configuration options.

Agent structure

Agents are returned as part of the business application configuration:
Agents
array
Array of agent configurations

Accessing agent data

Agent data is retrieved through the Get Business endpoint:
curl https://api.iqra.ai/api/v1/business/12345 \
  -H "Authorization: Token YOUR_API_KEY"

Example agent response

{
  "Id": "agent_abc123",
  "General": {
    "Name": "Sales Agent",
    "Description": "Handles customer sales inquiries",
    "Enabled": true
  },
  "Context": {
    "Variables": {
      "CompanyName": "Acme Corp",
      "ProductLine": "Enterprise Software"
    }
  },
  "Personality": {
    "Tone": "professional and friendly",
    "Style": "consultative sales approach",
    "Constraints": [
      "Never discuss pricing without qualification",
      "Always offer to schedule a demo"
    ]
  },
  "Utterances": {
    "Greeting": "Hello! Thanks for calling Acme Corp. How can I help you today?",
    "Fallback": "I'm not sure I understood that. Could you rephrase?",
    "Goodbye": "Thank you for your time. Have a great day!"
  },
  "Interruptions": {
    "Enabled": true,
    "TurnEndViaAI": {
      "Enabled": true
    }
  },
  "KnowledgeBase": {
    "Enabled": true,
    "References": ["kb_xyz789"]
  },
  "Integrations": {
    "STT": {
      "en": ["deepgram_integration_id"]
    },
    "LLM": {
      "en": ["openai_integration_id"]
    },
    "TTS": {
      "en": ["elevenlabs_integration_id"]
    }
  },
  "Settings": {
    "BackgroundAudioUrl": "https://s3.amazonaws.com/audio.mp3",
    "MaxDuration": 1800,
    "Language": "en"
  }
}

Agent configuration best practices

Context and personality

  • Keep context variables specific and relevant to the agent’s purpose
  • Define clear personality traits that align with your brand
  • Set appropriate constraints to keep conversations on track

Utterances

  • Write natural, conversational greetings and responses
  • Test utterances with different customer types
  • Localize utterances for multi-language support

Interruptions

  • Enable interruptions for natural conversation flow
  • Use AI-based turn detection for better accuracy
  • Configure verification to reduce false positives

Knowledge base

  • Link relevant knowledge bases to provide accurate information
  • Use query refinement to improve search accuracy
  • Monitor knowledge base usage and update content regularly

Integrations

  • Configure STT, LLM, and TTS per language for best results
  • Test different AI models to find the best fit for your use case
  • Monitor integration performance and costs

Notes

  • Background audio URLs are pre-signed and expire after approximately 8 hours
  • Agents can be enabled/disabled without deleting configuration
  • Multi-language agents require separate STT/LLM/TTS integrations per language
  • Agent settings are inherited from business-level defaults unless overridden

Build docs developers (and LLMs) love