Real-time voice search that cites its sources
An example of talking to your knowledge base instead of typing at it.

What it does This sample implements the VoiceRAG pattern: a browser-based voice interface streams audio to a Python backend, which calls the Azure OpenAI GPT-4o Realtime API. When you ask a question, the backend retrieves relevant documents from Azure AI Search and feeds them to the model so the spoken answer is grounded in your data. The app also displays citations for the search results it used.
The interesting bit
Instead of chaining separate speech-to-text and text-to-speech services, the app uses GPT-4o’s native audio capabilities end-to-end. The backend’s RTMiddleTier orchestrates the realtime websocket connection and injects Azure AI Search results directly into the conversation, letting the model answer with a voice that actually knows your documents.
Key highlights
- End-to-end voice: browser microphone input and audio output via the GPT-4o Realtime API.
- RAG with citations: retrieves documents from Azure AI Search and shows which sources were used to generate the answer.
- Azure-native deployment: includes infrastructure-as-code and a Dockerfile for Azure Container Apps, with Managed Identity for authentication.
- Local development supported: can point the backend at existing Azure OpenAI and AI Search instances.
- Synthetic sample data included for demonstration (Contoso electronics policies).
Caveats
- Deployment incurs immediate Azure costs, primarily from AI Search, and charges may accrue even if you interrupt the provisioning command.
- The list of available Azure OpenAI deployment regions is tied to model availability and may become outdated.
- This is explicitly a demonstration sample, not a production-hardened framework.
Verdict Worth a look if you are building voice-first Azure AI apps and need a working reference for realtime audio plus retrieval. Skip it if you want a cloud-agnostic solution or a finished product without Azure lock-in.
Frequently asked
- What is Azure-Samples/aisearch-openai-rag-audio?
- An example of talking to your knowledge base instead of typing at it.
- Is aisearch-openai-rag-audio open source?
- Yes — Azure-Samples/aisearch-openai-rag-audio is open source, released under the MIT license.
- What language is aisearch-openai-rag-audio written in?
- Azure-Samples/aisearch-openai-rag-audio is primarily written in Python.
- How popular is aisearch-openai-rag-audio?
- Azure-Samples/aisearch-openai-rag-audio has 560 stars on GitHub.
- Where can I find aisearch-openai-rag-audio?
- Azure-Samples/aisearch-openai-rag-audio is on GitHub at https://github.com/Azure-Samples/aisearch-openai-rag-audio.