Skip to main content

Evolutionary optimization for Google ADK agents

Project description

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-0.3.3.tar.gz (155.0 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-0.3.3-py3-none-any.whl (182.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gepa_adk-0.3.3.tar.gz
  • Upload date:
  • Size: 155.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","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-0.3.3.tar.gz
Algorithm Hash digest
SHA256 127c12e2c8a726dd9c7a020905504bd75466895370dd9d2da89502c132d82154
MD5 2a9c740d562ab47dd13b6b1b82d315b9
BLAKE2b-256 c9948434cd9b5c73f93a341638f8e1db61b8272f4d0e700d5e94a98074ab1850

See more details on using hashes here.

Provenance

The following attestation bundles were made for gepa_adk-0.3.3.tar.gz:

Publisher: publish.yml on Alberto-Codes/gepa-adk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: gepa_adk-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 182.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","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-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32dc05e6e2fa7ccabb62327bc4a157fbed17d9586245982a7795420f5328ac2e
MD5 0983bfac4ed59effafdcd7fd417a3575
BLAKE2b-256 fe75489c839c3bfed43484e0f194973db82f8279706d131fd69f298b11d0cb23

See more details on using hashes here.

Provenance

The following attestation bundles were made for gepa_adk-0.3.3-py3-none-any.whl:

Publisher: publish.yml on Alberto-Codes/gepa-adk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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