Skip to content

tim-yung/livekit_langgraph

Repository files navigation

Building audio/telephony/Virtual avatar agents with Livekit & LangGraph

Prerequisites

  1. Follow the instructions in the reference documents to:
    • Install LiveKit and Twilio CLI
    • Configure the Twilio SIP trunk for inbound and outbound calls
    • Connect the Twilio SIP trunk to LiveKit
    • Set up LiveKit Cloud
  2. Have an AI Agent ready (either a LangGraph agent hosted at a local/public URL or a LiveKit AI Agent)
  3. Have all necessary API keys ready according to the .env.template file

Available agents

Agent Description
quickstart_agent.py A basic Livekit agent that can be used as a starting point
livekit_phone_calling_agent.py A basic Livekit agent enhanced with telephony capabilities
langgraph_phone_calling_agent.py A LangGraph agent enhanced with audio and telephony capabilities
langgraph_agent_avatar.py A LangGraph agent enhanced with audio and AI Avatar

Instructions

Setup and Run

  1. Create and activate virtual environment:

    uv venv && source .venv/bin/activate
  2. Download model files (only need to do this once):

    uv run langgraph_phone_calling_agent.py download-files
  3. Run the agent (could be any agents provided in this repository):

    uv run langgraph_phone_calling_agent.py dev

Testing Options

For Audio Agent and Avatar Agent

For Phone Calling Agent

  • Use the following terminal command to start the phone call:
    lk dispatch create \
        --new-room \
        --agent-name my-telephony-agent \
        --metadata '{"phone_number": "+15105550123"}' # insert your own phone number here

Custom Langgraph plugins

Refer to temp_plugin/langchain

References

  1. LiveKit Voice AI Guide
  2. LiveKit Telephony Guide
  3. Configuring SIP Trunk
  4. Configuring Twilio Trunk

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages