An agent is the core unit in Regent SDK. It represents an autonomous service with typed capabilities (entrypoints), optional payments, and discoverable metadata.
Creating an Agent
Use createRegentAgent() for the simplest setup:
Copy import { createRegentAgent } from ' regent-sdk ' ;
const agent = await createRegentAgent ( {
name : ' my-agent ' ,
version : ' 1.0.0 ' ,
description : ' An AI-powered assistant ' ,
http : { port : 3000 },
} ) ; Use createAgent() with the extension pattern for full control:
Copy import { createAgent } from ' @regent/core ' ;
import { http } from ' @regent/http ' ;
const agent = await createAgent ( {
name : ' my-agent ' ,
version : ' 1.0.0 ' ,
description : ' An AI-powered assistant ' ,
} )
. use ( http ())
. build () ; The createAgent() function returns an AgentBuilder that lets you compose extensions before calling .build().
The AgentMeta type describes your agent for discovery and display:
This metadata is used to:
Generate the Agent Card (/.well-known/agent.json) for A2A discovery
Render Open Graph tags for social sharing
Display information on the landing page (if enabled)
The Extension System
Agents are built by composing extensions. Each extension adds capabilities:
Available Extensions
HTTP request/response handling, SSE streaming
Wallet management for agent operations
Agent-to-Agent communication
Extensions are independent and can be used in any combination.
Extension Interface
Extensions follow a consistent interface:
Lifecycle Hooks:
Initialize extension, return runtime context
After all extensions built
Final setup (can be async)
Enhance manifest with extension data
Conflict Detection
The builder automatically detects when two extensions add the same property:
The AgentBuilder provides a fluent API:
Adding Entrypoints via Builder
The built agent runtime provides access to all configured capabilities:
The core agent manages entrypoints:
Framework Adapters
After building an agent, use an adapter to expose it via your preferred framework:
Every agent automatically generates an Agent Card at /.well-known/agent.json. This follows the A2A protocol and includes:
Agent metadata (name, version, description)
Supported interfaces and capabilities
Available skills (entrypoints)
Payment methods (if configured)
Identity registrations (if configured)
Example Agent Card:
When using the http() extension and a framework adapter, your agent exposes:
Agent Card for A2A discovery
List available entrypoints
Stream from an entrypoint (SSE)
Subscribe to task updates (SSE)