This integration uses the Weights & Biases Weave SDK (
weave), because the CoreWeave Forge SDK doesn’t support this framework yet. Traces you send with Weave appear in Agent Lens, because both products share the same trace data.Agent Lens로 Google ADK 에이전트 트레이스하기
- Python
- TypeScript
Weave SDK는 Google ADK for Python을 자동 패치하므로 최소한의 설정만으로 ADK 에이전트의 트레이스를 캡처할 수 있습니다. 이 가이드에서는 Weave를 초기화한 후 Google ADK로 구축한 멀티턴 리서치 에이전트를 실행하여, 세션 전반에 걸친 모든 에이전트 호출, 모델 Call, 도구 Call을 Agent Lens로 캡처하는 방법을 설명합니다.
사전 요구 사항
- CoreWeave Forge 계정 및
WANDB_API_KEY환경 변수로 설정한 API 키 - Gemini용 Google API 키
- Python 3.10 이상
패키지 설치
개발 환경에 다음 패키지를 설치하세요. 이 패키지들은 Weave SDK, Google ADK 프레임워크, 예시 도구에서 사용하는 HTTP 클라이언트를 제공합니다.코드에서 Agent Lens 초기화하기
- Python
- TypeScript
프로젝트에 이 예시는 하나의 ADK 세션에서 세 개의 턴을 실행합니다. 처음 두 턴은 Wikipedia 조회를 트리거하고, 세 번째 턴은 도구 Call 없이 이전 대화 컨텍스트를 활용해 요약을 생성합니다.모든 턴은 동일한
weave.init을 추가하고 Forge 팀 이름과 프로젝트 이름을 지정한 다음, 평소와 같은 방식으로 에이전트를 구축하세요. 다음 코드는 gemini-3.6-flash와 wikipedia_search 도구를 사용하는 research_assistant 에이전트를 생성하고, 하나의 ADK 세션에서 세 가지 질문을 실행합니다. 이 과정에서 Agent Lens가 트레이스를 캡처합니다.session_id를 전달합니다. ADK가 이 세션을 기반으로 gen_ai.conversation.id를 설정하므로, Agent Lens는 Conversations 탭에서 세 턴을 하나의 대화로 표시합니다. 반면 턴마다 세션을 새로 생성하면 각 턴이 별도의 대화로 표시됩니다.View your traces in Agent Lens
After the script runs,weave.init() prints a link to your project in Weave. The same traces appear in Agent Lens, because both products share the same trace data. To view them in Agent Lens:
- Navigate to CoreWeave Forge and select Agent Lens from the product menu.
- Select your project.
- In the Agent Lens side menu, select Conversations, and then select your conversation.
invoke_agent span with nested chat and execute_tool spans. Each span shows its input, model, output, token usage, and tool results.
For more information, see View agent activity.