diff --git a/server/aiGatewayServer.ts b/server/aiGatewayServer.ts index 87d57b86b..3283abe5b 100644 --- a/server/aiGatewayServer.ts +++ b/server/aiGatewayServer.ts @@ -21,7 +21,9 @@ export function createAiGatewayServer() { aiGatewayServer.use(helmet()); aiGatewayServer.use(cors()); - aiGatewayServer.use(express.json()); + // AI requests can carry large payloads (long conversation history, tool + // results, embedded documents), well beyond express.json()'s 100kb default. + aiGatewayServer.use(express.json({ limit: "50mb" })); aiGatewayServer.use(createAiGatewayRouter());