Skip to main content

Evolutionary optimization for Google ADK agents

Project description

CI Coverage PyPI Python License Ruff docs vetted

gepa-adk

Evolutionary optimization for Google ADK agents.

What is this?

gepa-adk evolves AI agent instructions automatically. Give it an agent and training examples, and it finds better prompts through iterative improvement.

Installation

pip install gepa-adk
export GOOGLE_API_KEY=your-api-key  # or other ADK-supported model

Quick Start

Evolve a greeting agent to produce formal, Dickens-style greetings:

import asyncio
from google.adk.agents import LlmAgent
from gepa_adk import evolve, EvolutionConfig, SimpleCriticOutput

agent = LlmAgent(
    name="greeter",
    model="gemini-2.5-flash",
    instruction="Greet the user appropriately.",
)

critic = LlmAgent(
    name="critic",
    model="gemini-2.5-flash",
    instruction="Score for formal, Dickens-style greetings. 0.0-1.0.",
    output_schema=SimpleCriticOutput,
)

trainset = [
    {"input": "I am His Majesty, the King."},
    {"input": "I am your mother."},
    {"input": "I am a close friend."},
]

config = EvolutionConfig(
    max_iterations=5,
    patience=1,
    reflection_model="gemini-2.5-flash",  # Model for generating improvements
)
result = asyncio.run(evolve(agent, trainset, critic=critic, config=config))
print(f"Score: {result.original_score:.2f} -> {result.final_score:.2f}")
print(result.evolved_components["instruction"])

Examples

Documentation

Getting Started · Guides · API Reference

Credits

Based on GEPA (source). Built on Google ADK (source).

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gepa_adk-1.0.0.tar.gz (166.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gepa_adk-1.0.0-py3-none-any.whl (203.2 kB view details)

Uploaded Python 3

File details

Details for the file gepa_adk-1.0.0.tar.gz.

File metadata

  • Download URL: gepa_adk-1.0.0.tar.gz
  • Upload date:
  • Size: 166.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gepa_adk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1098b35a7390d8f479531cd641283d0978f73074132005673dec488760a3e87f
MD5 dfbfa9386e75672cb2c1e3b3330d4e37
BLAKE2b-256 1fc894eaa5595b991fb8a98f30569593d82c020987fe33ed684afb2e8c660126

See more details on using hashes here.

File details

Details for the file gepa_adk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gepa_adk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 203.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gepa_adk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5fcce8e0bfe99fd2ab080307151246f6d99fd51a84c2818e02099835a3c78db
MD5 67685cc1da9923c5e77a7c51a85bf34e
BLAKE2b-256 bc8a869dc26b01a5c5d1756d0a4a653c3a63a6d50f8c9bf36702e5f1899b7f0c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page