Telnyx AI: Search — Full Documentation
Complete page content for Search (AI section) of the Telnyx developer docs (https://developers.telnyx.com). This file: https://developers.telnyx.com/development/llms/ai-search-llms-full-txt.md · Root index: https://developers.telnyx.com/llms.txt
Search
Overview
Source: https://developers.telnyx.com/docs/ai-search.mdSearch is a managed search service over the data your Telnyx account already holds. Create a collection, attach sources, and query them with natural language through one retrieval API. Telnyx handles embedding, indexing, and ranking. Voice call transcriptions are searchable today; meetings, messaging, and stored documents are coming soon. It is retrieval-only by design: every search returns scored, source-attributed chunks ready to ground any LLM. Generation belongs to your application — bring your own model.
How It Works
- Create a collection — a named container with retrieval settings. Creating one is instant: a collection is a pointer, not a copy.
- Attach sources — mix voice, meeting, messaging, and bucket sources in one collection.
- Configure settings — retrieval mode and result count, with per-request overrides.
- Search — one
GETreturns ranked chunks with scores, metadata, and source attribution.
Sources
A collection can include any combination of these source types:
Conversation-backed sources index what conversation persistence has stored for the account — new calls become searchable minutes after they end.
Next Steps
First collection to first search in a few minutes. Indexing, querying, and what a collection actually is. Vector, keyword, and hybrid retrieval compared. The retrieval call: parameters, filters, pagination, errors.Get Started
Source: https://developers.telnyx.com/docs/ai-search/get-started.mdCreate a collection, attach your voice call transcriptions as a source, and search them with natural language. This quickstart uses the REST API — every step is a copy-paste request.
Prerequisites
- A Telnyx API key from the portal. Export it so the examples work as-is:
- Content to search. The
voicesource indexes your account’s persisted voice call transcriptions — see how to enable persistence. An account with no persisted transcriptions returns empty results, but the API calls below still work.
name is required; everything else has defaults.
uuid (used by the management API) and the slug, derived from name (used by the search API). Default settings apply — top_k: 5, retrieval_type: vector. The collection has no sources yet, so there is nothing to search.
Add the voice source — your account’s call transcriptions:
ready and its content is indexed for search. More source types are coming soon — see Sources.
Search is a GET on the collection’s documents, addressed by slug:
record_id, record_type, timestamps, and metadata. The match works on meaning, not exact words: “did we promise a refund” finds “the refund has been deposited”.
Per-request parameters override the collection defaults for that one request:
Next Steps
The indexing and query pipelines, and what a collection actually is. Attach sources and enable the data behind them. Configure retrieval mode and result count per collection. Filters, pagination, document reassembly, and errors.Search
Source: https://developers.telnyx.com/docs/ai-search/searching.mdSearch is the retrieval call that ranks a collection’s documents by relevance to a query. It lives at the documents sub-resource — a
GET on the collection’s documents with the query as a filter.
Shape
Search is aGET on the documents sub-resource with the query as a query parameter. With no query it’s a plain date-sorted catalog listing; with a query it’s a ranked vector retrieval (hybrid and keyword are coming soon). The collection is addressed by slug (customer-facing), not uuid.
A collection with no searchable sources returns
422 (see Errors).
Basic vs Advanced
A search can be as simple as a plain natural-language question, or as rich as a source-scoped, filtered, paginated retrieval call. Choose the tab that matches how much control you need. A basic search sends only thequery. The collection’s settings decide how many results come back (top_k, default 5) and how they are ranked (retrieval_type).
top_k, sources, filter[field][op], and pagination on top of the query.
Query Parameters
Field Filters
The samefilter[field][op]=value system the search/documents endpoints already use. Operators: eq, in, gte, gt, lte, lt, contains. Multiple filters AND together.
Known top-level fields: record_type, record_id, user_id, record_created_at, ingested_at, plus any other name -> a metadata.* filter (pass the bare key, e.g. filter[call_id]=...). region and score are not filterable -> 400.
For vector search the filter is applied pre-kNN, so it narrows candidates without distorting scores.
Advanced Example
Reconstructing a Document
Search and listing share one endpoint — the presence ofquery decides the behavior. Omit query to get a plain, date-ordered listing instead of a ranked search.
During indexing, a transcription or file is split into multiple chunks. To retrieve every chunk that belongs to a single record — for example to reassemble one full transcript — omit query and filter by record_id:
query, results come back in date order rather than by relevance score, and the request is not billed as a search event. Each chunk carries chunk_index and chunk_total, so you can order the chunks (chunk_index ascending) and reassemble the complete document text.
Because a collection’s sources can be stored across multiple regions, a fan-out search may return the same chunk once per region (duplicate id values with different region values). Deduplicate by id before sorting by chunk_index, otherwise reassembled text repeats sections.
page[size] is echoed in the response meta but does not limit how many chunks are returned — top_k governs the array length. To retrieve every chunk of a record, set top_k high enough to cover chunk_total (up to the maximum of 50) rather than relying on pagination.
When copying curl examples that use bracketed keys like filter[...] or page[...], pass --globoff (curl otherwise treats [ and ] as glob/range syntax and the request fails before it is sent).
Errors
Search errors are returned in the standard Telnyx error envelope with a numeric code:400 is returned for malformed requests — for example filtering on a non-filterable field such as region or score.
Billing
Each ranked search (a request with aquery parameter) counts as one billable search event. Browsing a collection’s documents without a query (catalog listing) is free. See Pricing for rates.
Concepts
How Search Works
Source: https://developers.telnyx.com/docs/ai-search/how-it-works.mdSearch has two core processes: indexing, which turns your content into searchable chunks continuously in the background, and querying, which retrieves the most relevant chunks for a request. Understanding both explains why collections are cheap to create and why search results look the way they do.
How Indexing Works
Each source system owns its own ingestion — content becomes searchable without any per-collection work:- Ingest — a data source is enabled for indexing. Voice transcriptions flow in as calls end, controlled by conversation persistence — a collection can only see what persistence has stored for the account.
- Chunk — each record (a transcript, a file) is split into chunks sized for retrieval. Chunks carry
chunk_indexandchunk_totalso a full record can be reassembled later. - Embed — each chunk is converted into a vector that captures its meaning, and stored in the source’s vector database alongside its metadata (
record_id, timestamps, origin fields).
How Querying Works
When you search a collection:- Resolve the collection — the collection’s sources and settings are looked up by slug; per-request parameters override settings for that request only.
- Embed the query — the query text is embedded with the same model family used at indexing time.
- Filter — any
filter[field][op]conditions are applied before nearest-neighbor search, so filters narrow the candidate set without distorting scores. - Fan out — the search runs against every searchable source in the collection, across all regions where content is stored.
- Merge — per-source, per-region results are merged into one list ranked by relevance
score, capped attop_k. - Return chunks — each chunk carries its text, score, and source metadata. Search stops here by design: generation belongs to your application.
A Collection Is a Pointer
Creating a collection only writes configuration rows — it does not copy, move, or re-embed content. This has practical consequences:- Creation is instant, and a new collection over already-indexed sources is immediately searchable.
- Removing a source or deleting a collection drops only collection-scoped artifacts. The underlying Telnyx data is never modified or deleted.
- The same source can back many collections at no extra indexing cost.
Search vs. the Embeddings APIs
Telnyx also ships lower-level building blocks — the Embeddings API embeds documents in a Storage bucket, andPOST /v2/ai/embeddings/similarity-search queries one bucket directly. Search is the managed layer above them:
If you are starting fresh, start with Search. Reach for the embeddings APIs when you need the primitive itself.
Search Modes
Source: https://developers.telnyx.com/docs/ai-search/search-modes.mdA collection’s
retrieval_type selects how queries are matched against indexed content. There are three modes. To see how each behaves, take one query a support team might run: “error 10015 on outbound call”.
Vector
Available The query is embedded into a vector and compared against indexed chunks by nearest-neighbor similarity. It matches on meaning, so wording can differ: “did we agree to a refund?” finds “we’ll credit the invoice”. For the example query, vector search understands the concept — call failures, error handling — and finds transcripts about failing outbound calls. Its blind spot is the literal string: the chunk containing exactly10015 may not rank first, because digits have weak semantic neighbors.
Best for natural-language questions where exact terms vary. This is the default mode.
Keyword
Coming soon Classic lexical search (BM25) — term-frequency ranking over the actual words, no embeddings. It matches on exact tokens, so it finds the chunk that literally contains10015. Its blind spot is paraphrase: a transcript that says “the call was rejected with a billing error” but never says “10015” is invisible to it.
Best for identifiers, error codes, SKUs, and names.
Hybrid
Coming soon Runs vector and keyword in parallel and fuses the two result sets into one ranking. For the example query it finds both the transcript with the literal10015 and the ones that only describe the failure — semantic recall plus exact-term precision in a single call, at the cost of slightly more work per request.
Best when queries are mixed or unpredictable.
Configuration
Collections
Source: https://developers.telnyx.com/docs/ai-search/manage-collections.mdA collection is the core resource in Search — a named container for data sources with its own retrieval settings. This page covers the full CRUD lifecycle. Sources and Settings have their own subresources, documented separately. Management operations address a collection by
uuid; search addresses it by slug.
Create a Collection
name is required. slug is derived from name when omitted and must be unique per organization. A collection may be created with or without initial sources. settings is optional — defaults apply (top_k = 5, retrieval_type = vector).
201 Created with the full collection record.
Slug Conflicts
If a collection with the same slug already exists for the account, the request returns409 Conflict:
List Collections
200 OK with the Telnyx V2 data + meta envelope — each item is a full collection record:
Pagination
Pagination is optional. Usepage[number]/page[size] query parameters (default size 20, max 100). Results are sorted by slug then created_at.
Retrieve a Collection by UUID
Lookup by UUID returns the full collection record.404 Not Found.
Retrieve a Collection by Slug
Lookup by slug returns the same full record. Slugs are unique per organization.404 Not Found.
Update Collection Metadata
PATCH updates metadata only (name, description). Partial — omitted fields are untouched. slug is immutable; renaming does not regenerate it. Sources and settings have their own subresources.
updated_at. Slug is unchanged.
Add, replace, and remove data sources.
Configure retrieval type and top_k.
Delete a Collection
Soft delete. Setsdeleted_at and status = deleted, then excludes the collection from list results and returns 404 on detail lookups. The slug is freed for reuse immediately.
No external data is touched — transcriptions, embeddings, and credential connections are not affected. Deleting an already-deleted or unknown collection returns 404.
204 No Content — no body.
Related
- Get started — first collection to first search
- Sources — add, replace, and remove data sources
- Settings — configure retrieval type and top_k
- Search — query a collection’s documents
Overview
Source: https://developers.telnyx.com/docs/ai-search/sources.mdSources are the data inputs a collection searches across. Each source type has its own page covering what it indexes and how to enable the underlying data:
Sources are managed through dedicated endpoints — never through collection
PATCH (which would be ambiguous about intent). When a source is added, the resource is created with status set to ready and its content is indexed for search.
Add One Source
POST /v2/ai/collections/{uuid}/sources adds a single source without touching the others.
201 Created with the new source object.
Replace All Sources
PUT /v2/ai/collections/{uuid}/sources replaces the complete source list. The server reconciles by logical identity:
voice— bysource_type
List Sources
Remove One Source
DELETE /v2/ai/collections/{uuid}/sources/{source_id} removes a single source; the rest are untouched. Excluded from new searches immediately — this detaches the collection’s pointer to the source only.
A source can back many collections, so detaching never starts physical cleanup of chunks, embeddings, or metadata. Never deletes the original Telnyx product data. Never disables a bucket or credential connection.
204 No Content — no body.
Related
- Collections — create, list, retrieve, update, and delete collections
- Settings — configure retrieval type and top_k
Voice
Source: https://developers.telnyx.com/docs/ai-search/sources/voice.mdThe
voice source indexes your account’s persisted voice call transcriptions. Calls become searchable minutes after they end — there is nothing to sync.
Attach the Source
Enable Voice Transcript Persistence
Voice transcripts are persisted per SIP connection. Setconversation_persistence to true on each connection whose calls you want transcribed, stored, and indexed:
Verify with a
GET on the connection — the response includes conversation_persistence. Set it to false to stop persisting new calls.
From then on, every call handled by that connection is transcribed and indexed automatically. Persisted records include 30 days of indexed retention — see Pricing for extended retention.
What a Result Looks Like
Voice chunks carryrecord_type: "voice" plus the call’s identifiers and timestamps:
sources=voice or filter on record fields — see Search.
Settings
Source: https://developers.telnyx.com/docs/ai-search/settings.mdSettings hold the collection’s default retrieval configuration in their own subresource — collection
PATCH never touches them. Settings are accessed at /v2/ai/collections/{uuid}/settings, and any setting can be overridden per request at search time.
retrieval_type selects how a query is matched against the collection’s indexed content — see Search Modes for how the modes differ and when to use each.
hybrid and keyword retrieval are coming soon. Keep retrieval_type set to vector — a collection set to hybrid cannot be searched yet.
Get Settings
Replace Settings
PUT replaces the entire settings object. Omitted keys reset to their defaults.
Merge Settings
PATCH does a partial merge at the retrieval key. Unnamed fields are preserved.
retrieval_type is unchanged.
Validation Errors
Unsupportedretrieval_type values return 422:
top_k outside 1—50 returns 422 with code invalid_top_k. Unrecognized fields in the retrieval object are rejected with 400.
Related
- Search Modes — vector, keyword, and hybrid compared
- Collections — create, list, retrieve, update, and delete collections
- Sources — add, replace, and remove data sources
API Reference (Search)
AI Collections
- Create a collection: Creates a new collection scoped to your organization. Optionally attach sources and retrieval settings at creation time. If
slugis omitted, one is derived f… - List collections: Returns a paginated list of collections in your organization.
- Get a collection by slug: Fetches a single collection by its
slug. - Get a collection: Fetches a single collection by its
uuid. - Update a collection: Updates a collection’s metadata (
nameand/ordescription). Sources and settings are managed through their own sub-resources. - Delete a collection: Soft-deletes a collection. Its
slugis freed and may be reused by a new collection. - List collection sources: Returns the sources attached to a collection.
- Add a collection source: Attaches a new source to a collection.
- Replace collection sources: Replaces the collection’s entire source set. The response
metareports which sources were added, retained, and removed. - Remove a collection source: Removes a single source from a collection.
- Get collection settings: Returns the retrieval settings for a collection.
- Replace collection settings: Replaces the collection’s retrieval settings.
- Update collection settings: Partially updates the collection’s retrieval settings.
- Search collection documents: Runs search over the documents in a collection, ranked by relevance to
query. The collection’sretrieval_typesetting selects the strategy:vector(seman…