new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

deepagents/setup

13 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Deep Agents authentication strategy

Deep Agents always drives the Anthropic client. Non-Anthropic models reach it through AI Gateway's Anthropic-compatible endpoint, which translates to any model (Gemini, OpenAI, etc.) including tool calls. Authentication is resolved from the host environment and forwarded to the sandbox bridge, following this priority: explicit Anthropic auth first, then AI Gateway credentials, then ambient Anthropic credentials.

Deep Agents supported environment variables for authentication

Supported environment variables are: AI_GATEWAY_API_KEY, VERCEL_OIDC_TOKEN, AI_GATEWAY_BASE_URL, ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_BASE_URL.

Deep Agents non-Anthropic model authentication example

```ts const harness = createDeepAgents({ model: 'google/gemini-2.5-flash', auth: { gateway: { apiKey: process.env.AI_GATEWAY_API_KEY, }, }, }); ``` This example shows how to route a non-Anthropic model through AI Gateway with explicit auth settings.

Deep Agents sandbox requirements

Deep Agents requires a network sandbox with at least one exposed port, such as @ai-sdk/sandbox-vercel configured with runtime 'node24' and ports array (e.g., [4000]).

Deep Agents session resumption limitation

Resuming a stopped session's conversation is not supported. After session.stop(), Deep Agents' in-memory conversation state (LangGraph MemorySaver) is gone; only the sandbox workspace persists via its snapshot. Use session.detach() for cross-process handoff or session.suspendTurn() for turn continuation while keeping the live bridge running.

Deep Agents manual compaction not supported

Manual compaction is not supported in Deep Agents harness adapter.

Deep Agents is experimental

Harness packages are experimental. Expect breaking changes between releases as this early API gets further refined.

Deep Agents bridge Node dependencies bootstrap

The adapter bootstraps the bridge's Node dependencies (the deepagents package and LangChain) inside the sandbox via pnpm when the first session starts.

Deep Agents harness overview

The Deep Agents harness adapter connects HarnessAgent to Deep Agents, a LangGraph-based agent runtime. The adapter runs a Node bridge inside the sandbox that drives the deepagents package and streams its streamEvents output back to the host over a sandbox-exposed WebSocket.

Deep Agents harness adapter packages to install

Install @ai-sdk/harness, @ai-sdk/harness-deepagents, and @ai-sdk/sandbox-vercel to use the Deep Agents harness adapter.

Deep Agents import statement

Import deepAgents and createDeepAgents from '@ai-sdk/harness-deepagents'. The deepAgents export is equivalent to createDeepAgents() with default configuration.

Deep Agents basic usage example

```ts import { HarnessAgent } from '@ai-sdk/harness/agent'; import { deepAgents } from '@ai-sdk/harness-deepagents'; import { createVercelSandbox } from '@ai-sdk/sandbox-vercel'; const agent = new HarnessAgent({ harness: deepAgents, sandbox: createVercelSandbox({ runtime: 'node24', ports: [4000], }), }); const session = await agent.createSession(); let exitCode = 0; try { const result = await agent.stream({ session, prompt: 'Analyze this codebase and suggest improvements.', }); for await (const part of result.stream) { if (part.type === 'text-delta') { process.stdout.write(part.text); } } } catch (err) { exitCode = 1; console.error(err); } finally { await session.destroy(); process.exit(exitCode); } ``` This example shows how to create and run a Deep Agents harness agent with a Vercel sandbox.

Deep Agents environment variable requirements

To use the Deep Agents harness agent, environment variables must include VERCEL_OIDC_TOKEN for Vercel Sandbox, and one of the authentication variables for the model provider.

Give your agent this brain