AI Agent Observability Lab AI Agent Observability Lab
복잡한 멀티 에이전트 실행 흐름을 추적하고, 조건부 재시도 루프와 운영용 로깅 체계를 함께 검증하는 observability prototype입니다. An observability prototype for tracing complex multi-agent execution flows while validating conditional retry loops and an operational logging stack.
이 프로젝트는 production-ready 수준의 AI monitoring and logging pipeline을 실험하는 prototype입니다. 핵심은 에이전트가 어떤 판단을 내렸는지, 어떤 step에서 비용과 지연이 커지는지, 오류가 어떻게 revise loop로 되돌아가는지를 한 번에 드러내는 데 있습니다. This project is a prototype for testing a production-ready AI monitoring and logging pipeline. Its core goal is to reveal, in one place, how the agent reasons, where cost and latency grow, and how failures return into a revise loop.
Solution Solution
단순 1-pass 체인으로는 자율 에이전트의 오류 원인을 찾기 어렵기 때문에, LangGraph 기반 state machine으로 실행 단계를 명시적으로 분리했습니다. 각 노드의 입력값, 출력값, 오류 컨텍스트를 Langfuse trace로 남겨 reasoning path를 블랙박스가 아니라 운영 가능한 로그로 바꾸는 데 초점을 맞췄습니다. Because a simple one-pass chain makes autonomous agent failures difficult to diagnose, we separated execution stages explicitly with a LangGraph-based state machine. Inputs, outputs, and error context from each node are captured as Langfuse traces so the reasoning path becomes an operational log rather than a black box.
또한 critic와 reviser를 조건부 edge로 연결해 오류 발생 시 즉시 종료하지 않고 self-correction loop를 검증할 수 있게 했습니다. 이 설계 덕분에 응답 품질을 높이는 것과 디버깅 가능성을 확보하는 것을 동시에 다룰 수 있었습니다. We also connected critic and reviser through conditional edges so failures do not immediately terminate execution, enabling a verifiable self-correction loop. This lets the project handle both response quality improvement and debuggability at the same time.
Architecture Architecture
브라우저 요청은 LangGraph agent로 들어와 reasoning node, tool node, critique node를 순차적으로 통과합니다. 실행 데이터는 별도 observability plane으로 분기되어 Langfuse에 적재되고, Langfuse는 PostgreSQL, ClickHouse, Redis를 통해 메타데이터, 분석 로그, 캐시를 나눠 관리합니다. Browser requests enter a LangGraph agent and move through reasoning, tool, and critique nodes. Execution data is forked into a separate observability plane and written to Langfuse, which manages metadata, analytics logs, and cache across PostgreSQL, ClickHouse, and Redis.
중요한 점은 기능 데모보다 운영 구조를 먼저 세웠다는 것입니다. 어떤 프롬프트가 비용을 키우는지, 어떤 step이 latency 병목인지, 어떤 응답이 revise 신호를 발생시키는지를 한 화면에서 확인할 수 있도록 설계했습니다. The important choice was prioritizing operational structure over feature novelty. The architecture is designed so one screen can reveal which prompts drive cost, which steps create latency bottlenecks, and which outputs trigger revision signals.
Technical Decisions Technical Decisions
Conditional Edge Routing Conditional Edge Routing
선형 파이프라인은 구현은 쉽지만 오류 방어가 약합니다. 그래서 `AgentState`를 공유하고 critique 결과에 따라 reviser로 되돌리는 conditional edge를 둬 retry flow를 제어했습니다. A linear pipeline is easy to implement but weak at handling errors. We shared `AgentState` and added conditional edges that route back into the reviser when critique signals require a retry.
Persistent Logging Stack Persistent Logging Stack
데모용 ephemeral 환경에서 끝내지 않기 위해 Docker Compose와 바인드 마운트, `.env` 분리를 함께 적용했습니다. 로그 영속성과 보안 분리를 동시에 챙기기 위한 선택입니다. To avoid staying in a demo-only ephemeral environment, we combined Docker Compose, bind mounts, and `.env` isolation. The decision supports both log persistence and configuration security.