AI2025년 11월 19일2분 읽기

자율 AI 에이전트 설계 — 도구 선택과 계획 수립

YS
YoungSam
조회 1796

에이전트 계획 수립

class PlanningAgent {
  async plan(task: string) {
    const plan = await this.llm.generate(`
      Task: ${task}
      Available tools: ${this.tools.map(t => t.name).join(", ")}
      Create a step-by-step plan.
    `);
    return this.parsePlan(plan);
  }

  async executeWithReflection(plan: Step[]) {
    for (const step of plan) {
      const result = await this.executeTool(step);
      const reflection = await this.reflect(step, result);
      if (reflection.needsRevision) {
        return this.replan(reflection.reason);
      }
    }
  }
}

ReAct 패턴

Reasoning + Acting. 생각하고, 행동하고, 관찰하는 루프를 반복합니다.

AI AgentPlanningReflection

댓글 0

아직 댓글이 없습니다.