AI agent
Dagu AI agent is an LLM-powered assistant integrated into the Web UI. It can read, create, and modify your workflows through a chat interface with tool-calling capabilities.
Quick Setup
Enable AI agent — Toggle it on in the Web UI at
/agent-settings, or set the environment variableDAGU_AGENT_ENABLED=true.Add a model — Click Add Model in the settings page and configure an LLM provider. Supported providers:
anthropic,openai,openai-codex,gemini,openrouter,zai,opencode,local(Ollama, vLLM, etc.).For
openai-codex, connect the ChatGPT Plus/Pro subscription in the model form before saving the model.Set a default model — Click the star icon next to a model to make it the default.
Once configured, click the AI agent button at the bottom-left corner of any page to start chatting.
If you are using Ollama or another local model server, read Local AI before setting the Base URL. Dagu expects an OpenAI-compatible base such as http://localhost:11434/v1, not a native Ollama endpoint like /api/generate.
For the full built-in steward configuration surface, start with AI agent Settings. The settings docs are split into focused pages for models, tool policy, personality, and web search.
CLI Agent
Use dagu agent to chat with the same agent from a terminal.
dagu agent -p "create a DAG that backs up /var/log every night"
dagu agent --model gpt-4.1 -p "review this workflow"
dagu agent history
dagu agent resume <session-id>
dagu agent resume <session-id> -p "continue from here"dagu agent uses the active CLI context. To connect to a remote Dagu server, configure it with dagu context add and then use dagu context use <name> or dagu --context <name> agent ....
Available Tools
AI agent can use these built-in tools. Some are only available when the corresponding feature is configured:
| Tool | Description |
|---|---|
bash | Execute shell commands (120s default timeout, 600s max) |
read | Read file contents with line numbers |
patch | Create, edit, or delete files |
think | Record reasoning without side effects |
navigate | Open pages in the Dagu UI |
ask_user | Prompt the user with options or free-text input |
delegate | Spawn sub-agents for parallel tasks |
web_search | Search the web through Tavily or Firecrawl when a hosted web backend is configured |
web_extract | Extract readable content from web pages through Tavily or Firecrawl when a hosted web backend is configured |
remote_agent | Delegate tasks to agents on remote nodes (when remote nodes are configured) |
list_contexts | List available remote nodes for remote_agent (when remote nodes are configured) |
Model-native web search is configured from Web Search and is not exposed as a separate callable tool.
Tools can be individually enabled or disabled in Tool Permissions & Bash Policy.
Agent in Workflows
You can use AI capabilities directly in your DAG steps in two ways.
Agent Action (action: agent.run)
A multi-turn tool-calling loop — the agent reads files, runs commands, edits code, and iterates until the task is complete:
steps:
- id: fix_config
action: agent.run
with:
messages:
- role: user
content: |
Fix the invalid database_url in /etc/app/config.yaml
output: RESULTChat Action (action: chat.completion)
A single-shot LLM call — send a prompt and get a response, no tool use:
steps:
- id: summarize
action: chat.completion
with:
provider: openai
model: gpt-4o
messages:
- role: user
content: |
Summarize today's error logs.
output: SUMMARYAI Coding Tool Integration
Use the Dagu skill and MCP server for external AI coding tools (Claude Code, Codex, Gemini CLI, and other MCP-capable clients).
Install the Dagu skill when you want an AI coding tool to write correct Dagu DAG files:
gh skill install dagucloud/dagu daguConnect the Dagu MCP server when you want a tool to operate a running Dagu server. Start Dagu and configure the client to use the Streamable HTTP endpoint:
http://localhost:8080/mcpThe MCP server exposes dagu_read, dagu_change, and dagu_execute for reading state, previewing or applying DAG changes, and controlling DAG runs.
See MCP Server and CLI Commands for more details.
See Also
- AI agent Documentation — Complete guide to AI agent and its configuration
- AI agent Settings — Start here for the built-in Web UI steward settings
- Models & Providers — Add models and set the default model
- Tool Permissions & Bash Policy — Control tools and bash rules
- Web Search — Configure model-native search, Tavily, or Firecrawl
- Personality — Configure profiles
- Agent Step — Using the agent as a workflow step
- AI agent Tools Reference — Detailed tool parameter documentation
- MCP Server — Connect external MCP clients to a running Dagu server
- Workflow Operator — Use the built-in steward from Slack, Telegram, Discord, or LINE
- Basic Chat — Single-shot LLM calls in workflows
- OpenCode — Kimi, DeepSeek, GLM, Qwen via OpenCode subscription
- Local AI — Ollama, vLLM, and other local OpenAI-compatible servers
