Astreus

Sub-Agenti avanzati

Costruisci workflow multi-agente sofisticati con pattern di coordinamento complessi e capacità specializzate.

Costruisci workflow multi-agente sofisticati con pattern di coordinamento complessi e capacità specializzate.

Avvio rapido

Clona l'esempio completo

Il modo più semplice per iniziare è clonare il repository dell'esempio completo:

git clone https://github.com/astreus-ai/examples
cd examples/sub-agents-advanced
npm install

Oppure installa solo il pacchetto

Se preferisci costruire tutto da zero:

npm install @astreus-ai/astreus

Configurazione dell'ambiente

# .env
OPENAI_API_KEY=sk-your-openai-api-key-here
ANTHROPIC_API_KEY=your-anthropic-api-key-here
DB_URL=sqlite://./astreus.db

Team di agenti multi-modello

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

// Create diverse agent team with different models
const strategicPlanner = await Agent.create({
  name: 'StrategicPlanner',
  model: 'gpt-4o',  // High reasoning for strategy
  systemPrompt: 'You are a strategic business consultant with deep analytical thinking.',
  memory: true,
  knowledge: true
});

const creativeWriter = await Agent.create({
  name: 'CreativeWriter',
  model: 'claude-3-5-sonnet-20241022',  // Excellent for creative writing
  systemPrompt: 'You are a creative copywriter who crafts compelling narratives.',
  vision: true
});

const dataScientist = await Agent.create({
  name: 'DataScientist',
  model: 'gpt-4o',  // Strong analytical capabilities
  systemPrompt: 'You are a data scientist specializing in statistical analysis and insights.',
  useTools: true
});

const executiveTeam = await Agent.create({
  name: 'ExecutiveTeam',
  model: 'gpt-4o',  // High-level coordination
  systemPrompt: 'You coordinate executive-level strategic initiatives across expert teams.',
  subAgents: [strategicPlanner, creativeWriter, dataScientist]
});

const businessPlan = await executiveTeam.ask(
  'Develop comprehensive go-to-market strategy for AI-powered healthcare platform',
  {
    useSubAgents: true,
    delegation: 'auto',
    coordination: 'sequential'
  }
);

console.log('Business plan completed:', businessPlan);

Esecuzione dell'esempio

Se hai clonato il repository:

npm run dev

Se hai costruito tutto da zero, crea un file index.ts con il codice sopra ed esegui:

npx tsx index.ts

Repository

L'esempio completo è disponibile su GitHub: examples/sub-agents-advanced

Ultimo aggiornamento: 6 luglio 2026