Anthropic Engineering

Building Effective Agents

Erik Schluntz · Barry Zhang

LLM 에이전트를 만들 때 가장 성공적인 구현은 복잡한 프레임워크가 아니라 단순하고 조합 가능한 패턴을 쓴다. Workflow와 Agent의 구분, 그리고 언제 무엇을 써야 하는가에 대한 Anthropic의 현장 관찰.

Building Effective Agents

생각 덩어리

성공한 구현은 단순 조합 패턴

the most successful implementations weren't using complex frameworks or specialized libraries. Instead, they were building with simple, composable patterns.

Workflow vs Agent — 두 종류의 agentic system

Workflows: systems where LLMs and tools are orchestrated through predefined code paths

Agents: systems where LLMs dynamically direct their own processes and tool usage

가장 단순한 해를 먼저

Agentic systems often trade latency and cost for better task performance, and you should consider when this tradeoff makes sense.

For many applications, optimizing single LLM calls with retrieval and examples suffices. Workflows suit well-defined tasks, while agents excel when flexibility and model-driven decisions matter.

프레임워크보다 API 직접 호출로 시작

start by using LLM APIs directly: many patterns can be implemented in a few lines of code.

Augmented LLM — 기본 빌딩 블록

This foundational component combines an LLM with retrieval, tools, and memory capabilities. The Model Context Protocol enables integration with third-party tools.

Prompt chaining — 작업을 순차 단계로 쪼개기

situations where the task can be easily and cleanly decomposed into fixed subtasks.

Examples include generating marketing copy then translating it, or writing an outline before the full document.

Routing — 입력 분류 후 전문 경로로

Routing classifies inputs and directs them to specialized tasks, improving performance on diverse input types. This works well for customer service queries or directing questions to appropriately-sized models.

Parallelization — Sectioning과 Voting

Two variations exist: sectioning (breaking tasks into independent subtasks) and voting (running the same task multiple times). Useful for guardrails, code reviews, or content moderation.

Orchestrator-workers — 하위 작업을 예측할 수 없을 때

complex tasks where you can't predict the subtasks needed.

Evaluator-optimizer — 평가 기준이 명확할 때

when we have clear evaluation criteria, and when iterative refinement provides measurable value.

Agent의 본질 — 도구와 환경 피드백 루프

Agents can handle sophisticated tasks, but their implementation is often straightforward. They are typically just LLMs using tools based on environmental feedback in a loop.

세 가지 핵심 원칙

Simplicity in design

Transparency in planning steps

Careful crafting of the agent-computer interface through thorough tool documentation and testing

코딩 에이전트 — 검증 가능성이 강점

Code solutions are verifiable through automated tests; Agents can iterate on solutions using test results as feedback.

Tool 포맷 — LLM이 쓰기 어려운 포맷이 따로 있다

much more difficult for an LLM to write than others.

Recommendations for tool formats:

  • Give the model sufficient tokens to plan before writing
  • Keep formats close to naturally occurring internet text
  • Eliminate formatting overhead

Agent-Computer Interface — HCI만큼 공들여라

  • Putting yourself in the model's perspective about tool clarity
  • Improving parameter names and descriptions
  • Testing model tool usage extensively
  • Applying "poka-yoke" principles to prevent mistakes

툴 최적화가 프롬프트 최적화보다 시간이 더 들 수 있다

spent more time optimizing our tools than the overall prompt.

For example, switching to absolute filepaths eliminated model errors with relative paths.

원본 사이트 →