Skip to content

Commit 66cc988

Browse files
seanzhougooglecopybara-github
authored andcommitted
chore: Adjust the instruction of agent builder assistant for how to use google_search tool and url_context tool
PiperOrigin-RevId: 802629718
1 parent 49acad1 commit 66cc988

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

contributing/samples/adk_agent_builder_assistant/instruction_embedded.template

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ Always reference this schema when creating configurations to ensure compliance.
159159
### ADK Knowledge and Research Tools
160160

161161
#### Web-based Research
162-
- **google_search_agent**: Search web for ADK examples, patterns, and documentation (built-in tool via sub-agent)
163-
- **url_context_agent**: Fetch and analyze content from URLs - GitHub, docs, examples (built-in tool via sub-agent)
162+
- **google_search_agent**: Search web for ADK examples, patterns, and documentation (returns full page content as results)
163+
- **url_context_agent**: Fetch content from specific URLs when mentioned in search results or user queries (use only when specific URLs need additional fetching)
164164

165165
#### Local ADK Source Search
166166
- **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.
200200
* Analyze class relationships and usage patterns
201201

202202
**For External Examples and Documentation:**
203-
- **google_search_agent**: Search to FIND relevant content and examples
203+
- **google_search_agent**: Search and analyze web content (returns full page content, not just URLs)
204204
* Search within key repositories: "site:github.com/google/adk-python ADK SequentialAgent examples"
205205
* Search documentation: "site:github.com/google/adk-docs agent configuration patterns"
206206
* Search sample repository: "site:github.com/google/adk-samples multi-agent workflow"
207207
* General searches: "ADK workflow patterns", "ADK tool integration patterns", "ADK project structure"
208-
- **url_context_agent**: Fetch and analyze FULL CONTENT of specific URLs identified through search
209-
* Use after google_search_agent finds relevant URLs
210-
* Fetch specific GitHub files, documentation pages, or examples
211-
* Analyze complete implementation details and extract patterns
208+
* Returns complete page content as search results - no need for additional URL fetching
209+
- **url_context_agent**: Fetch specific URLs only when:
210+
* Specific URLs are mentioned in search results that need additional content
211+
* User provides specific URLs in their query
212+
* You need to fetch content from URLs found within google_search results
213+
* NOT needed for general searches - google_search_agent already provides page content
212214

213215
**Research for Agent Building:**
214216
- When user requests complex multi-agent systems: Search for similar patterns in samples

contributing/samples/adk_agent_builder_assistant/instruction_query.template

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,16 @@ You have access to comprehensive tools for:
159159
3. **query_schema** - Query AgentConfig schema for field definitions
160160

161161
**For External Examples and Documentation:**
162-
- **google_search_agent**: Search to FIND relevant content and examples
162+
- **google_search_agent**: Search and analyze web content (returns full page content, not just URLs)
163163
* Search within key repositories: "site:github.com/google/adk-python ADK SequentialAgent examples"
164164
* Search documentation: "site:github.com/google/adk-docs agent configuration patterns"
165165
* General searches: "ADK workflow patterns", "ADK tool integration patterns"
166-
- **url_context_agent**: Fetch and analyze FULL CONTENT of specific URLs identified through search
166+
* Returns complete page content as search results - no need for additional URL fetching
167+
- **url_context_agent**: Fetch specific URLs only when:
168+
* Specific URLs are mentioned in search results that need additional content
169+
* User provides specific URLs in their query
170+
* You need to fetch content from URLs found within google_search results
171+
* NOT needed for general searches - google_search_agent already provides page content
167172

168173
**Research for Agent Building:**
169174
- When user requests complex multi-agent systems: Search for similar patterns in samples
@@ -175,7 +180,7 @@ You have access to comprehensive tools for:
175180

176181
### When Creating Python Tools or Callbacks:
177182
1. **Always search for current examples first**: Use google_search_agent to find "ADK tool_context examples" or "ADK callback_context examples"
178-
2. **Reference contributing/samples**: Use url_context_agent to fetch specific examples from https://github.com/google/adk-python/tree/main/contributing/samples
183+
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
179184
3. **Look for similar patterns**: Search for tools or callbacks that match your use case
180185
4. **Use snake_case**: Function names should be snake_case (e.g., `check_prime`, `roll_dice`)
181186
5. **Remove tool suffix**: Don't add "_tool" to function names
@@ -184,12 +189,14 @@ You have access to comprehensive tools for:
184189
8. **Follow current ADK patterns**: Always search for and reference the latest examples from contributing/samples
185190

186191
### Research and Examples:
187-
- Use google_search_agent to find "ADK [use-case] examples" or "ADK [pattern] configuration"
188-
- Use url_context_agent to fetch examples from:
189-
* GitHub repositories: https://github.com/google/adk-samples/
190-
* Contributing examples: https://github.com/google/adk-python/tree/main/contributing
191-
* Documentation: https://github.com/google/adk-docs
192-
* Community examples and patterns
192+
- Use google_search_agent to find "ADK [use-case] examples" or "ADK [pattern] configuration" (returns full content)
193+
- Use url_context_agent only when:
194+
* Specific URLs are found in search results that need additional content
195+
* User provides specific URLs to analyze
196+
* You need to fetch specific examples from identified URLs:
197+
* GitHub repositories: https://github.com/google/adk-samples/
198+
* Contributing examples: https://github.com/google/adk-python/tree/main/contributing
199+
* Documentation: https://github.com/google/adk-docs
193200
- Adapt existing patterns to user requirements while maintaining compliance
194201

195202
## Important ADK Requirements

0 commit comments

Comments
 (0)