#Runtime can't find LangGraph agent "POST /assistants/search HTTP/1.1" 404 Not Found

1 messages · Page 1 of 1 (latest)

rugged niche
#

Hi,
I'm trying to use an existing LangGraph agent with Python SDK.

The runtime get 404 errors when chatting with bot :

INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO: 192.168.1.72:53417 - "GET /threads/a6cc11aa-9acd-4ce5-a2fe-71e3e0161470/state HTTP/1.1" 404 Not Found
INFO: 192.168.1.72:53417 - "POST /assistants/search HTTP/1.1" 404 Not Found

Here is the LangGraph agent code in main.py and launched with command uvicorn main:app --host 0.0.0.0 --port 800

graph = build_graph(rag_service)
app = FastAPI()
add_langgraph_fastapi_endpoint(
app=app,
agent=LangGraphAGUIAgent(
name="sample_agent", # the name of your agent defined in langgraph.json
description="Describe your agent here, will be used for multi-agent orchestration",
graph=graph, # the graph object from your langgraph import
),
path="/", # the endpoint you'd like to serve your agent on
)

And the CopilotKit runtime code within a NextJS router

const runtime = new CopilotRuntime({
remoteEndpoints: [
// Uncomment this if you want to use LangGraph JS, make sure to
// remove the remote action url below too.
//
langGraphPlatformEndpoint({
deploymentUrl: "http://192.168.1.72:8000",
agents: [
{
name: "sample_agent",
description: "A helpful LLM agent.",
},
],
})
],
});

It seems it is not a network issue as the LangGraph server get calls to "GET /threads/a6cc11aa-9acd-4ce5-a2fe-71e3e0161470/state HTTP/1.1" 404 Not Found and "POST /assistants/search HTTP/1.1" 404 Not Found but I can't figure if it is runtime doing bad requests or LangGraph not responding as it should be.

Any help appreciated 🙂

indigo mauveBOT
#

Try changing your Next.js runtime configuration to use LangGraphHttpAgent instead of langGraphPlatformEndpoint:

const runtime = new CopilotRuntime({
  agents: {
    'sample_agent': new LangGraphHttpAgent({
      url: "http://192.168.1.72:8000", // Your FastAPI endpoint
    }),
  }
});