Astreus

Quick Start

Create your first Astreus agent project in under 5 minutes. Learn the setup patterns, APIs, and practical examples needed to build reliable Astreus agent...

Create your first Astreus agent project in under 5 minutes.

Installation Methods

npx create-astreus-agent my-agent

Using npm create

npm create astreus-agent my-agent

Using pnpm

pnpm create astreus-agent my-agent

Interactive Setup

1. Project Name

? What is your project name? my-agent

Enter your project name. A new directory will be created. Only letters, numbers, dashes, and underscores are allowed.

2. Feature Selection

? Which features do you want to include?
  ◉ Memory - Persistent agent memory with vector search
  ◉ Knowledge (RAG) - Document ingestion and retrieval
  ◯ Graph Workflows - DAG-based task orchestration
  ◯ Sub-Agents - Multi-agent coordination
  ◯ Custom Plugins - Extensible tool system
  ◯ MCP Integration - Model Context Protocol support

Use arrow keys and space to select features. All features are optional.

3. LLM Provider

? Which LLM provider do you want to use?
  ● OpenAI - GPT-4, GPT-3.5
  ○ Anthropic - Claude
  ○ Google - Gemini
  ○ Ollama - Local models
  ○ Multiple providers - Configure later

Choose your preferred provider or select "Multiple providers" to configure later.

4. TypeScript

? Use TypeScript? Yes

TypeScript is recommended for better developer experience.

Post-Installation

After the project is created:

# Navigate to project
cd my-agent

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Edit .env with your API keys
nano .env  # or use your preferred editor

# Start the agent
npm run dev

Example: First Conversation

Once running, your agent is ready:

import { Agent } from '@astreus-ai/astreus';
import 'dotenv/config';

const agent = await Agent.create({
  name: 'my-agent',
  model: 'gpt-4o',
  memory: true,
});

// Have a conversation
const response = await agent.ask("Hello! What can you help me with?");
console.log(response);

Generated Code

The CLI generates a complete src/index.ts:

import { Agent } from '@astreus-ai/astreus';
import 'dotenv/config';

async function main() {
  console.log('Starting Astreus Agent...\n');

  const agent = await Agent.create({
    name: 'my-agent',
    model: 'gpt-4o',
    systemPrompt: 'You are a helpful AI assistant powered by Astreus.',
    memory: true,
  });

  // Interactive loop
  const readline = await import('readline');
  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
  });

  console.log('Agent ready! Type your message (or "exit" to quit):\n');

  const prompt = () => {
    rl.question('You: ', async (input) => {
      if (input.toLowerCase() === 'exit') {
        console.log('\nGoodbye!');
        rl.close();
        process.exit(0);
      }

      try {
        const response = await agent.ask(input);
        console.log(`\nAgent: ${response}\n`);
      } catch (error) {
        console.error('Error:', error instanceof Error ? error.message : error);
      }

      prompt();
    });
  };

  prompt();
}

main().catch(console.error);

Requirements

  • Node.js >= 22.0.0
  • npm, yarn, or pnpm
  • LLM provider API key (or Ollama for local models)

Next Steps

Last updated: May 26, 2026