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.5.tar.gz (161.4 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.5-py3-none-any.whl (190.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gepa_adk-0.3.5.tar.gz
  • Upload date:
  • Size: 161.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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.5.tar.gz
Algorithm Hash digest
SHA256 f974f475ac7175041bcfb996d5546b6e04a1dc9acb7cf26cb0ff30903afee12a
MD5 73ca01602f57ffcf628ee30c35df4081
BLAKE2b-256 1c07adf76b20c039299da396c7fcd89fa158da7b2b2e311a17f0510e74a1f2e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for gepa_adk-0.3.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: gepa_adk-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 190.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4cd604fc0bda8f100f526a8ba94febffb32e84b14f22d08fbf23969446efe37d
MD5 3b44aeedc3ca724a0033e6d779ff668b
BLAKE2b-256 d766d14228918dd1dacb4eb6342337c50712adea14d6aeae9642824fe2e88afd

See more details on using hashes here.

Provenance

The following attestation bundles were made for gepa_adk-0.3.5-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