๊ฐ€์ž… ํ›„ ์ดˆ๋Œ€ ๋งํฌ๋ฅผ ๊ณต์œ ํ•˜๋ฉด ๋™์˜์ƒ ์žฌ์ƒ ๋ฐ ์ดˆ๋Œ€ ๋ณด์ƒ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

cv usk
@cv_usk
AI / Software Research Notes AI Agent, LLMOps, MLOps, Software Architecture ๆŠ•็จฟใฏๅ€‹ไบบใฎๆ„่ฆ‹ใงใ™ใ€‚
๊ฐ€์ž… May 2026
286 ํŒ”๋กœ์ž‰ ์ค‘    469 ํŒฌ
# Useful but Little-Known Features of ADK 2.0 ๐ŸŒ What if your agent's prompts could improve themselves automatically, instead of requiring manual tuning? ADK 2.0's optimization feature combines samplers and agent optimizers to automatically refine your agent's instructions based on evaluation results. ๐Ÿ“Œ Title: Optimization ๐Ÿ”— URL: ๐Ÿงฉ Overview The optimization feature consists of two components: Samplers (which evaluate candidates) and Agent Optimizers (which improve instructions). `LocalEvalSampler` runs candidate agents against evaluation datasets and computes scores. Two optimizers are available: `GEPARootAgentPromptOptimizer`, which uses the GEPA algorithm to optimize the root agent's prompt, and `SimplePromptOptimizer`, which iterates through an execute-evaluate-critique-rewrite cycle. Results are returned as an `OptimizerResult` containing optimized agents with their scores. ๐Ÿ›  How to use it Run optimization from the CLI with `adk optimize`. ```python import asyncio from google.adk.evaluation.eval_config import EvalConfig from google.adk.evaluation.local_eval_sets_manager import LocalEvalSetsManager from google.adk.optimization.local_eval_sampler import LocalEvalSampler from google.adk.optimization.local_eval_sampler import LocalEvalSamplerConfig from google.adk.optimization.simple_prompt_optimizer import SimplePromptOptimizer from google.adk.optimization.simple_prompt_optimizer import ( SimplePromptOptimizerConfig, ) # Set up the sampler sampler_config = LocalEvalSamplerConfig( eval_config=EvalConfig(criteria={"response_match_score": 0.75}), app_name="my_agent", train_eval_set="train_eval_set", ) sampler = LocalEvalSampler(sampler_config, LocalEvalSetsManager(agents_dir=".")) # Run optimization optimizer = SimplePromptOptimizer(config=SimplePromptOptimizerConfig()) result = sampler)) # Get the optimized agent and score best = result.optimized_agents[0] best_agent = best.optimized_agent print(f"Score: {best.overall_score}") ``` ๐Ÿ— Building it into production ใƒปRun optimization periodically as evaluation datasets evolve, keeping prompts continuously refined ใƒปUse `SimplePromptOptimizer` for quick iterations and `GEPARootAgentPromptOptimizer` for thorough exploration ใƒปCompare pre- and post-optimization scores and only update prompts when improvement is confirmed ใƒปBuild evaluation datasets from real user interactions for practical optimization ๐Ÿ’ก Use cases ๐Ÿ“ˆ Automatically improve agent prompts based on evaluation scores ๐Ÿ”ฌ Systematically compare multiple prompt candidates and select the best one ๐Ÿ”„ Re-optimize prompts after model changes or API specification updates ๐ŸŽฏ Fine-tune prompts for specific tasks like code generation, summarization, or classification โš ๏ธ Watch out `GEPARootAgentPromptOptimizer` only optimizes the root agent's prompt. It does not cover sub-agent prompts, so optimize those separately if needed. Also, optimization requires multiple evaluation runs, so keep an eye on LLM API call costs. โœจ With optimization, you can move from trial-and-error prompt tuning to data-driven automation. Set up regular optimization cycles to continuously raise your agent's quality bar. #ADK# #AIAgent#
๋” ๋ณด๊ธฐ