Files
livekit-agents/python/livekit-plugins/livekit-plugins-langchain
github-actions[bot]andgithub-actions[bot] dc8eed21e1 livekit-agents@2.0.0b2 (#8659)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-18 13:28:33 -08:00
..
2026-11-18 13:28:33 -08:00

LangChain plugin for LiveKit Agents

This plugin integrates capabilites from LangChain within LiveKit Agents

Installation

pip install livekit-plugins-langchain

Usage

Using LangGraph workflows

You can bring over any existing workflow in LangGraph as an Agents LLM with langchain.LLMAdapter. For example:

from langgraph.graph import StateGraph
from livekit.agents import Agent, AgentServer, JobContext, VoiceSession
from livekit.plugins import langchain

server = AgentServer()


@server.rtc_session()
async def entrypoint(ctx: JobContext):
    graph = StateGraph(...).compile()

    session = VoiceSession(
        vad=...,
        stt=...,
        tts=...,
    )

    await session.start(
        agent=Agent(instructions="", llm=langchain.LLMAdapter(graph)),
    )
    ...