The Build an Agent tutorial constructs one application end to end: a data analytics assistant. You ask questions in natural language and, across nine steps, the assistant learns to query a warehouse, run analysis in a sandbox, remember your team’s metric definitions, and refuse to exceed a query budget without asking first. This page summarises every stage of the tutorial and the core code involved so you can orient yourself before diving in. Each stage links to its full write-up.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vercel/eve/llms.txt
Use this file to discover all available pages before exploring further.
Complete the Quickstart first if you have not yet run eve locally.
You need Node 24+, npm, and a model credential before beginning.
What you will build
By the end of the tutorial the project looks like this:Tutorial stages
Create the project, choose a capable model, and write a standing analyst identity into
agent/instructions.md. A persona shapes every reply the agent makes.import { defineAgent } from "eve";
export default defineAgent({
model: "anthropic/claude-opus-4.8",
});
You are a senior data analyst. You answer questions about the team's data.
- Prefer exact numbers to hand-waving. If you can compute it, compute it.
- State the assumptions behind any number you report (date range, filters, grain).
- Use the tools available to you rather than guessing. If you cannot answer from
the data, say so plainly.
Run
npm run dev and ask a question. The agent answers using the analyst persona even before it can see any data.→ Covered in detail in the Quickstart and Introduction.
Each turn runs as a durable workflow. Completed steps never re-run; eve replays the recorded result. A step interrupted mid-execution re-runs, so make non-idempotent side effects (charges, emails) idempotent, or gate them with an approval step.
→ See Execution Model for the full session/turn/step contract.
import { defineTool } from "eve/tools";
import { z } from "zod";
import { runReadOnlySql } from "../lib/sample-db.js";
export default defineTool({
description:
"Run a read-only SQL query against the analytics tables (orders, customers) " +
"and return the columns and rows.",
inputSchema: z.object({
sql: z.string().describe("A single read-only SELECT statement."),
}),
async execute({ sql }) {
const { columns, rows } = await runReadOnlySql(sql);
// Bound output so a wide query can't flood the model's context.
return { columns, rows: rows.slice(0, 500), truncated: rows.length > 500 };
},
});
Restart the dev server and ask: “Which customer has spent the most, and how much?” Watch the model emit a
run_sql call, receive the rows, and return a real number.→ See Tools for the complete
defineTool API.Replace the in-memory sample data with a connection to your actual warehouse. This step introduces human-in-the-loop authorization: the agent parks the turn while you approve the sign-in in the browser, then resumes exactly where it left off.
→ See Connections for MCP and OpenAPI connection setup.
Add a sandboxed execution environment so the agent can run Python or shell scripts safely without touching the host filesystem.
→ See Sandbox for the full
ctx.getSandbox() API.Skills are Markdown procedures the model loads on demand — they do not consume context on every turn. Write the team’s metric definitions into
agent/skills/metric_definitions.md and the agent automatically applies them when a matching question arrives.→ See Skills for the full skill authoring guide.
Extend the skills folder with multi-step operational playbooks that the agent follows for common data tasks.
→ See Skills for packaged skills with
SKILL.md.Use
input.requested — eve’s human-in-the-loop primitive — to pause a turn and ask for explicit approval before running expensive queries. The turn waits for your yes/no, then picks up exactly where it left off.→ See Tools for human-in-the-loop approval configuration.
The generated
next.config.ts wraps your config with withEve, which wires the eve routes automatically:import type { NextConfig } from "next";
import { withEve } from "eve/next";
const nextConfig: NextConfig = {};
export default withEve(nextConfig);
→ See Deployment for the full production checklist.
Final project structure
After all nine stages, every capability has a clear file-system home:What to read next
Tools
Complete
defineTool API reference — schemas, output bounding, and authorization.Instructions & Skills
Always-on prompts vs. on-demand Markdown procedures.
Deployment
Build, start, and ship an eve app to Vercel.