Custom Agents & Tools — User Guide
Audience: Dagen users who want to create custom AI agents, manage knowledge documents, and fine-tune agent behaviour with instructions, skills, and rules.
→ For a dedicated guide to Agent Intelligence (instructions, skills, read_skill, rules, lessons, templates), see Agent Intelligence & Skills.
→ For AI code review on GitHub pull requests, see Git Reviews (AI on PRs).
Overview
Dagen provides three interconnected views for customizing how AI agents work in your workspace:
| View | Path | Purpose |
|---|---|---|
| AI Agent Builder | /agent-builder |
Create and manage custom agents and Python tools |
| Knowledge Base | /knowledge-base |
Upload and organize documents that agents can reference |
| Agent Intelligence | /agent-intelligence |
Configure instructions, skills (on-demand via read_skill), rules, and lessons — full guide: Agent Intelligence & Skills |
Part 1 — AI Agent Builder
The Agent Library
When you open the Agent Builder, you see the Agent Library with four tabs:
| Tab | Contents |
|---|---|
| Agents | Your custom agents |
| Templates | Pre-built agent templates you can clone |
| Tools | Custom Python tools you have created |
| Built-in | Predefined tools grouped by category |
The header displays stats showing how many Custom Agents, Agent Templates, and Custom Tools you have.
Creating an Agent
Quick Create (recommended)
- Click the Quick Create button in the header.
- Select Agent in the dialog.
- Describe what you want in plain English (e.g., "Create an agent that helps users analyze database performance and suggests optimizations").
- Click Create Agent. Dagen's AI builds the agent configuration for you.
From a Template
- Go to the Templates tab.
- Find a template that matches your use case.
- Click the Create Like button (copy icon) on the template card.
- Customize the name, instructions, and tools in the edit dialog.
- Click Create Agent.
Manual Creation
- Open the side chat panel by clicking AI Chat in the header.
- Describe your agent requirements in the chat — the AI will guide you through configuration.
Creating a Custom Tool
- Click Quick Create in the header.
- Select Tool.
- Describe the tool's purpose (e.g., "Create a tool that validates JSON schemas and returns detailed error messages").
- Click Create Tool. The AI generates the Python code.
You can also create tools via the side chat panel.
Editing Agents and Tools
- In the Agents tab, click the Edit button (pencil icon) on any agent card.
- In the edit dialog, you can change the Name, Instructions, and assign Tools (both custom and predefined).
- For tools, you can edit the Name, Description, and Python Code.
Testing an Agent
- In the Agents tab, click the Test button (play icon) on any agent card.
- A test chat dialog opens where you can interact with the agent directly.
- The agent greets you with its name and instructions summary.
Part 1b — Classic Agent Builder (tools + agents forms)
Some workspaces still use—or offer alongside the library—a two-column Agent Builder focused on explicit Python tools and hand-written instructions. Route is commonly /agent-builder or /agent. This path is ideal when you want full control over tool code without generating it only via AI.
Page layout
- Header — Agent Builder title, subtitle, and optional page-level alerts for save/delete feedback.
- Left column — Tools
- Add / Edit Tool card: Tool name (required, unique), Python code (required) defining the callable the agent can invoke.
- Available Tools list: each row can Edit or Delete (with confirmation).
- Right column — Agents
- Create / Edit Agent card: Agent name (required, unique; name may be locked when editing), Instructions / system prompt (required), Tool checkboxes (one or many tools per agent).
- Defined Agents list: shows name, assigned tools summary, instruction preview; Test, Edit, Delete for your agents.
Built-in vs custom agents
The list may include system (hardcoded) agents alongside builder-defined agents. Only custom agents are editable and deletable from this screen; built-ins are read-only in the UI but selectable in AI Chat.
Test dialog
Test opens an embedded chat against the selected agent so you validate instructions + tools before publishing workflows that call the agent.
When to use which path
| Approach | Best for |
|---|---|
| Quick Create / Templates / side chat | Fast iteration, prose-first specs, less boilerplate. |
| Classic two-column builder | Precise Python tools, regulated code review, copying tools between workspaces. |
Part 2 — Knowledge Base
Overview
The Knowledge Base (/knowledge-base) stores documents that agents retrieve during conversations (RAG). It is workspace-scoped—the same boundary as connections and jobs (workspace isolation).
Skills vs Knowledge Base: Agent Intelligence skills (Part 3 below) are procedural, loaded on demand via read_skill. The Knowledge Base is corpora of files you upload—policies, glossaries, runbooks—not a substitute for skills or for live database metadata.
It displays four summary cards:
| Metric | Description |
|---|---|
| Total Documents | Number of uploaded files |
| Total Size | Combined storage used |
| Folders | Number of organizational folders |
| Graph Nodes | Entities extracted for the knowledge graph |
Uploading Documents
- Click Upload Documents in the header.
- Select files from your computer in the upload dialog.
- After upload, a confirmation appears: "{count} document(s) uploaded successfully."
Organizing with Folders
- Click New Folder in the header.
- Enter a Folder Name (e.g., "reports", "documentation").
- Optionally select a Parent Folder to nest it.
- Click Create.
Browsing Documents
- Use the Search documents... field to find files by name.
- Filter by Folder or Type using the dropdown menus.
- Click column headers (Name, Size, Type, Modified) to sort.
- Select multiple documents with checkboxes, then click Delete Selected for bulk removal.
Viewing the Knowledge Graph
Click Knowledge Graph in the header (or click the Graph Nodes stat card) to open an interactive visualization of entities and relationships extracted from your documents.
Deleting Documents
- Click the Delete button (trash icon) on any document row.
- Confirm in the dialog: "Are you sure you want to delete {filename}? This action cannot be undone."
Part 3 — Agent Intelligence
Dedicated guide: Agent Intelligence & Skills — full coverage of skills,
read_skill, rules, lessons, templates, and/agent-intelligencetabs. The section below matches the in-app UI.
Overview
Agent Intelligence lets you fine-tune agent behaviour across your workspace. An info banner explains: "Make your agents smarter! Add custom instructions, define skills, and let agents learn from their mistakes."
The page has five tabs. In the product configuration model they correspond to types instructions, skills, rules, and lessons; Templates are a shortcut to preview and apply starter content into those types.
| Tab | Config type | Purpose |
|---|---|---|
| Instructions | instructions |
Always-on behavioural text; priority order; optional per-agent filter |
| Skills | skills |
On-demand expertise—trigger text + full body loaded via read_skill(name) |
| Rules | rules |
Hard constraints and guardrails |
| Lessons Learned | lessons |
Anti-patterns and corrections (categories: general, planning, verification, code_quality, communication, architecture, testing) |
| Templates | — | Preview / Apply to create instructions, skills, or rules quickly |
Adding an Instruction
- Go to the Instructions tab and click Add Instruction.
- Fill in the form:
- Name: A short, descriptive name.
- Content: The instruction text (supports Markdown).
- Priority: 0–100 slider (higher = applied first).
- Agents: Optionally restrict to specific agents, or leave empty to apply to all.
- Click Create.
Adding a Skill
Skills are loaded on demand: the agent sees the trigger first; the full definition loads when the agent invokes read_skill(name) — so large skill libraries do not flood the system prompt at once.
- Go to the Skills tab and click Add Skill.
- Fill in:
- Name: Skill name.
- Skill Trigger: A short description of when this skill should be used (e.g., "Use when formatting SQL queries or when user asks about code style").
- Content: The full skill definition.
- Priority and Agents (optional).
- Click Create.
Adding a Rule
- Go to the Rules tab and click Add Rule.
- Fill in Name, Content, Priority, and optionally restrict to specific Agents.
- Click Create.
Recording Lessons Learned
Lessons help agents avoid repeating mistakes.
- Go to the Lessons Learned tab and click Add Lesson.
- Fill in:
- Pattern: Describe the mistake or pattern to avoid.
- Correct Behavior: Describe what should be done instead.
- Category: Choose from general, planning, verification, code_quality, communication, architecture, or testing.
- Click Create.
Each lesson tracks how many times it has been applied.
Using Templates
- Go to the Templates tab.
- Click Preview on any template to see its full content.
- Click Apply to create a new instruction, skill, or rule from the template.
- The new configuration appears in its respective tab, ready to customize.
Toggling Configurations
Every instruction, skill, rule, and lesson has a toggle switch. Disable items without deleting them to temporarily turn them off.
Import and Export
- Click Export in the header to download all configurations as a JSON file.
- Click Import to upload a previously exported JSON file. The result reports how many configs and lessons were imported.
Evolving Agent Intelligence over time
Treat instructions, skills, rules, and lessons as living configuration:
- Add skills as new domains appear; tighten triggers when the wrong skill loads.
- After incidents, capture a lesson with the right category so the same mistake is less likely to repeat.
- Balance instructions (broad behaviour) vs rules (must-not cross lines) using priority.
- Use Import/Export to promote a tested set from staging → production workspaces.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| "No custom agents yet" | No agents have been created | Use Quick Create or the side chat to build your first agent |
| Agent does not use a custom tool | Tool not assigned to the agent | Edit the agent and add the tool under the Tools section |
| Knowledge Base shows "Syncing documents..." | Documents are being indexed | Wait for indexing to complete before querying |
| Skill is not triggered by the agent | Trigger text does not match the conversation context | Rewrite the trigger to be more specific about when it should activate |
| Import fails | Invalid JSON format | Ensure the file was exported from Dagen's export feature |
| Template "Apply" does nothing | Network error | Check your connection and try again; look for error messages in the snackbar |