Getting Started
From zero to a running autonomous agent in under 5 minutes. We'll build a simple research assistant that can use tools.
Quick Start Guide#
Prerequisites
You'll need Node.js 18+ and an OpenAI API key.
Environment Variables
We recommend using dotenv to manage your secrets. Never commit keys to git.
Initialize Project
Create a new directory and install the Akios core SDK.
mkdir my-agent
cd my-agent
npm init -y
# Install dependencies
npm install @akios/core zod dotenv
# or
pnpm add @akios/core zod dotenv
# or
yarn add @akios/core zod dotenvCreate Your First Agent
Create a file named index.ts. We'll define a simple tool and an agent that uses it.
import { Agent, Tool } from '@akios/core'
import { z } from 'zod'
import 'dotenv/config'
// 1. Define a Tool
const weatherTool = new Tool({
name: 'get_weather',
description: 'Get current weather for a location',
schema: z.object({ city: z.string() }),
handler: async ({ city }) => {
// Mock API call
return `The weather in ${city} is Sunny, 22°C`
}
})
// 2. Initialize Agent
const agent = new Agent({
name: 'Assistant',
model: 'gpt-4-turbo',
tools: [weatherTool],
systemPrompt: 'You are a helpful assistant.'
})
// 3. Run
async function main() {
const response = await agent.run('What is the weather in Tokyo?')
console.log(response.text)
}
main()Run It
Execute the script using ts-node (or compile with tsc).
npx ts-node index.tsCommon Issues#
Error: OpenAI API Key missing
Ensure you have a .env file in your root directory and that dotenv/config is imported at the top of your file.
Error: Tool schema mismatch
If the LLM tries to call a tool with invalid arguments, Akios will throw a validation error. Improve your tool description to guide the model.
Configuration#
Akios agents can be configured via constructor options or environment variables.
Supported Models
You can use any model from OpenAI, Anthropic, or Mistral by specifying the model ID string.
gpt-4o,gpt-4-turbo,gpt-3.5-turboclaude-3-opus,claude-3-sonnet,claude-3-haikumistral-large-latest,mistral-small-latest
Environment Variables
| Variable | Required For |
|---|---|
| OPENAI_API_KEY | OpenAI models |
| ANTHROPIC_API_KEY | Claude models |
| MISTRAL_API_KEY | Mistral models |
| AKIOS_SECRET_KEY | Akios Cloud features |