New agent addition to adk-samples/python/agents. Name of the agent is 'guidelines-driven-media-gen agent'#1338
Open
anushasabbineni1 wants to merge 2 commits intomainfrom
Open
New agent addition to adk-samples/python/agents. Name of the agent is 'guidelines-driven-media-gen agent'#1338anushasabbineni1 wants to merge 2 commits intomainfrom
anushasabbineni1 wants to merge 2 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request introduces a new agent sample,
guidelines-driven-media-gen, to theadk-samplesrepository. The agent acts as an automated image generation and validation system that iteratively creates and evaluates images based on text descriptions while adhering to predefined brand guidelines and policies (using a fictional brand, NeuroVibe AI, as a demonstration).The system utilizes a sequential multi-agent pipeline to ensure outputs satisfy compliance thresholds before completion.
✨ Key Features
Multi-Agent Orchestration: Coordinates specialized sub-agents (Prompt Gen, Image Gen, Scoring, and Checker) to achieve complex workflows.
Contextual Prompt Augmentation: Dynamically enriches user intent by consulting a local brand asset bank (TF-IDF retrieval) before generation.
Automated Policy Evaluation: Scores generated visual outputs against quantitative compliance requirements using advanced analysis benchmarks.
Self-Correction Feedback Loop: Automatically re-tries generation by passing failing attribute feedback back into the prompt loop for iterative refinement.
Enterprise Integration Ready: Designed with modularity to easily upgrade retrieval mechanisms (e.g., Vector Search) and connect with Cloud Digital Asset Management (DAM) systems.
📂 Changes Included
The implementation is located under python/agents/guidelines-driven-media-gen/ and includes:
Core Agent & Sub-Agents
agent.py: Main workflow orchestration.checker_agent.py: Loop control and evaluation thresholds.sub_agents/image/: Image generation handling (saving to GCS/artifacts).sub_agents/prompt/: Prompt optimization and asset search.sub_agents/scoring/: Visual analysis and policy scoring rules.Tools
fetch_existing_assets.py: Lexical search for brand assets.image_generation_tool.py: Integration with Image Generation models.loop_condition_tool.py: State management for self-correction loops.Configuration & Data
config.py,prompt.py,policy.json: Declarative templates for behavior.data/: Brand guidelines PDFs, asset images, and metadata for NeuroVibe AI.Deployment & Verification
deployment/deploy.py: Script to package (wheel build) and deploy securely to Vertex AI Agent Engine (Reasoning Engine).eval/test_eval.py: Automated pytests leveraging AgentEvaluator for verifying tools local behavior.✅ How to Verify
Local Testing
You can interact with the agent locally using the ADK CLI or Web interface:
bash
From workspace root
cd python/agents/guidelines-driven-media-genSync dependencies
uv sync --devRun via CLI
adk run guidelines_driven_media_genRun via Web UI
adk webAutomated Evaluations:
Run the local test suite (does not require Vertex AI Endpoint calls):
bash
uv run pytest evalDeployed Testing:
Package and deploy to Vertex AI Reasoning Engine:
bash
Build wheel
uv build --wheel --out-dir deploymentRun deployment script (configured via deploy_config.json)
uv run python deployment/deploy.pyTest deployment
uv run python deployment/test_deployment.py