Quickstart
Build a working agent in under 5 minutes.
Option 1: High-Level API (Simplest)
import { createRegentAgent } from 'regent-sdk';
import { z } from 'zod';
import { createAgentApp } from '@regent/hono';
const agent = await createRegentAgent({
name: 'my-agent',
description: 'A helpful assistant',
version: '1.0.0',
http: { port: 3000 },
});
// Add an entrypoint
agent.runtime.entrypoints.add({
key: 'greet',
input: z.object({ name: z.string() }),
output: z.object({ message: z.string() }),
handler: async ({ input }) => ({ output: { message: `Hello, ${input.name}!` } }),
});
// Serve it with an adapter (Hono example)
const { app } = await createAgentApp(agent.runtime);
export default {
port: 3000,
fetch: app.fetch,
};Option 2: Using the CLI
Select:
Adapter:
honoTemplate:
blank(oraxllmfor LLM-powered)
Then:
Option 3: Low-Level API (Full Control)
Test Your Agent
View the Agent Manifest
Returns the Agent Card describing capabilities:
List Entrypoints
Invoke an Entrypoint
Response:
Add Streaming
For LLM responses or long operations, use streaming:
Test streaming:
Response (SSE):
Add Payments
Monetize your agent with x402:
Set environment variables:
Register On-Chain Identity
Project Structure
A typical Regent agent project:
Next Steps
Concepts: Agents - Deep dive into agent configuration
Concepts: Entrypoints - Learn about handlers and streaming
Packages: @regent/erc8004 - On-chain identity and discovery
Examples - More complete examples
Last updated