빠른 시작
2분 안에 Astreus로 첫 번째 AI 에이전트를 만들어 보세요
작업을 실행하고 지능적으로 응답할 수 있는 간단한 에이전트를 만들어 보겠습니다.
시작하기 전에 Astreus가 설치되어 있는지 확인하세요. 아직 설치하지 않았다면 설치 가이드를 따라 진행하세요.
Build your first agent#
Create Environment File#
프로젝트 루트에 .env 파일을 만들고 OpenAI API 키를 추가하세요.
touch .env.env 파일에 API 키를 추가하세요.
OPENAI_API_KEY=sk-your-openai-api-key-hereCreate your First Agent#
메모리와 시스템 프롬프트를 갖춘 에이전트를 만드세요.
import { Agent } from '@astreus-ai/astreus';
// Create agent
const agent = await Agent.create({
name: 'ResearchAgent',
model: 'gpt-6-astra',
memory: true,
systemPrompt: 'You are an expert research assistant.'
});Create and Execute Task#
작업을 만들고 에이전트로 실행하세요.
import { Agent } from '@astreus-ai/astreus';
// Create agent
const agent = await Agent.create({
name: 'ResearchAgent',
model: 'gpt-6-astra',
memory: true,
systemPrompt: 'You are an expert research assistant.'
});
// Create a task
const task = await agent.createTask({
prompt: "Research latest news in Anthropic and OpenAI"
});
// Execute the task
const result = await agent.executeTask(task.id);
console.log(result.response);Build a Graph Workflow#
여러 작업으로 구성된 워크플로우 그래프를 만드세요.
import { Agent, Graph } from '@astreus-ai/astreus';
// Create agent
const agent = await Agent.create({
name: 'ResearchAgent',
model: 'gpt-6-astra',
memory: true,
systemPrompt: 'You are an expert research assistant.'
});
// Create a graph for complex workflows
const graph = new Graph({
name: 'Research Pipeline',
defaultAgentId: agent.id
});
// Add task nodes
const researchNode = graph.addTaskNode({
prompt: 'Research the latest AI developments'
});
const analysisNode = graph.addTaskNode({
prompt: 'Analyze the research findings',
dependencies: [researchNode]
});
const summaryNode = graph.addTaskNode({
prompt: 'Create a summary report',
dependencies: [analysisNode]
});
// Run the graph
const graphResult = await graph.run();
console.log(graphResult.results[summaryNode]);축하합니다! Astreus로 첫 번째 AI 에이전트를 만들었습니다.