Description:
When initializing the LiveKit agent with LangGraphAdapter and passing a configuration containing a checkpoint namespace (e.g., config={"configurable": {"checkpoint_ns": "default"}}), I encounter the following error:
ValueError: Subgraph default not found {"pid": 64267, "job_id": "AJ_LegKv7JBjNAv"}
Steps to Reproduce:
1. Compile a graph in a file (e.g., my_graph.py) with an in‑memory checkpointer:
from langgraph.checkpoint.memory import MemorySaver
from langgraph.graph import StateGraph, START, END
from langgraph.graph.message import add_messages
from typing import Annotated
from typing_extensions import TypedDict
class State(TypedDict):
messages: Annotated[list, add_messages]
graph_builder = StateGraph(State)
# Set up the LLM node.
from langchain_openai import OpenAI
llm = OpenAI()
def chatbot(state: State):
return {"messages": [llm.invoke(state["messages"])]}
graph_builder.add_node("chatbot", chatbot)
graph_builder.add_edge(START, "chatbot")
graph_builder.add_edge("chatbot", END)
checkpointer = MemorySaver()
graph = graph_builder.compile(checkpointer=checkpointer)
2. In the LiveKit agent initialization (e.g., in heartrate_agent.py or langgraph_agent.py), instantiate LangGraphAdapter with:
llm=LangGraphAdapter(graph, config={"configurable": {"checkpoint_ns": "default"}})
3. Run the agent. The error appears when the adapter calls `aget_state` on the graph.
Expected Behavior:
The adapter should find the checkpoint namespace “default” and proceed without error.
Actual Behavior:
The error “Subgraph default not found” is raised, indicating that the configuration does not match the compiled graph’s checkpoint information.
Additional Context:
• LiveKit agent version: 0.12.16
• LangGraph package version: 0.3.21
• The error suggests that the adapter is expecting a subgraph with the name “default” that isn’t defined in the graph.
• Workaround: Adjusting the configuration (or graph definition) might resolve the issue, but documentation guidance on the expected config keys for checkpointing is unclear.
Request:
Could you please clarify the correct configuration format for LangGraphAdapter checkpointing? It would be helpful to have documentation or an example that demonstrates how to define a subgraph (or checkpoint namespace) that the adapter expects, or how to properly pass configuration so that the adapter does not raise a “Subgraph default not found” error.
Thank you!
Description:
When initializing the LiveKit agent with LangGraphAdapter and passing a configuration containing a checkpoint namespace (e.g., config={"configurable": {"checkpoint_ns": "default"}}), I encounter the following error:
Steps to Reproduce:
1. Compile a graph in a file (e.g., my_graph.py) with an in‑memory checkpointer:
Expected Behavior:
The adapter should find the checkpoint namespace “default” and proceed without error.
Actual Behavior:
The error “Subgraph default not found” is raised, indicating that the configuration does not match the compiled graph’s checkpoint information.
Additional Context:
• LiveKit agent version: 0.12.16
• LangGraph package version: 0.3.21
• The error suggests that the adapter is expecting a subgraph with the name “default” that isn’t defined in the graph.
• Workaround: Adjusting the configuration (or graph definition) might resolve the issue, but documentation guidance on the expected config keys for checkpointing is unclear.
Request:
Could you please clarify the correct configuration format for LangGraphAdapter checkpointing? It would be helpful to have documentation or an example that demonstrates how to define a subgraph (or checkpoint namespace) that the adapter expects, or how to properly pass configuration so that the adapter does not raise a “Subgraph default not found” error.
Thank you!