Skip to content

moeru-ai/apeira

Repository files navigation

Apeira

stream-first Agent Runtime.

Quick Start

pnpm add @apeira/core
# or the umbrella package
pnpm add apeira

Create an agent and run a turn:

import { createAgent, run, user } from '@apeira/core'
import { responses } from '@apeira/core/responses'

const agent = createAgent({
  instructions: 'You are a concise assistant.',
  runner: responses({
    apiKey: process.env.OPENAI_API_KEY,
    baseURL: 'https://api.openai.com/v1/',
    model: 'gpt-5.5',
  }),
})

for await (const event of run(agent, user('Say hello.')))
  console.log(event.turnId, event.type)

run() returns a ReadableStream of lifecycle and model events for the turn.

For fire-and-forget usage, subscribe to events with agent.subscribe() and submit turns with agent.send():

agent.subscribe('apeira', event => console.log(event.turnId, event.type))
agent.send(user('Say hello.'))

Documentation

Detailed guides, examples, and API references live in https://apeira.moeru.ai.

License

MIT

About

🕵️💬 stream-first Agent Runtime.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors