DocsInstallation & Quick Start

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#

1

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.

2

Initialize Project

Create a new directory and install the Akios core SDK.

bash
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 dotenv
3

Create Your First Agent

Create a file named index.ts. We'll define a simple tool and an agent that uses it.

typescript
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()
4

Run It

Execute the script using ts-node (or compile with tsc).

bash
npx ts-node index.ts

Common 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-turbo
  • claude-3-opus, claude-3-sonnet, claude-3-haiku
  • mistral-large-latest, mistral-small-latest

Environment Variables

VariableRequired For
OPENAI_API_KEYOpenAI models
ANTHROPIC_API_KEYClaude models
MISTRAL_API_KEYMistral models
AKIOS_SECRET_KEYAkios Cloud features