Astreus

Hızlı Başlangıç

İlk Astreus agent projenizi 5 dakikadan kısa sürede oluşturun. Güvenilir Astreus agent sistemleri oluşturmak için gereken kurulum kalıplarını, API'leri ve...

İlk Astreus agent projenizi 5 dakikadan kısa sürede oluşturun.

Kurulum Yöntemleri

npx Kullanarak (Önerilen)

npx create-astreus-agent my-agent

npm create Kullanarak

npm create astreus-agent my-agent

pnpm Kullanarak

pnpm create astreus-agent my-agent

İnteraktif Kurulum

1. Proje Adı

? What is your project name? my-agent

Proje adınızı girin. Yeni bir dizin oluşturulacaktır. Sadece harfler, rakamlar, tire ve alt çizgiye izin verilir.

2. Özellik Seçimi

? 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

Özellikleri seçmek için ok tuşlarını ve boşluk tuşunu kullanın. Tüm özellikler opsiyoneldir.

3. LLM Sağlayıcısı

? 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

Tercih ettiğiniz sağlayıcıyı seçin veya daha sonra yapılandırmak için "Multiple providers" seçeneğini seçin.

4. TypeScript

? Use TypeScript? Yes

Daha iyi bir geliştirici deneyimi için TypeScript önerilir.

Kurulum Sonrası

Proje oluşturulduktan sonra:

# 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

Örnek: İlk Konuşma

Çalıştıktan sonra agent'ınız hazırdır:

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

Oluşturulan Kod

CLI, eksiksiz bir src/index.ts oluşturur:

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

Gereksinimler

  • Node.js >= 22.0.0
  • npm, yarn veya pnpm
  • LLM sağlayıcı API anahtarı (veya yerel modeller için Ollama)

Sonraki Adımlar

Son güncelleme: 6 Temmuz 2026