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.4.tar.gz (161.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.4-py3-none-any.whl (189.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gepa_adk-0.3.4.tar.gz
  • Upload date:
  • Size: 161.0 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.4.tar.gz
Algorithm Hash digest
SHA256 0640db9a3d99db1fd7da8076df9dc6286c197a3c24dcf597af4f64c12ec903bc
MD5 aa75797d35026009505d787fabe944ce
BLAKE2b-256 2ad3675d4744d894c7c3f12fc2ace6f7f3d7388cc2e27b934367d2e96c1ffcff

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gepa_adk-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 189.9 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 619f345fb90c09b2b83d4d387d2aa7e2ed37a8b6f796872d603ec6137eab8a7a
MD5 1bbcca15f13069ebd2508b69d3410fa2
BLAKE2b-256 7c765de73537d97464939c8f9c9c5450d8907c4d99d50f2fe3042a3da72e3b5e

See more details on using hashes here.

Provenance

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