This skill helps you implement VoltAgent best practices across agents, workflows, memory, servers, and observability to improve architecture and reliability.
npx playbooks add skill voltagent/skills --skill voltagent-best-practices
Quick reference for VoltAgent conventions and patterns.
---
| Use | When |
| --- | --- |
| Agent | Open-ended tasks that require tool selection and adaptive reasoning |
| Workflow | Multi-step pipelines with explicit control flow and suspend/resume |
---
src/
|-- index.ts
|-- agents/
|-- tools/
`-- workflows/
---
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).
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 }),
});
import { VoltAgent } from "@voltagent/core";
import { honoServer } from "@voltagent/server-hono";
new VoltAgent({
agents: { agent },
workflows: { workflow },
server: honoServer(),
});
---
memory for a shared default across agents and workflows.agentMemory or workflowMemory when defaults need to differ.---
@voltagent/server-hono for Node HTTP servers.@voltagent/server-elysia as an alternative Node server provider.serverless provider for fetch runtimes (Cloudflare, Netlify).---
VoltOpsClient or createVoltAgentObservability for tracing.VOLTAGENT_PUBLIC_KEY and VOLTAGENT_SECRET_KEY are set.---
Short best-practice recipes live in the embedded docs:
packages/core/docs/recipes/rg -n "keyword" packages/core/docs/recipes -g"*.md"cat packages/core/docs/recipes/<file>.md---
JSON.stringify inside VoltAgent packages. Use safeStringify from @voltagent/internal.---
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.