Loading...
Loading...
VoltAgent architectural patterns and conventions. Covers agents vs workflows, project layout, memory, servers, and observability.
npx skill4agent add voltagent/skills voltagent-best-practices| 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",
});provider/modelopenai/gpt-4o-minianthropic/claude-3-5-sonnetimport { 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(),
});memoryagentMemoryworkflowMemory@voltagent/server-hono@voltagent/server-elysiaserverlessVoltOpsClientcreateVoltAgentObservabilityVOLTAGENT_PUBLIC_KEYVOLTAGENT_SECRET_KEYpackages/core/docs/recipes/rg -n "keyword" packages/core/docs/recipes -g"*.md"cat packages/core/docs/recipes/<file>.mdJSON.stringifysafeStringify@voltagent/internal