swift-fountain-58437
07/10/2025, 5:14 PMtall-airline-16756
07/10/2025, 5:15 PMtall-airline-16756
07/10/2025, 5:16 PMlivekit-plugins-langchain
package. This enables you to embed LangGraph workflows and LangChain agents directly as the LLM component within LiveKit voice agents. The core adapter is the LLMAdapter
class, which allows seamless communication between LiveKit voice constructs and LangGraph workflows, including support for streaming, state management, and message format conversion.
You can install the official integration with:
pip install livekit-plugins-langchain
Here is an official code example adapted from the integration documentation (examples/voice_agents/langgraph_agent.py
):
from langchain.chat_models import init_chat_model
from langgraph.graph import START, StateGraph
from livekit.plugins import langchain
def create_graph() -> StateGraph:
openai_llm = init_chat_model(model="openai:gpt-4o")
def chatbot_node(state):
return {"messages": [openai_llm.invoke(state["messages"])])}
builder = StateGraph(State)
builder.add_node("chatbot", chatbot_node)
builder.add_edge(START, "chatbot")
return builder.compile()
async def entrypoint(ctx):
graph = create_graph()
agent = Agent(
instructions="",
llm=langchain.LLMAdapter(graph),
)
# ...rest of the setup
This integration uses the LLMAdapter
to bridge between LiveKit Agents and LangGraph. You can use your custom workflows as the core logic for your voice agents.
There is no information about an official Agno integration, nor about a distinct `langgraph-livekit-plugin`—the livekit-plugins-langchain
is the recommended and maintained integration from LiveKit.
For further detail and comprehensive resources, refer to the official package documentation and examples/voice_agents/langgraph_agent.py
inside the LiveKit examples directory.
(Supported versions include langchain-core >= 0.3.0
, langgraph >= 0.3.0
, and livekit-agents >= 1.1.5
.)
Sources: livekit-plugins/livekit-plugins-langchain/livekit/plugins/langchain/py.type... | LLM Integrations | livekit/livekit_composite | DeepWikiswift-fountain-58437
07/10/2025, 5:17 PMtall-airline-16756
07/10/2025, 5:19 PMLLMAdapter
to create a smooth voice agent integration. I'll break it down in a friendly, easy-to-understand way.
from langgraph.graph import StateGraph, START
from livekit.agents import Agent, AgentSession, JobContext
from livekit.plugins import langchain, deepgram, silero
from livekit.plugins.turn_detector.multilingual import MultilingualModel
class State(TypedDict):
messages: Annotated[list[BaseMessage], add_messages]
def create_graph():
# Define your custom workflow
builder = StateGraph(State)
builder.add_node("chatbot", chatbot_node)
builder.add_edge(START, "chatbot")
return builder.compile()
async def entrypoint(ctx: JobContext):
graph = create_graph()
agent = Agent(
instructions="",
llm=langchain.LLMAdapter(graph),
)
session = AgentSession(
vad=silero.VAD.load(),
stt=deepgram.STT(model="nova-3", language="multi"),
tts=deepgram.TTS(),
turn_detection=MultilingualModel(),
)
await session.start(
agent=agent,
room=ctx.room,
)
Let me walk you through the key integration points:
• LLMAdapter
is like a friendly translator that connects your LangGraph workflow with the LiveKit agent. It helps route messages smoothly.
• Make sure to include compatible STT, TTS, and VAD components in AgentSession
. Don't worry - non-streaming components get automatically wrapped to play nice together.
• Set up turn detection to keep the conversation flowing naturally.
• Just double-check that your workflow nodes can handle the message format (LiveKit and LLM messages get converted automatically, so it's pretty seamless).
If you're still scratching your head about TTS or graph connections, no worries! Double-check that your workflow is compiled correctly and that AgentSession
components are playing well together. The official example voice_agents/langgraph_agent.py
is a great reference - it shows a tried-and-true setup (using deepgram
and silero
as plugin solutions, but you can swap these out).
Stuck on something specific? Drop me the details about your graph structure or any errors you're seeing, and I'll be happy to help you troubleshoot!
Sources: livekit-agents/livekit/agents/voice/agent.py | LLM Integrations | livekit/livekit_composite | DeepWikiswift-fountain-58437
07/11/2025, 4:10 AMtall-airline-16756
07/11/2025, 4:11 AM