Astreus

복잡한 워크플로우

Astreus 문서에서 복잡한 워크플로우에 대해 알아보고, 에이전트 시스템을 구축하기 위한 설정 안내, API 패턴, 실용적인 예제를 확인하세요. 안정적인 Astreus 에이전트 시스템을 구축하는 데 필요한 설정 패턴, API, 실용적인 예제를 알아보세요.

고급 오케스트레이션 패턴을 사용하여 정교한 멀티 에이전트 워크플로우를 구축합니다.

빠른 시작

전체 예제 클론하기

가장 쉬운 시작 방법은 전체 예제 저장소를 클론하는 것입니다:

git clone https://github.com/astreus-ai/examples
cd examples/complex-workflows
npm install

또는 패키지만 설치하기

처음부터 직접 구축하려면:

npm install @astreus-ai/astreus

환경 설정

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

멀티 에이전트 워크플로우

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

// 전문화된 에이전트 생성
const researcher = await Agent.create({
  name: 'Researcher',
  model: 'gpt-4o',
  systemPrompt: 'You research topics thoroughly.'
});

const writer = await Agent.create({
  name: 'Writer', 
  model: 'gpt-4o',
  systemPrompt: 'You create engaging content.'
});

// 워크플로우 파이프라인 생성
const pipeline = new Graph({
  name: 'content-pipeline'
}, researcher);

// 워크플로우 단계 정의
const research = pipeline.addTaskNode({
  prompt: 'Research AI trends in 2024',
  agentId: researcher.id
});

const article = pipeline.addTaskNode({
  prompt: 'Write an article based on the research',
  agentId: writer.id,
  dependencies: [research]
});

// 워크플로우 실행
const results = await pipeline.run();

// 결과를 파싱하고 응답을 추출
if (results.success && results.results[article]) {
  const articleResult = JSON.parse(results.results[article]);
  console.log(articleResult.response);
}

예제 실행하기

저장소를 클론했다면:

npm run dev

저장소

전체 예제는 GitHub에서 확인할 수 있습니다: examples/complex-workflows

마지막 업데이트: 2026년 7월 6일