Runtime API Reference
Overview
Complete API reference for the AG-Kit Runtime system, including agent management, event handling, and performance optimization.Core Classes
Agent
Main agent class for executing AI agents.Constructor
Methods
run(input, state?, options?)
Execute the agent with given input.input: Input text or message arraystate: Optional state objectoptions: Optional run configuration
runStream(input, state?, options?)
Execute the agent with streaming output.getMemoryUsage()
Get current memory usage statistics.clearMemory()
Clear all stored memory and reset state.setMemoryLimit(limit)
Set maximum memory usage limit.destroy()
Clean up resources and remove event listeners.Configuration Interfaces
AgentConfig
RunOptions
Event System
OptimizedEventSystem
High-performance event system with batching and async processing.Event System Configuration
Error Handling
Error Classes
Error Categories
Type System
Type Constraints
Type Validation
Performance Monitoring
Performance Metrics
Memory Usage
Related Documentation
- Runtime Overview - Runtime system overview
- Runtime Events - Event system documentation
- Runtime Examples - Code examples and patterns