explaingit

vimal2023/astra-duplex-agent

Analysis updated 2026-05-18

0PythonAudience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

A voice AI agent that lets users interrupt it mid-sentence and keeps track of exactly what was already said, using sub-50ms speech detection.

Mindmap

mindmap
  root((astra-duplex-agent))
    What it does
      Interruption-aware voice AI
      Sub-50ms VAD
      Partial memory state
    Tech stack
      Python FastAPI
      React
      LangGraph
      Groq + ElevenLabs
    Use cases
      Voice assistant prototypes
      Real-time pipelines
    Audience
      Developers
      Hackathon builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Prototype a voice assistant that can be naturally interrupted mid-response.

USE CASE 2

Study a real-time WebSocket pipeline connecting speech-to-text, an LLM, and text-to-speech.

USE CASE 3

Learn how partial AI responses can be saved and resumed after an interruption.

USE CASE 4

Build a hackathon demo of full-duplex conversational AI.

What is it built with?

PythonFastAPIReactLangGraphGroqElevenLabs

How does it compare?

vimal2023/astra-duplex-agent0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity4/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Needs API keys for Groq, ElevenLabs, and Upstash Redis plus a local Python and Node setup.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Astra Duplex Agent is a voice AI assistant built for a hackathon, designed to solve a common frustration with talking to AI: most voice agents make you wait for them to finish speaking before you can interrupt, and if you do interrupt them, they forget what they were saying. This project lets a person talk to the AI and interrupt it mid-sentence, with the AI keeping track of exactly what it had already said before being cut off, so the conversation can continue naturally instead of restarting. The system listens for a person's voice using a sound-detection component called Silero VAD, which reacts in well under 50 milliseconds and immediately stops the AI's text generation and audio playback. The part of its reply that had already been spoken is saved to a database, so the next response can pick up from that exact point or shift smoothly to whatever new topic the person raised. Behind the scenes, the project uses a browser-based microphone and audio player connected over a live two-way connection to a Python server. That server converts speech to text using Groq's hosted version of Whisper, generates responses using a Llama language model, and converts the reply back to speech using ElevenLabs. A tool called LangGraph coordinates the steps of listening, thinking, and speaking as a repeatable cycle. The project is written mostly in Python for the server and React for the browser interface, and it is released under the MIT license, meaning it can be freely used, copied, and modified, including for commercial purposes. A recorded video demo is linked in the project description for anyone who wants to see it working before trying it themselves.

Copy-paste prompts

Prompt 1
Explain how astra-duplex-agent detects and handles a user interrupting the AI mid-response.
Prompt 2
Walk me through the WebSocket flow between the React client and the FastAPI backend in this project.
Prompt 3
Show me how LangGraph orchestrates the STT, LLM, and TTS steps here.
Prompt 4
Help me set up Groq and ElevenLabs API keys to run astra-duplex-agent locally.

Frequently asked questions

What is astra-duplex-agent?

A voice AI agent that lets users interrupt it mid-sentence and keeps track of exactly what was already said, using sub-50ms speech detection.

What language is astra-duplex-agent written in?

Mainly Python. The stack also includes Python, FastAPI, React.

What license does astra-duplex-agent use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is astra-duplex-agent to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is astra-duplex-agent for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.