This is a simple example to talk with a langgraph agent in realtime using speech with livekit.
cp example.env .envFill in the values in the .env file.
uv syncTo install the dependencies.
-
Create an account in livekit to get the url and api-key/secret
-
Before your first run, you must download certain models such as Silero VAD and the LiveKit turn detector:
uv run livekit_agent.py download-files
-
Next, run this command to speak to your agent directly in your terminal:
uv run livekit_agent.py console
-
To run the agent for use with a frontend or telephony, use the dev command:
uv run livekit_agent.py dev
-
In production, use the start command:
uv run livekit_agent.py start
-
Frontend starter templates:
-
Use the pre-built frontend starter apps from livekit to speak to the agent from frontend.
- Eg. Web voice AI assistant with React & Next.js: https://github.com/livekit-examples/agent-starter-react
git clone https://github.com/livekit-examples/agent-starter-react.gitcd agent-starter-reactnpm installnpm run dev
-
Run the agent in dev or production mode to chat through frontend
uv run livekit_agent.py devuv run livekit_agent.py start
-