Astreus

Schnellstart

Erstelle deinen ersten Astreus-Agenten in unter 5 Minuten. Lerne die Einrichtungsmuster, APIs und praktischen Beispiele kennen, die du zum Aufbau...

Erstelle deinen ersten Astreus-Agenten in unter 5 Minuten.

Installationsmethoden

Mit npx (empfohlen)

npx create-astreus-agent my-agent

Mit npm create

npm create astreus-agent my-agent

Mit pnpm

pnpm create astreus-agent my-agent

Interaktives Setup

1. Projektname

? What is your project name? my-agent

Gib deinen Projektnamen ein. Es wird ein neues Verzeichnis erstellt. Es sind nur Buchstaben, Zahlen, Bindestriche und Unterstriche erlaubt.

2. Funktionsauswahl

? 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

Verwende die Pfeiltasten und die Leertaste, um Funktionen auszuwählen. Alle Funktionen sind optional.

3. LLM-Anbieter

? 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

Wähle deinen bevorzugten Anbieter oder wähle "Multiple providers", um dies später zu konfigurieren.

4. TypeScript

? Use TypeScript? Yes

TypeScript wird für eine bessere Entwicklererfahrung empfohlen.

Nach der Installation

Nachdem das Projekt erstellt wurde:

# 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

Beispiel: Erste Unterhaltung

Sobald der Agent läuft, ist er einsatzbereit:

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);

Generierter Code

Die CLI generiert eine vollständige 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);

Voraussetzungen

  • Node.js >= 22.0.0
  • npm, yarn oder pnpm
  • API-Schlüssel eines LLM-Anbieters (oder Ollama für lokale Modelle)

Nächste Schritte

Zuletzt aktualisiert: 6. Juli 2026