# Telnyx AI: Embedding & RAG — Full Documentation > Complete page content for Embedding & RAG (AI section) of the Telnyx developer docs (https://developers.telnyx.com). > Root index: https://developers.telnyx.com/llms.txt · Lightweight index for this subsection: https://telnyx.com/llms/ai/embedding-rag.txt ## Conversation History ### Overview > Source: https://developers.telnyx.com/docs/inference/embedding-rag/conversation-history.md Conversation History stores and indexes conversation records so your agents can search previous interactions and use them as memory or retrieval context. ## How It Works 1. Enable conversation persistence on a supported source. 2. Telnyx stores and indexes the conversation record. 3. Search the indexed history by text, record type, region, and filters. 4. Use search results as retrieval context for RAG. ## Next Steps - [Feature coverage](/docs/inference/embedding-rag/conversation-history/feature-coverage) - [Search conversation history](/docs/inference/embedding-rag/conversation-history/searching) - [Review retention](/docs/inference/embedding-rag/conversation-history/retention) - [View pricing](/docs/inference/embedding-rag/conversation-history/pricing) --- ### Feature Coverage > Source: https://developers.telnyx.com/docs/inference/embedding-rag/conversation-history/feature-coverage.md Conversation History coverage is organized by communication channel. Voice records are currently available from SIP connections. ## Voice Voice coverage currently includes call history from SIP connections. Enable `conversation_persistence` on a covered SIP connection resource to store and index voice conversation history. ### Supported Connection Types - `ip_connections` - `credential_connections` - `fqdn_connections` ### Enable ```http PATCH /v2/credential_connections/{id} ``` ```json { "conversation_persistence": true } ``` ### Disable ```http PATCH /v2/credential_connections/{id} ``` ```json { "conversation_persistence": false } ``` ### Verify ```http GET /v2/credential_connections/{id} ``` The response includes `conversation_persistence` on the connection resource. ## Messaging Coming soon. ## Email Coming soon. --- ### Searching > Source: https://developers.telnyx.com/docs/inference/embedding-rag/conversation-history/searching.md Run a semantic search across persisted conversation records with `GET /v2/ai/conversation_histories`. Your query text is embedded into a vector and matched against indexed transcript chunks, so each result is a single chunk with a relevance `score` and its parent record's metadata — ready to use as retrieval context for RAG. ```bash curl --globoff \ -H "Authorization: Bearer $TELNYX_API_KEY" \ "https://api.telnyx.com/v2/ai/conversation_histories?q=flight+refund&record_type=voice&top_k=10" ``` Pass a query (`q`) and a `record_type` (use `voice` for SIP call history). Narrow results with the `region`, `min_score`, and `filter[field][operator]` parameters. See the **Search conversation histories** API reference for the full set of parameters, filter operators, the response schema, and SDK code samples. --- ### Retention > Source: https://developers.telnyx.com/docs/inference/embedding-rag/conversation-history/retention.md Conversation History includes 30 days of indexed retention for persisted conversation records. ## Default Retention Conversation History stores and indexes covered conversation records for 30 days by default. During the included retention period, records can be returned by the Conversation Histories API when they match the search query and filters. ## After 30 Days After the included 30-day retention period, records are no longer retained for indexed Conversation History search unless extended retention is enabled. ## Retention Scope This retention behavior applies to Conversation History indexing and search. It does not describe retention for the source product that generated the record, such as call recordings, messaging records, or other product-specific storage. --- ### Pricing > Source: https://developers.telnyx.com/docs/inference/embedding-rag/conversation-history/pricing.md Conversation History pricing has three parts: persisted text, extended storage, and search. ## Rates | Usage | Price | Notes | | --- | --- | --- | | Embed and persist | `$0.0015 / 1K characters` | Billed once on input transcript characters. Includes 30 days of retention. | | Storage after 30 days | `$0.60 / GiB-month` | Applies only when extended retention is enabled. | | Vector search | `$0.003 / search` | First 10,000 searches per month are free of charge. | ## Example A 10-minute call with about 10,000 transcript characters and one search within the free tier would be priced as: | Line Item | Calculation | Price | | --- | --- | --- | | Embed and persist | `10K characters * $0.0015` | `$0.015` | | Storage within 30 days | Included | `$0.00` | | One vector search | Included in the first 10,000 searches per month | `$0.00` | | Total | | `~$0.015` | --- ## API Reference (Embedding & RAG) ### Conversation Histories - [Search conversation histories](https://developers.telnyx.com/api-reference/conversation-histories/search-conversation-histories.md): Performs semantic vector search across conversation history records.