Agents are useful because they help us automate work by taking actions in the real world. But getting agents to do valuable work reliably takes more than just a good model: it requires a carefully designed harness that's fit to a set of tasks.
The core agent algorithm is simple: give the LLM context and let it call tools in a loop until it's done. This is the most fundamental loop. But it’s far from the only loop that powers agents. Swyx recently wrote a great piece on "loopcraft: the art of stacking loops", the idea that you can stack and extend loops to build more effective agents.
Here's how we think about that stack, and how to instrument each level with LangChain primitives.
Loop 1: The Agent
At its core, an agent is just a model calling tools in a loop until a task is complete.
This is what LangChain’s create_agent gives you. Pick any model, plug in tools, and you have a working agent loop. Tools are what give the agent the power to take action in the real world.
에이전트 하네스 (Agent Harness)
LLM을 실제로 작동하는 에이전트로 만들어주는 소프트웨어 인프라. 루프, 도구 호출, 컨텍스트 관리, 메모리, 가드레일, 트레이싱 등 에이전트를 감싸는 모든 scaffolding을 포함한다. 출처
루브릭 (Rubric)
에이전트 출력물의 품질을 평가하기 위한 명시적 기준 체계. 단일 점수 대신 여러 차원(링크 유효성, CI 통과 여부, 범위 준수 등)으로 세분화된 채점 기준을 정의하며, 검증 루프의 채점기(grader)가 이를 기반으로 재시도 여부를 판단한다. 출처
LLM as a Judge
하나의 LLM이 다른 LLM의 출력을 평가하는 방식. 결정론적 규칙으로 판단하기 어려운 품질(문체, 논리적 일관성, 맥락 적합성 등)을 자동으로 채점할 때 사용하는 에이전틱 채점 패턴이다. 출처
트레이스 (Trace)
에이전트 실행 중 모델이 수행한 모든 행동의 기록 — 호출한 도구, 중간 추론 과정, 채점기 피드백 등을 포함한다. 힐 클라이밍 루프의 분석 에이전트가 이 트레이스를 입력으로 받아 하네스 개선점을 도출한다. 출처
힐 클라이밍 루프 (Hill Climbing Loop)
프로덕션 실행에서 수집된 트레이스를 분석 에이전트에게 공급하여 프롬프트·도구 설정 등 하네스 구성을 자동으로 개선하는 메타 루프. 각 사이클마다 내부 루프의 성능이 향상되는 자기 강화 구조를 가진다. 출처