A7C

Interview transcription and AI chat built around Celery chains, embeddings, and context routing

Built for a client processing large volumes of interviews. Celery orchestrates the recordings, the system embeds uploaded documents, and a tag system controls which context slices each interview can reach, so the AI chat answers from the right material rather than the whole corpus.

Interview transcription and AI chat built around Celery chains, embeddings, and context routing

Problem

Process high volumes of video interviews from raw recording to searchable transcript, and put a context-aware AI chat on each interview detail page without retrieval bleeding across unrelated interviews.

Approach

Celery chains coordinate the transcription pipeline: a recording upload triggers a task sequence that calls an external transcription provider, stores the structured transcript, and marks the interview as ready. The system embeds context documents uploaded per interview via OpenAI and stores them in pgvector. A tag system on each interview entity controls which embedding segments retrieval can reach, so the chat never pulls context from another interview.

Architecture

Django backend with DRF APIs, Celery chains for pipeline orchestration, Redis as broker. Embeddings live in pgvector (a PostgreSQL extension). The AI chat runs on a custom fork of agno with tag-scoped retrieval. A third-party provider handles external transcription, integrated at the chain boundary.

Outcome

A production platform handles high interview volumes with automated transcription. The tag-based context routing fixed the generic-retrieval problem: chat responses stay scoped to the material uploaded for that interview rather than returning noise from the full document corpus.

Context and problem

The client runs many interviews and needed the whole workflow automated: recordings arrive, get transcribed, and the resulting interview record becomes the basis for an AI chat session. The simple retrieval approach, embed everything and retrieve globally, mixes context from unrelated interviews. That hurts when a reviewer uses the chat to assess one candidate or session.

Transcription pipeline

Video recordings move through a Celery chain that coordinates each stage: upload confirmation, dispatch to an external transcription provider, result polling, transcript storage, and a status update on the interview entity. Chains rather than independent tasks let each stage read the prior stage's output, and a failure at any step halts the chain instead of leaving partially processed records. We made the pipeline re-entrant, so a failed job requeues from the last stable state without duplicating work.

Embedding and context routing

Interviewers upload supporting documents with each interview: guides, reference material, scoring criteria. The system embeds these with OpenAI embeddings and stores them in pgvector. The core design decision was the tag system: each embedded chunk carries a tag for the interview entity it belongs to. At retrieval time, the query reaches only the chunks tagged for the current interview. So the AI chat on an interview detail page works over a bounded, relevant context slice rather than the full document corpus.

agno fork

The upstream agno library did not support the tag-scoped retrieval pattern. We maintain a custom fork that adds tag-aware filtering at the retrieval layer and leaves the rest of the library's orchestration primitives intact. We kept the fork small, changing only the retrieval path, to limit the maintenance surface against upstream changes.

© 2017 - 2026 · A7C