API ReferenceclassesAgent

Kikoyu Core API Reference


Kikoyu Core API Reference / Agent

Class: Agent

Immutable configuration holder for an AI Agent.

All execution logic is driven by Runner, while the Agent holds instructions, attached tools, guardrails, and handoffs.

Example

const agent = new Agent({
  name: 'Assistant',
  instructions: 'You are a helpful AI assistant.',
  model: new OpenAIProvider(),
});

Constructors

new Agent()

new Agent(config): Agent

Parameters

config

AgentConfig

Returns

Agent

Defined in

agent.ts:54

Properties

guardrails

readonly guardrails: Guardrail<any>[]

List of input and output guardrails

Defined in

agent.ts:39


handoffs

readonly handoffs: Handoff[]

List of registered handoffs to other agents

Defined in

agent.ts:42


instructions

readonly instructions: string

The system instructions describing the agent’s persona and instructions

Defined in

agent.ts:27


maxHandoffs?

readonly optional maxHandoffs: number

Maximum allowed handoffs

Defined in

agent.ts:49


maxRetries?

readonly optional maxRetries: number

Maximum allowed model retries

Defined in

agent.ts:52


model

readonly model: ModelProvider

The model provider driving the agent

Defined in

agent.ts:30


name

readonly name: string

The unique display name of the agent

Defined in

agent.ts:24


responseSchema?

readonly optional responseSchema: any

Optional Zod response schema for structured output

Defined in

agent.ts:46


toolRegistry

readonly toolRegistry: ToolRegistry

ToolRegistry maintaining all tools and handoff tools

Defined in

agent.ts:36


tools

readonly tools: Tool<any, any, any>[]

List of standard tools attached to the agent

Defined in

agent.ts:33

Methods

builder()

static builder(): AgentBuilder

Creates a new fluent AgentBuilder instance.

Returns

AgentBuilder

A fresh AgentBuilder for method chaining.

Defined in

agent.ts:92