| Name | Type | Description |
|---|---|---|
params | CreateDeepAgentParams<TResponse, ContextSchema, TMiddleware, TSubagents, TTools, TStreamTransformers> | Default: ... |
Create a Deep Agent.
This is the main entry point for building a production-style agent with deepagents. It gives you a strong default runtime (filesystem, tasks, subagents, summarization) and lets you opt into skills, memory, human-in-the-loop interrupts, async subagents, and custom middleware.
The runtime is intentionally opinionated: defaults work out of the box, and when you customize behavior, the middleware ordering stays deterministic.
Configuration parameters for the agent
// Middleware with custom state
const ResearchMiddleware = createMiddleware({
name: "ResearchMiddleware",
stateSchema: z.object({ research: z.string().default("") }),
});
const agent = createDeepAgent({
middleware: [ResearchMiddleware],
});
const result = await agent.invoke({ messages: [...] });
// result.research is properly typed as string