Skip to main content

Overview

Demonstrates how agents can autonomously search codebases by:
  • Searching for files matching patterns
  • Reading relevant files
  • Synthesizing information into answers
  • Using subagents for specialized tasks
This example shows the agent determining search strategy, executing searches, and analyzing results without predefined workflows. The agent decides which files to read based on search results. Key concepts:
  • SearchFilesTool: Search for files by filename/path pattern
  • ReadFileTool: Read file contents
  • UseSubagents: Spawn specialized subagents for subtasks
  • AgentEventConsoleObserver: Provides visibility into agent execution stages

Example