self-host langgraph
Some checks failed
Build and Push Agent Docker Image / build (push) Failing after 20s
Build and Push Web Docker Image / build (push) Failing after 3m10s

This commit is contained in:
2025-12-13 00:01:34 +01:00
parent 76e222a786
commit 0ff215c34f
7 changed files with 68 additions and 623 deletions

View File

@@ -2,9 +2,9 @@ import {
CopilotRuntime,
ExperimentalEmptyAdapter,
copilotRuntimeNextJSAppRouterEndpoint,
LangGraphHttpAgent,
} from "@copilotkit/runtime";
import { LangGraphAgent } from "@ag-ui/langgraph"
import { NextRequest } from "next/server";
import { auth0 } from "@/lib/auth0";
@@ -23,18 +23,11 @@ export const POST = async (req: NextRequest) => {
console.log("[copilotkit] session exists:", !!session);
console.log("[copilotkit] userRoles:", userRoles);
// 2. Create the CopilotRuntime instance with Auth0 configuration
// 2. Create the CopilotRuntime instance with self-hosted agent
const runtime = new CopilotRuntime({
agents: {
"vpi_1000": new LangGraphAgent({
deploymentUrl: process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8123",
graphId: "vpi_1000",
langsmithApiKey: process.env.LANGSMITH_API_KEY || "",
assistantConfig: {
context: {
auth0_user_roles: userRoles,
}
} as any
"vpi_1000": new LangGraphHttpAgent({
url: process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8000",
}),
}
});