Skip to main content

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 using genetic algorithms and Pareto frontier selection.

Supports single-agent evolution, multi-agent co-evolution, workflow optimization (Sequential, Loop, Parallel agents), output schema evolution, generation config tuning, and multimodal inputs including video.

Requirements

  • Python 3.12+
  • Ollama with a local model (recommended for development), or any model supported by LiteLLM

Installation

pip install gepa-adk
# For local models (recommended)
export OLLAMA_API_BASE=http://localhost:11434

Quick Start

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

from google.adk.agents import LlmAgent
from google.adk.models.lite_llm import LiteLlm
from gepa_adk import evolve, run_sync, EvolutionConfig, SimpleCriticOutput

model = LiteLlm(model="ollama_chat/llama3.2:latest")

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

critic = LlmAgent(
    name="critic",
    model=model,
    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="ollama_chat/llama3.2:latest",
)
result = run_sync(evolve(agent, trainset, critic=critic, config=config))
print(f"Score: {result.original_score:.2f} -> {result.final_score:.2f}")
print(result.evolved_components["instruction"])

Examples

Getting started:

Multi-agent & workflows:

Advanced:

Documentation

Getting Started · Guides · API Reference

Credits

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

License

Apache 2.0

Release files for gepa-adk 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gepa-adk 2.2.0
File Size Uploaded
gepa_adk-2.2.0.tar.gz 185.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gepa-adk 2.2.0
File Interpreter ABI Platform
gepa_adk-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 406.3 kB

Release files / gepa_adk-2.2.0.tar.gz

Download URL gepa_adk-2.2.0.tar.gz
Size 185.2 kB
Tags Source
SHA-256 checksum
How to use checksums
590bd482f57129ffaf0d7f86be05036262d7c64d20e104fdc669c80a4e4ee508
BLAKE2b-256 checksum
How to use checksums
7feed3b4fa85133acd401299dca1298c9fadec0bfb114543ffe69c3eb836ebb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","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}

Release files / gepa_adk-2.2.0-py3-none-any.whl

Download URL gepa_adk-2.2.0-py3-none-any.whl
Size 221.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0785a4b05af397b81b19bb6457e7774e62fb4b746c5d5fb41cb1a29ab826c7fe
BLAKE2b-256 checksum
How to use checksums
f364b927d4b779fe41630dc1e441ced4c5c80480adb14082d75081f52f798189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","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}

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page