Skip to content
All Skills

Voltagent Best Practices

VoltAgent architectural patterns and conventions. Covers agents vs workflows, project layout, memory, servers, and observability.

Agent Orchestration|v1|Updated 7/14/2026|GitHub source
MCP get_skill({ skillId: "voltagent-best-practices-09ff3511" })

Use this skill with your agent

Create a free account and connect via MCP

Get Started Free
# VoltAgent Best Practices

Quick reference for VoltAgent conventions and patterns.

---

## Choosing Agent or Workflow

| Use | When |
| --- | --- |
| Agent | Open-ended tasks that require tool selection and adaptive reasoning |
| Workflow | Multi-step pipelines with explicit control flow and suspend/resume |

---

## Layout

```
src/
|-- index.ts
|-- agents/
|-- tools/
`-- workflows/
```

---

## Quick Snippets

### Basic Agent

```typescript
import { Agent } from "@voltagent/core";

const agent = new Agent({
  name: "assistant",
  instructions: "You are helpful.",
  model: "openai/gpt-4o-mini",
});
```

Model format is `provider/model` (for example `openai/gpt-4o-mini` or `anthropic/claude-3-5-sonnet`).

### Basic Workflow

```typescript
import { createWorkflowChain } from "@voltagent/core";
import { z } from "zod";

const workflow = createWorkflowChain({
  id: "example",
  input: z.object({ text: z.string() }),
  result: z.object({ summary: z.string() }),
}).andThen({
  id: "summarize",
  execute: async ({ data }) => ({ summary: data.text }),
});
```

### VoltAgent Bootstrap

```typescript
import { VoltAgent } from "@voltagent/core";
import { honoServer } from "@voltagent/server-hono";

new VoltAgent({
  agents: { agent },
  workflows: { workflow },
  server: honoServer(),
});
```

---

## Memory Defaults

- Use `memory` for a shared default across agents and workflows.
- Use `agentMemory` or `workflowMemory` when defaults need to differ.

---

## Server Options

- Use `@voltagent/server-hono` for Node HTTP servers.
- Use `@voltagent/server-elysia` as an alternative Node server provider.
- Use `serverless` provider for fetch runtimes (Cloudflare, Netlify).

---

## Observability Notes

- Use `VoltOpsClient` or `createVoltAgentObservability` for tracing.
- VoltAgent will auto-configure VoltOps if `VOLTAGENT_PUBLIC_KEY` and `VOLTAGENT_SECRET_KEY` are set.

---

## Recipes

Short best-practice recipes live in the embedded docs:

- `packages/core/docs/recipes/`
- Search: `rg -n "keyword" packages/core/docs/recipes -g"*.md"`
- Read: `cat packages/core/docs/recipes/<file>.md`

---

## Footguns

- Do not use `JSON.stringify` inside VoltAgent packages. Use `safeStringify` from `@voltagent/internal`.

---

## Resources

- https://voltagent.dev/docs
- https://github.com/voltagent/voltagent
- https://github.com/voltagent/voltagent/tree/main/examples
#voltagent#microsoft#agent#framework

Related Skills

More skills in Agent Orchestration

1. Product type search — what design patterns fit this product?

Design UI/UX systems with style guides, palettes, typography, and component specs for new interfaces

#github#broad-capabilityMIT

Acp Router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

#broad-capability#browserMIT

Add New Safe Output Type

Adding a New Safe Output Type to GitHub Agentic Workflows

#github#broad-capabilityMIT

Agent Governance

Patterns and techniques for adding governance, safety, and trust controls to AI agent systems. Use this skill when: - Building AI agents that call external tools (APIs, databases, file systems) - Implementing policy-based access controls for agent tool usage - Adding semantic intent classification to detect dangerous prompts - Creating trust scoring systems for multi-agent workflows - Building audit trails for agent actions and decisions - Enforcing rate limits, content filters, or tool restrictions on agents - Working with any agent framework (PydanticAI, CrewAI, OpenAI Agents, LangChain, AutoGen)

#github-copilot#agentMIT

Agentic Development

Build AI agents with Pydantic AI (Python) and Claude SDK (Node.js)

#claude-bootstrap#bootstrapMIT

Agentic Workflows

Route gh-aw workflow design/create/debug/upgrade requests to the right prompts.

#broad-capability#agentic-workflowsMIT