Python 30줄로 심층 조사 에이전트 구축
언제 쓸까: 채팅에서 'X 조사'를 프로토타입했고 호출 가능한 에이전트로 만들고 싶을 때.
사전 조건
- Python 3.11+ and uv — uv가 없으면 설치; fast-agent는 uv를 사용함
- fast-agent 설치 — uvx fast-agent-mcp init; 프로젝트 디렉토리로 이동
흐름
-
스캐폴드Use fast-agent. Generate a research agent skeleton with tavily search + fetch + summarize tools.✓ 복사됨→ @fast.agent 데코레이터가 있는 agent.py
-
MCP 연결Attach the tavily-mcp and filesystem MCP servers in fastagent.config.yaml.✓ 복사됨→ 설정 검증됨; 서버 연결됨
-
실행 + 반복Run with: research 'state of small embedding models 2026'. Inspect the trace.✓ 복사됨→ 검색 → 페치 → 요약 체인을 보여주는 추적; 출처가 있는 브리핑 출력
-
eval 추가Author a 5-prompt eval; run nightly. Fail if any source citation is missing.✓ 복사됨→ eval 출력 녹색/빨간색; 야간 cron 설정됨
결과: 팀원에게 넘길 수 있는 재현 가능한 조사 파이프라인.
함정
- 데코레이터 마법으로 에이전트가 무엇을 하는지 불분명 — 항상 추적 읽기; 에이전트가 작동한다고 선언하기 전에 각 도구 호출 이해