API Reference
Detailed documentation for the AKIOS SDK classes, interfaces, and CLI commands.
CLI Commands#
The akios CLI is your primary tool for managing local development and edge deployments.
| Command | Description |
|---|---|
| akios init | Scaffolds a new agent project with TypeScript and Zod. |
| akios dev | Starts a local hot-reloading server at localhost:3000. |
| akios deploy | Bundles and pushes your agent to the AKIOS Edge Runtime. |
| akios logs | Streams live logs from production instances. |
| akios secrets | Manage encrypted environment variables. |
Class: Agent#
The Agent class orchestrates the loop between the LLM, tools, and memory.
typescript
import { Agent } from '@akios/core'Constructor Options
| Prop | Type | Description |
|---|---|---|
nameReq | string | Unique identifier for the agent. Used for logging and memory partitioning. |
modelReq | string | ModelProvider | The LLM to use. Can be a string ID (e.g. "gpt-4") or a configured provider instance. |
tools | Tool[] Default: [] | Array of Tool instances available to the agent. |
systemPrompt | string Default: "You are a helpful assistant." | The base instructions for the agent behavior. |
memory | MemoryStore Default: InMemoryStore | Persistence layer for conversation history. |
temperature | number Default: 0.7 | Sampling temperature (0.0 to 1.0). |
maxSteps | number Default: 10 | Maximum number of thought/action loops before forced termination. |
Methods
run(input: string, context?: Record<string, any>): Promise<AgentResponse>
Executes the agent loop with the given input. Returns the final text response and trace metadata.
stream(input: string): AsyncIterable<AgentEvent>
Generates a stream of events (thought, tool_call, tool_result, answer) for real-time UI updates.
Class: Tool#
Tools allow agents to interact with the outside world.
typescript
import { Tool } from '@akios/core'Constructor Options
| Prop | Type | Description |
|---|---|---|
nameReq | string | The function name exposed to the LLM (e.g. "get_weather"). Must be snake_case. |
descriptionReq | string | Natural language description of what the tool does and when to use it. |
schemaReq | z.ZodSchema | Zod schema defining the input arguments. Used for validation and JSON Schema generation. |
handlerReq | (args: T) => Promise<any> | The implementation function. Receives validated arguments. |
dangerous | boolean Default: false | If true, requires human approval before execution in production environments. |
Interface: ModelProvider#
Implement this interface to connect Akios to custom LLMs or local inference servers.
typescript
interface ModelProvider {
id: string
generate(
messages: Message[],
tools?: ToolDefinition[]
): Promise<ModelResponse>
stream(
messages: Message[],
tools?: ToolDefinition[]
): AsyncIterable<ModelStreamEvent>
}Interface: Guardrail#
Guardrails intercept inputs and outputs to enforce safety policies.
typescript
interface Guardrail {
name: string
type: 'input' | 'output'
validate: (content: string) => Promise<GuardrailResult>
}
type GuardrailResult =
| { passed: true }
| { passed: false; reason: string; fix?: string }