> 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 is Karini AI's agent type for long, multi-step tasks in production. It extends the standard [Agent](/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)**

#### 1. Tool Interruption and Human-in-the-Loop

You can designate specific tools as interruption points. When the agent calls one, execution pauses until a person approves, edits, or rejects the action, or supplies missing input. This enforces governance over high-impact or irreversible operations, and suits production systems that need auditability and risk controls. Every deep agent also gets the built-in `interrupt-request` skill for structured human-in-the-loop escalation.

**Human in the Loop (HITL)** in Deep Agent is a governance mechanism that designates specific tools as controlled interruption points within a workflow. When an interrupt tool is invoked, execution is automatically paused and the system preserves its current state until a human operator provides approval, rejection, or additional input. This structured intervention model enables oversight over high-impact or irreversible operations, strengthens risk mitigation controls, and supports compliance and audit requirements. By embedding approval checkpoints directly into tool execution, Deep Agent ensures that automation operates within defined operational and regulatory boundaries while maintaining workflow integrity and accountability.

#### 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, 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.

#### 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](/prompt-management/agentic-prompts.md). The core components are:

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