---
title: "Store call audio, transcripts and embeddings so a voice agent can retrieve them"
description: "Keep the recording, the transcript, and the embeddings on one table so a voice agent can retrieve a later call by meaning and land on the call id plus seconds. Store the file as an Audio column with call metadata, transcribe with Whisper or a hosted speech-to-text API, split into timestamped segments, and index the text. Pixeltable is the unified multimodal AI backend for that store; it is not a voice-agent platform like Vapi or Retell."
keywords:
  - voice agent audio storage
  - call center transcription
  - asr pipeline
  - audio transcription pipeline
  - whisper api transcription
  - speaker diarization
  - bulk audio transcription python
  - transcribe audio openai whisper
  - AI automation workflow
  - audio AI pipeline
complexity: "beginner"
estimated_time: "20 min"
url: "https://www.pixeltable.com/use-cases/audio-transcription-pipeline"
---

# Store call audio, transcripts and embeddings so a voice agent can retrieve them

Keep the recording, the transcript, and the embeddings on one table so a voice agent can retrieve a later call by meaning and land on the call id plus seconds. Store the file as an Audio column with call metadata, transcribe with Whisper or a hosted speech-to-text API, split into timestamped segments, and index the text. Pixeltable is the unified multimodal AI backend for that store; it is not a voice-agent platform like Vapi or Retell.

## Prerequisites

- Basic Python programming
- Call recordings or other audio files to insert

## The Problem

Voice-agent builders are told to stitch S3 (or another bucket) for the recording, Postgres plus pgvector or a dedicated vector engine (Qdrant, Pinecone, Weaviate) for embeddings, and a queue to run Whisper or a hosted STT API. The agent then has to join a vector hit back to a call id and a timestamp you stored by hand. Voice platforms such as Vapi and Retell store recordings as part of the call product; they are not an owned table of audio, transcripts, and embeddings you query later. Call-center, meeting, and support recordings have the same ASR-pipeline shape.

## The Solution

One table holds the call recording (Audio), metadata (call id, agent, customer, timestamps), a transcript computed column (whisper.transcribe locally, openai.transcriptions for a hosted OpenAI model, or a UDF you write for Deepgram, AssemblyAI, or another STT vendor), timestamped segments from audio_splitter, an embedding index on segment text, and an optional LLM summary. The agent retrieves by similarity and gets back the call id plus segment_start in seconds. Insert a new recording and only that file is transcribed. Pixeltable is not Vapi or Retell; keep those when the voice platform is the contract, and land their recording on this table when you need retrieval you own.

## Implementation

### Store the recording and call metadata

Each call is a row: typed Audio plus the ids a later retrieval must return. Apply with pxt schema update; do not call create_table at import.

```python
import pixeltable as pxt
from pixeltable.functions.audio import audio_splitter
from pixeltable.functions.huggingface import sentence_transformer
from pixeltable.functions.whisper import transcribe

TableModel = pxt.model_base()
text_embed = sentence_transformer.using(model_id='all-MiniLM-L6-v2')

class Recordings(TableModel, name='recordings'):
    call_id: pxt.String
    agent: pxt.String
    customer: pxt.String
    started_at: pxt.Timestamp
    audio: pxt.Audio
```

A path string is not enough: splitting and transcription need a typed Audio column. started_at is call metadata, not the word timestamp; those live on the segment view.


### Split, transcribe, and index segments

audio_splitter emits one row per slice with segment_start, segment_end, and audio_segment. Whisper on audio_segment writes the text. The embedding index is declared on that text.

```python
class Segments(
    TableModel,
    name='segments',
    base=Recordings,
    iterator=audio_splitter(audio=Recordings.audio, duration=30.0),
):
    transcript = transcribe(audio_segment, model='base').text.astype(pxt.String)
    __indexes__ = [
        pxt.EmbeddingIndex(transcript, string_embed=text_embed),
    ]

# Hosted OpenAI on the same column shape:
# from pixeltable.functions.openai import transcriptions
# transcript = transcriptions(audio_segment, model='gpt-transcribe').text.astype(pxt.String)
```

duration=30.0 is the documented starting slice for local Whisper. Pass exactly one of duration or max_size. A hosted STT API is a different UDF on the same column; Deepgram and AssemblyAI are not first-party modules, so wrap their SDK in a UDF if that vendor is the contract.


### Retrieve the call id and the second

Embed the agent question the same way. Nearest segments come back with the parent call_id and segment_start so the hit is a moment, not only a filename.

```python
@pxt.query
def search_calls(query: str, limit: int = 5):
    sim = Segments.transcript.similarity(string=query)
    return (
        Segments.order_by(sim, asc=False)
        .limit(limit)
        .select(
            call_id=Recordings.call_id,
            agent=Recordings.agent,
            customer=Recordings.customer,
            segment_start=Segments.segment_start,
            segment_end=Segments.segment_end,
            text=Segments.transcript,
            score=sim,
        )
    )
```

Seek the parent recording to segment_start. A filename alone is not a timestamp. Optional: add a summary column on Recordings with chat_completions over a flattened transcript.


### Optional summary and speaker labels

A summary is another computed column on the parent row. Speaker diarization is WhisperX (pyannote), not openai-whisper by itself.

```python
from pixeltable.functions.whisperx import transcribe as whisperx_transcribe

# Add this assignment to the existing Recordings class:
diarized = whisperx_transcribe(
    audio, model='tiny.en', language='en', diarize=True
)

# pxt schema update app.py recordings -f
# Insert a recording; only that row transcribes.
```

diarize=True needs HF_TOKEN for the default pyannote pipeline on WhisperX 3.8+. whisperx.transcribe runs whisperx.align only in that branch; diarize=False returns a transcript with no word timestamps. The WhisperX cookbook splits word/speaker segments with list_iterator. A call summary is a chat_completions column over text you flatten with a UDF; there is no first-party flatten helper. This first index does not require diarization.


## Where call audio, transcripts, and embeddings live

| Job | S3 + Postgres/pgvector + Qdrant/Pinecone/Weaviate + queue | Voice platform (Vapi, Retell) | Pixeltable |
| --- | --- | --- | --- |
| Store the recording | Object storage plus a metadata database | The platform stores the call as part of the product | An Audio column on a table you own |
| Transcribe | A worker calls Whisper or a hosted STT API | Vendor transcription, if that product includes it | whisper.transcribe, openai.transcriptions, or a UDF you write |
| Timestamps | You store offsets next to the vector by hand | Vendor-dependent | segment_start and segment_end on the splitter view |
| Embeddings and retrieval | pgvector or a dedicated vector engine you keep aligned | Not an owned index of your calls | EmbeddingIndex on segment text; similarity returns call id + seconds |
| New call | Enqueue a task; retry the DAG | The next call on that platform | Insert a row; only that file is transcribed and indexed |

## Benefits

- The recording, transcript, embeddings, and timestamps live on one table instead of S3 plus a vector DB plus a queue
- A similarity hit returns call id and seconds, so the agent can seek the moment
- A new call transcribes only that file; unchanged rows keep stored text
- Provider computed-column calls are rate-limited; HTTP 429 retries that row
- Local whisper.transcribe needs no API key; openai.transcriptions is the hosted OpenAI path

## Use Cases

- Voice-agent memory: retrieve a prior call by meaning and play from that second
- Call-center transcription and quality review over support recordings
- Meeting and communications archives (standups, sales calls, interviews)
- Contact-center ASR pipelines that used to dump text next to a WAV

## Requirements

- Python 3.11+
- pip install -U 'pixeltable[serve]'
- ffmpeg for audio decoding
- openai-whisper for whisper.transcribe (no API key)
- sentence-transformers for the segment EmbeddingIndex
- Optional: OpenAI API key for openai.transcriptions and chat_completions
- Optional: WhisperX plus HF_TOKEN for diarize=True

## Resources

- [What is Whisper?](https://www.pixeltable.com/learn/what-is-whisper) - A speech-recognition model family that writes a transcript
- [WhisperX vs faster-whisper vs a hosted speech API](https://www.pixeltable.com/learn/whisperx-vs-faster-whisper-vs-hosted-api) - Runtime, timestamps, speakers, and where the file may go
- [How do I transcribe audio uploads and make them searchable?](https://www.pixeltable.com/learn/how-to/transcribe-audio-and-search-it) - audio_splitter, Whisper, EmbeddingIndex, FastAPIRouter
- [What is an audio embedding?](https://www.pixeltable.com/learn/what-is-an-audio-embedding) - A vector for similar speech, not only exact words
- [Transcribe audio files with Whisper](https://docs.pixeltable.com/howto/cookbooks/audio/audio-transcribe) - Docs: local openai-whisper on an Audio column
- [WhisperX transcription and speakers](https://docs.pixeltable.com/howto/cookbooks/audio/whisperx-transcription) - Docs: alignment and pyannote diarization
- [AI Automation Workflow: The Pipeline Is the Table](https://www.pixeltable.com/blog/ai-automation-workflow) - Whisper on insert is an AI automation workflow
- [CallSense: sales call intelligence](https://www.pixeltable.com/blog/callsense-sales-call-intelligence) - Recordings, transcripts, and search as a product shape

## Frequently asked questions

### How do I add speaker diarization? {#faq-1}

openai-whisper does not label speakers. Pixeltable's first-party path is whisperx.transcribe(..., diarize=True), which uses WhisperX alignment plus a pyannote pipeline (default speaker-diarization-community-1 on WhisperX 3.8+). That needs an accepted Hugging Face token (HF_TOKEN). The WhisperX cookbook splits those segments with list_iterator. Other diarizers are a UDF you write.

### Can the agent retrieve the exact moment in a call? {#faq-2}

Yes, if you store timestamped segments. audio_splitter writes segment_start and segment_end in seconds on each view row. Return those from the similarity query and seek the parent Audio to segment_start. A filename or a whole-file transcript is not a moment.

### How are API calls rate-limited when I transcribe thousands of calls? {#faq-3}

Pixeltable rate-limits provider calls made from computed columns so inserts do not stampede the API. An HTTP 429 waits and retries that row. Other rows are not marked done if they never ran. This page does not publish a concurrency number. Local whisper.transcribe is not an HTTP API; it still runs per new or changed row only.

### Can I use Deepgram or AssemblyAI instead of Whisper? {#faq-4}

Yes as the model on a computed column, not as a first-party Pixeltable module. Wrap the vendor SDK in a UDF and assign it like whisper.transcribe. openai.transcriptions is the documented hosted OpenAI path (model is a string, for example gpt-transcribe). This page does not rank those vendors or quote their prices.

### Do I still need Vapi or Retell? {#faq-5}

Keep a voice platform when it owns the live call, the phone network, and the recording upload. Pixeltable owns the table of audio, transcripts, embeddings, and timestamps you query later. Land the platform's recording on an Audio column when you need retrieval you own.

### What happens when a new call arrives? {#faq-6}

Insert a row. Only that file is split, transcribed, and indexed. Unchanged calls keep their stored transcripts. A Python loop that restarts from file zero will re-pay every minute.

## How-to guides

- [How do I transcribe audio uploads and make them searchable?](https://www.pixeltable.com/learn/how-to/transcribe-audio-and-search-it)

