interface DeepAgentConfigOptional backend for filesystem operations. Can be either a backend instance or a factory function that creates one. The factory receives a config object with state and store.
Optional checkpointer for persisting agent state between runs
Commands capability
Optional schema for context (not persisted between invocations)
Optional list of memory file paths (AGENTS.md files) to load (e.g., ["~/.deepagents/AGENTS.md", "./.deepagents/AGENTS.md"]). Display names are automatically derived from paths. Memory is loaded at agent startup and added into the system prompt.
Custom middleware to apply after standard middleware
The model to use (model name string or LanguageModelLike instance). Defaults to claude-sonnet-4-5-20250929
Environment variable name (e.g. "OPENAI_API_KEY")
Filesystem permission rules for this agent.
Rules are evaluated in declaration order; first match wins; permissive
default. Applied to ls, read_file, write_file, edit_file, glob,
and grep. Subagents inherit these rules unless they specify their own
permissions field.
createDeepAgent({
permissions: [
{ operations: ["read"], paths: ["/workspace/**"] },
{ operations: ["read"], paths: ["/**"], mode: "deny" },
],
});Structured output response format for the agent (Zod schema or other format)
Optional list of skill source paths (e.g., ["/skills/user/", "/skills/project/"]).
Paths use POSIX conventions (forward slashes) and are relative to the backend's root. Later sources override earlier ones for skills with the same name (last one wins).
// With FilesystemBackend - skills loaded from disk
const agent = await createDeepAgent({
backend: new FilesystemBackend({ rootDir: "/home/user/.deepagents" }),
skills: ["/skills/"],
});
// With StateBackend - skills provided in state
const agent = await createDeepAgent({
skills: ["/skills/"],
});
const result = await agent.invoke({
messages: [...],
files: {
"/skills/my-skill/SKILL.md": {
content: ["---", "name: my-skill", "description: ...", "---", "# My Skill"],
created_at: new Date().toISOString(),
modified_at: new Date().toISOString(),
},
},
});Optional schema for custom agent state. Allows you to define custom state properties
beyond built-in messages, todos, and files. These properties can be accessed
in hooks, middleware, and throughout the agent's execution.
Unlike contextSchema the state is persisted between agent invocations when using a
checkpointer, making it suitable for maintaining conversation history, user preferences,
or any other data that should persist across multiple interactions.
import { StateSchema } from "@langchain/langgraph";
import { z } from "zod";
const agent = createDeepAgent({
stateSchema: new StateSchema({
author: z.string().default("unknown"),
}),
});
const result = await agent.invoke({
messages: [{ role: "user", content: "Take a note" }],
author: "Me",
});
// result.author is typed `string`Optional store for persisting longterm memories
Optional StreamTransformer factories to register with the underlying agent.
Deepagents always registers its built-in subagent transformer; custom
transformers are appended after it and are exposed on run.extensions
when using streamEvents(..., { version: "v3" }).
List of subagent specifications for task delegation.
Supports sync SubAgents, CompiledSubAgents, and AsyncSubAgents in the same array.
AsyncSubAgents (identified by their graphId field) are automatically separated
at runtime and wired to the async SubAgent middleware.
Custom system prompt for the agent. This will be combined with the base agent prompt
Tools the agent should have access to
Configuration for a DeepAgent exposed via ACP
Extends CreateDeepAgentParams from deepagents with ACP-specific fields.
The name field is required for ACP session routing.