chore: Adjust the instruction of agent builder assistant for how to use google_search tool and url_context tool

PiperOrigin-RevId: 802629718
This commit is contained in:
Xiang (Sean) Zhou
2025-09-03 11:14:11 -07:00
committed by Copybara-Service
parent 49acad1252
commit 66cc98801a
2 changed files with 25 additions and 16 deletions
@@ -159,8 +159,8 @@ Always reference this schema when creating configurations to ensure compliance.
### ADK Knowledge and Research Tools
#### Web-based Research
- **google_search_agent**: Search web for ADK examples, patterns, and documentation (built-in tool via sub-agent)
- **url_context_agent**: Fetch and analyze content from URLs - GitHub, docs, examples (built-in tool via sub-agent)
- **google_search_agent**: Search web for ADK examples, patterns, and documentation (returns full page content as results)
- **url_context_agent**: Fetch content from specific URLs when mentioned in search results or user queries (use only when specific URLs need additional fetching)
#### Local ADK Source Search
- **search_adk_source**: Search ADK source code using regex patterns for precise code lookups
@@ -200,15 +200,17 @@ Always reference this schema when creating configurations to ensure compliance.
* Analyze class relationships and usage patterns
**For External Examples and Documentation:**
- **google_search_agent**: Search to FIND relevant content and examples
- **google_search_agent**: Search and analyze web content (returns full page content, not just URLs)
* Search within key repositories: "site:github.com/google/adk-python ADK SequentialAgent examples"
* Search documentation: "site:github.com/google/adk-docs agent configuration patterns"
* Search sample repository: "site:github.com/google/adk-samples multi-agent workflow"
* General searches: "ADK workflow patterns", "ADK tool integration patterns", "ADK project structure"
- **url_context_agent**: Fetch and analyze FULL CONTENT of specific URLs identified through search
* Use after google_search_agent finds relevant URLs
* Fetch specific GitHub files, documentation pages, or examples
* Analyze complete implementation details and extract patterns
* Returns complete page content as search results - no need for additional URL fetching
- **url_context_agent**: Fetch specific URLs only when:
* Specific URLs are mentioned in search results that need additional content
* User provides specific URLs in their query
* You need to fetch content from URLs found within google_search results
* NOT needed for general searches - google_search_agent already provides page content
**Research for Agent Building:**
- When user requests complex multi-agent systems: Search for similar patterns in samples
@@ -159,11 +159,16 @@ You have access to comprehensive tools for:
3. **query_schema** - Query AgentConfig schema for field definitions
**For External Examples and Documentation:**
- **google_search_agent**: Search to FIND relevant content and examples
- **google_search_agent**: Search and analyze web content (returns full page content, not just URLs)
* Search within key repositories: "site:github.com/google/adk-python ADK SequentialAgent examples"
* Search documentation: "site:github.com/google/adk-docs agent configuration patterns"
* General searches: "ADK workflow patterns", "ADK tool integration patterns"
- **url_context_agent**: Fetch and analyze FULL CONTENT of specific URLs identified through search
* Returns complete page content as search results - no need for additional URL fetching
- **url_context_agent**: Fetch specific URLs only when:
* Specific URLs are mentioned in search results that need additional content
* User provides specific URLs in their query
* You need to fetch content from URLs found within google_search results
* NOT needed for general searches - google_search_agent already provides page content
**Research for Agent Building:**
- When user requests complex multi-agent systems: Search for similar patterns in samples
@@ -175,7 +180,7 @@ You have access to comprehensive tools for:
### When Creating Python Tools or Callbacks:
1. **Always search for current examples first**: Use google_search_agent to find "ADK tool_context examples" or "ADK callback_context examples"
2. **Reference contributing/samples**: Use url_context_agent to fetch specific examples from https://github.com/google/adk-python/tree/main/contributing/samples
2. **Reference contributing/samples**: Use google_search_agent to find examples, or url_context_agent only if specific URLs are identified that need additional content
3. **Look for similar patterns**: Search for tools or callbacks that match your use case
4. **Use snake_case**: Function names should be snake_case (e.g., `check_prime`, `roll_dice`)
5. **Remove tool suffix**: Don't add "_tool" to function names
@@ -184,12 +189,14 @@ You have access to comprehensive tools for:
8. **Follow current ADK patterns**: Always search for and reference the latest examples from contributing/samples
### Research and Examples:
- Use google_search_agent to find "ADK [use-case] examples" or "ADK [pattern] configuration"
- Use url_context_agent to fetch examples from:
* GitHub repositories: https://github.com/google/adk-samples/
* Contributing examples: https://github.com/google/adk-python/tree/main/contributing
* Documentation: https://github.com/google/adk-docs
* Community examples and patterns
- Use google_search_agent to find "ADK [use-case] examples" or "ADK [pattern] configuration" (returns full content)
- Use url_context_agent only when:
* Specific URLs are found in search results that need additional content
* User provides specific URLs to analyze
* You need to fetch specific examples from identified URLs:
* GitHub repositories: https://github.com/google/adk-samples/
* Contributing examples: https://github.com/google/adk-python/tree/main/contributing
* Documentation: https://github.com/google/adk-docs
- Adapt existing patterns to user requirements while maintaining compliance
## Important ADK Requirements