> For the complete documentation index, see [llms.txt](https://docs.karini.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.karini.ai/prompt-management/deep-agent-beta.md).

# Deep Agent

Deep Agent runs long, multi-step tasks with human approval points, sub-agents, skills, and persistent state for production workflows.

Deep Agent is Karini AI's agent type for long, multi-step tasks in production. It extends the standard [Agent](https://docs.karini.ai/prompt-management/agentic-prompts.md) with controlled interruption points for human approval, sub-agent orchestration, reusable skills, and persistent state, so complex work can pause, resume, and hand off without losing context.

### Key Features

Deep Agent enables controlled, modular, and stateful AI workflows for production environments. It prioritizes safety, composability, and transparency, with governance and oversight built in.

#### 1. Human in the Loop (HITL)

Human in the Loop is a governance mechanism that designates specific tools as controlled interruption points within a workflow. When the agent calls one, execution pauses and the system preserves its current state until a person approves, edits, or rejects the action, or supplies missing input.

This gives you oversight over high-impact or irreversible operations, strengthens risk controls, and supports compliance and audit requirements. By building approval checkpoints directly into tool execution, Deep Agent keeps automation within defined operational and regulatory boundaries. Every deep agent also gets the built-in `interrupt-request` skill for structured human-in-the-loop escalation.

#### 2. Sub-Agent Orchestration

Specialized agents can be attached as callable tools, so a deep agent can delegate parts of a task to sub-agents. This promotes modularity, separation of concerns, and reuse across workflows. Complex objectives break down into domain-specific sub-tasks, improving scalability and maintainability.

#### 3. Skills

Skills are reusable packages of instructions, scripts, and reference files that an agent loads only when a task needs them. Instead of carrying every instruction in a long system prompt, a deep agent sees a one-line description of each skill and reads the full instructions on demand, then runs the skill's tested scripts in a secure sandbox. Skills are authored and versioned in the [Skills Library](https://docs.karini.ai/skills-library.md), attached to an agent from the **Skills** tab in Prompt Playground, and pinned to a specific published version. Sub-agents inherit their parent's skills in addition to their own. For details, see [Skill Execution in Deep Agent and Agent](https://docs.karini.ai/skills-library/skill-execution-in-deepagent-and-agent.md).

#### 4. Thread Management and Persistent State

Deep Agent keeps execution state across the workflow lifecycle, so it can resume deterministically after an interruption and hold multi-turn, stateful conversations. Files the agent generates during a run are kept in persistent storage and can be accessed and streamed directly. For stateless workflows, you can disable conversation history.

#### 5. Observability and Resilience

Real-time event streaming shows each step as it happens, including nested sub-agent activity, and the Think tool streams the agent's reasoning. Model fallback, timeout handling, and retries keep long-running tasks resilient. Prompt caching works across deep agents and their sub-agents, so the repeated system prompt, tool definitions, and conversation history are billed at cache-read rates on every iteration.

### Key Components of Deep Agent

Deep Agent follows the same architectural model as [Agentic prompts](https://docs.karini.ai/prompt-management/agentic-prompts.md). The core components are:

* Large Language Model (LLM)
* Deep Agent Prompt
* Tools
* Skills
* MCP Server
