# Platform overview Voicebot runs automated voice conversations: it answers and places calls, understands the caller, and acts on what was said. Your systems decide whom to call and what to do with the result. This page gives short answers on how the platform is built; every section links to the guide or API reference with the details. ## Delivery options The platform comes in two forms with the same API and object model: - **Cloud**: run by Apifonica, with many isolated tenants per installation. - **On-premises**: run by you inside your perimeter, usually with one tenant. Integration work is identical in both. Platform objects (tenant, account, trunk, number, scenario, agent, communication) are described in the [object model](https://docs.aiva.apifonica.com/concepts/object-model/) and the [glossary](https://docs.aiva.apifonica.com/concepts/glossary/). ## Components | Component | What it does | | -------------------------------------- | -------------------------------------------------------------------------------------- | | Platform core | Scenarios, agents, numbers, contacts, call automations, users and permissions; the API | | Call processing and speech recognition | Runs the call and executes the dialogue scenario | | Call balancing | Accepts calls over SIP and distributes them across nodes | | Voice activity detection | Detects when the caller is speaking | | Intent recognition | Understands intent and extracts data from answers | | Edge functions | Runs JavaScript functions called from scenarios | | Call analytics | Processes call events | | LLM gateway | Connects cloud or self-hosted language models | | Speech synthesis gateway | Connects local or cloud synthesis engines | | GPU model controller | Manages models on machines with GPUs | | Audio storage | Writes and reads recordings in S3-compatible storage | | Web console | User interface and scenario builder | | Documentation portal | API reference and guides | ## Technology stack The platform runs on Kubernetes and is deployed as infrastructure as code. | What | With | | ------------------- | ----------------------------------------------------------------- | | Containers | Kubernetes (RKE2), reference CNI: Cilium | | Primary database | PostgreSQL (Patroni, etcd, pgbouncer) | | Analytics | ClickHouse | | Sessions and cache | Redis (Sentinel) | | Call event bus | Apache Kafka (KRaft) | | Call recordings | S3-compatible object storage | | Secrets | HashiCorp Vault, included in the delivery | | Monitoring and logs | Prometheus and Grafana, Elasticsearch, SIP tracing | | Deployment | Configuration in git, synchronised by Flux; Terraform and Ansible | PostgreSQL, ClickHouse, Redis and Kafka are third-party software under their own licences. Options for each store and Kubernetes requirements are in sections 4–7 of the [deployment scoping checklist](https://docs.aiva.apifonica.com/integration/deployment-scoping-checklist/). ## Models and where they run Models connect through adapters, so the same scenario can use a cloud provider, a model inside your perimeter, or your own gateway. | Model type | Used for | Where it runs | | ----------------------------- | ------------------------------------------------- | ------------------------------------------------------------ | | Speech recognition (STT) | Caller speech to text, recognition dictionaries | External provider or your own model | | Speech synthesis (TTS) | Agent replies, audio cache | Local or cloud engine | | Intent and entity recognition | Classifying phrases, extracting data from answers | Inside the platform, on CPU | | Language models (LLM) | Free-form dialogue, answers from a knowledge base | Cloud provider, model inside your perimeter, or your gateway | - **Provider switching.** Adapters connect through a single entry point with a fallback chain. - **Data residency.** Language models carry residency flags, and requests are routed by them. Which data leaves the perimeter (dialogue text, audio) is agreed per installation. - **Models inside your perimeter.** The standard delivery needs no GPUs. Models on your own GPUs connect through the GPU model controller and are agreed separately. - **Your own gateway.** A gateway with a compatible API can be connected, for example for a recognition model trained on your callers’ speech. **Which models an installation offers** depends on the engines enabled for the account. Query them with an account key: - Speech recognition: [languages](https://docs.aiva.apifonica.com/api/account/operations/liststtlanguages/), [models](https://docs.aiva.apifonica.com/api/account/operations/liststtmodels/), [engine settings](https://docs.aiva.apifonica.com/api/account/operations/liststtspecs/), filterable by language - Speech synthesis: [languages](https://docs.aiva.apifonica.com/api/account/operations/adapterttsgetlang/), [voices](https://docs.aiva.apifonica.com/api/account/operations/adapterttsgetvoice/) - Language models: [model list](https://docs.aiva.apifonica.com/api/account/operations/adapterllmgetpublicdatamodels/), filterable by provider and residency - Intent recognition: [base models](https://docs.aiva.apifonica.com/api/account/operations/adapteridsgetmodels/) Permissions for working with models are in [roles and permissions](https://docs.aiva.apifonica.com/concepts/roles-and-permissions/). ## What an agent can do An agent is a scenario bound to a number or pool of numbers and a schedule. Scenarios are built from bricks in the scenario builder or through the API; a call runs the published version. - **Inbound and outbound calls.** Outbound calls are placed one at a time through the API, or by call automations over a segment, on demand or in scheduled windows, with retries. - **Understanding the caller.** Speech recognition, intent recognition and data extraction from answers: contract number, address, date. The AI question brick handles free-form dialogue with a language model. - **Speaking.** Synthesised speech, pre-recorded audio files and audio sequences, background audio; synthesis can be pre-loaded ahead of the phrase. - **Working with data during the call.** The HTTP request brick calls an external system and maps the response into scenario variables; Variables and Conditions bricks drive the logic, and custom code goes into JavaScript. - **Caller identification.** The phone number is only the first step. If no match or several matches are found, the agent asks for an account number or login, recognises it from speech and checks it against your system before disclosing anything. - **Transfer to an operator** with the conversation context. - **SMS** from the scenario through a connected SMS provider. - **Recording consent.** A dedicated brick asks the caller for consent to record the call. - **Goals and business metrics.** Bricks that mark what the call achieved, for reporting on outcomes. - **Reusable sub-scenarios.** A scenario can call another one, passing data in and out through Input and Output bricks. - **Results.** The outcome of each call, step history, dialogue, recording and transcript, by request or webhook. See [monitoring and results](https://docs.aiva.apifonica.com/integration/monitoring/). ## Web console Everything an agent does is set up and monitored in the web console. The same operations are available through the [Account API](https://docs.aiva.apifonica.com/api/account/). | Section | What it is for | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------ | | Dashboard | What the account’s lines are doing right now: agents, line usage, running automations, call and minute activity | | Agents | Voice agents that run scenarios on inbound and outbound calls; each is bound to a scenario and a number | | Automations | Outbound calls over a segment through one agent, on demand or in scheduled windows | | Conversations | Call history with recording, transcript, recognised intents and variables set at each step | | Scenarios | The scenario builder: conversation flows as a graph of bricks, with sub-scenarios and a test call from the builder | | Contacts and segments | People your agents call, the data collected about them, and groups of contacts to call as one | | Numbers, SMS providers, users | Account setup. Numbers and users synced from your system are shown read-only and changed only there | Scenario bricks: | Group | Bricks | | ------------------------ | ------------------------------------------------------------------------------------- | | Asking and understanding | Question, AI question | | Speaking | Text-to-speech, Pre-load Text-to-speech, Audio file, Audio sequence, Background audio | | Logic and data | Variables, Conditions, HTTP request, JavaScript, Custom | | Actions | Call transfer, SMS, Recording Consent | | Outcomes | Goal, Business Metric | | Sub-scenarios | Input, Output | ## Telephony Calls go over SIP through a trunk. A number is a record in the platform; a trunk is the actual voice path to your carrier. Without a working trunk, nothing dials. See [trunks and numbers](https://docs.aiva.apifonica.com/concepts/object-model/#trunks-and-numbers). | Parameter | Value | | ----------------- | ----------------------------------------------------------------------------------- | | Trunk connection | IP peering without registration (default) or SIP registration | | Transport | UDP, TCP or TLS | | Codecs | G.722, PCMU, PCMA | | Bandwidth | About 100 kbit/s per call in each direction (G.711) | | Network | No NAT; explicit RTP port range | | Numbers and pools | An agent on a pool answers on all its numbers; a number belongs to at most one pool | | Lines | Concurrent call limit per account | Network options, firewall and SBC are in section 2 of the [deployment scoping checklist](https://docs.aiva.apifonica.com/integration/deployment-scoping-checklist/); trunk setup is in [phase 1](https://docs.aiva.apifonica.com/integration/phase-1-onboarding/). ## Calling your API from a scenario If your API speaks HTTP(S) and returns JSON, no changes are needed on your side: the call is configured in the HTTP request brick (runScenarioWebhook in the API). | What | How | | ------------- | --------------------------------------------------------------------------------------------------------------------------- | | Request | Any HTTP method and URL; body as a typed string or form fields; custom headers; call variables substituted into the request | | Authorisation | Basic, Bearer or a custom header; optionally through a proxy | | Response | Values from the body (JSONPath) or headers are mapped into scenario variables, each with a default | | Mode | Synchronous with a timeout, or asynchronous; optionally with call metadata attached | | Errors | An unreachable system or a response code of 300 or above gives status `fail`, handled by the scenario as a failed call | | Testing | A call can be run on test data: the response shows the code, timing, body and a ready-made curl command | All configuration fields are in [runScenarioWebhook](https://docs.aiva.apifonica.com/api/account/operations/runscenariowebhook/); the list of system call variables is in [getSystemVariables](https://docs.aiva.apifonica.com/api/account/operations/getsystemvariables/). ## All integration mechanisms Beyond calls from scenarios, everything available in the web console is also available through the [Account API](https://docs.aiva.apifonica.com/api/account/). | Mechanism | What it gives | | ------------------------ | -------------------------------------------------------------------------------------------------------------------- | | Sync by `external_id` | Numbers, pools and users carry your system’s identifiers; the tenant can lock resources so only sync changes them | | Contacts | Create and update subscribers with your own data fields, search with a query language, export | | Segments and sources | Call lists: upload a whole file or append, add rows through the API, validation and rejected rows | | Call automations | Start and stop, attempts, progress, reset dialling for a contact | | Single calls | Place a call with subscriber data; call event stream, history, recording of the conversation and the caller’s speech | | Result delivery | Agent webhooks; list of deliveries, correction and resend | | SMS | Connect your own SMS provider and send through the API or from a scenario | | Edge functions | Versioned JavaScript functions, callable from scenarios and through the API | | Knowledge base | Upload and update documents for language model answers (RAG): tariffs, services, procedures | | Recognition dictionaries | Your own vocabulary: tariff, service and place names | | Classifiers and entities | Create and train your own topic classifiers, extract entities from text | | Model adapters | Direct access to recognition, synthesis and language models through the API | | Analytics | Summaries by calls, lines and contacts for your reports | | Users and keys | Provision users from your system, sign-in by magic link, issue and revoke keys | Result webhooks are stored until delivered and may arrive more than once, so your handler must be idempotent by communication id. See [monitoring and results](https://docs.aiva.apifonica.com/integration/monitoring/). ## Platform API REST over HTTPS, specifications in OpenAPI, bearer key authorisation. There are two APIs; the key determines which one answers. | API | For | Access | Specification | | ----------- | -------------------------------------------------------------------- | ----------------------------- | ---------------------------------------------------------------------------- | | Tenant API | Accounts, trunks, keys, tenant users | Tenant key | [tenant-api.yaml](https://docs.aiva.apifonica.com/openapi/tenant-api.yaml) | | Account API | Scenarios, agents, numbers, contacts, calls and results, SMS, models | Account key, own account only | [account-api.yaml](https://docs.aiva.apifonica.com/openapi/account-api.yaml) | - **Keys and roles.** Keys have a limited lifetime and can be revoked; five fixed roles plus custom roles built on them. See [identity and access](https://docs.aiva.apifonica.com/concepts/identity/) and [roles and permissions](https://docs.aiva.apifonica.com/concepts/roles-and-permissions/). - **Versions.** Changes and breaking changes are in the [changelog](https://docs.aiva.apifonica.com/api/changelog/). - **Reference.** [Account API](https://docs.aiva.apifonica.com/api/account/) and [Tenant API](https://docs.aiva.apifonica.com/api/tenant/); all operations in one file: [llms-api.txt](https://docs.aiva.apifonica.com/llms-api.txt). Every page is also available as markdown: add `index.md` to the page URL. ## Resources A minimal fault-tolerant installation has three nodes per role: PostgreSQL, Kafka and Redis work by quorum. | Option | Minimum | Details | | ---------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | Cloud virtual machines | 15 machines: 36 vCPU, 120 GB RAM, 1.3 TB plus object storage for recordings | [System requirements: cloud](https://docs.aiva.apifonica.com/integration/system-requirements-cloud/) | | Your own hardware | 3 servers: 60 threads, 192 GB RAM, 4.8 TB | [System requirements: on-premises](https://docs.aiva.apifonica.com/integration/system-requirements-on-premises/) | Key hardware requirements: - AVX-512 VNNI instructions on intent recognition nodes; without them, processing is about six times slower - Dedicated vCPUs without overcommit: audio is processed in real time - SSD or NVMe for databases, 1 Gbit/s per node - Database backups on separate storage, about 140 GB Sizing inputs (peak concurrent calls, calls per day, duration, share of recorded calls and their retention) are collected in section 11 of the [checklist](https://docs.aiva.apifonica.com/integration/deployment-scoping-checklist/). ## Deployment Integration runs in three phases, each with its own owner. | Phase | What it covers | Who does it | | --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -------------------------------------- | | [1. Infrastructure and connection](https://docs.aiva.apifonica.com/integration/phase-1-onboarding/) | Requirements check, installation, SIP trunk, tenant and first key | Apifonica together with your engineers | | [2. API integration](https://docs.aiva.apifonica.com/integration/phase-2-api-integration/) | Keys, sync of accounts, numbers and pools, user sign-in, checklist validation | Your engineers, validated by Apifonica | | [3. Configuration](https://docs.aiva.apifonica.com/integration/phase-3-configuration/) | Scenarios, agents, automations | Agreed per project | Before installation, go through the [deployment scoping checklist](https://docs.aiva.apifonica.com/integration/deployment-scoping-checklist/): compute and disks, network and telephony, TLS, storage, Kubernetes, configuration, secrets, observability, image registry, support and load. It also lists what must be reachable from outside: model providers, the image registry, inbound SIP and RTP from your carrier. **Next steps:** [Your first automated call](https://docs.aiva.apifonica.com/getting-started/first-call/), [Object model](https://docs.aiva.apifonica.com/concepts/object-model/), [Integration guide](https://docs.aiva.apifonica.com/integration/)