Skip to main content

Agent Focused Optimization framework for bounded agent optimization loops

Project description

AFO

Agent Focused Optimization (AFO) is a small Python framework for bounded agent optimization loops.

AFO separates the agent that chooses actions from the world model that verifies, evaluates, records, and checks convergence. The package is intentionally generic: users provide their own design space, evaluation model, tools, and convergence criteria.

Installation

python -m pip install afo

For local development from this repository:

python -m pip install -e .

Quick Start

Run the bundled quadratic smoke example:

afo run-example quadratic

Or run it from source:

python examples/quadratic/run_quadratic.py

Core Concepts

  • Agent: selects the next bounded tool call.
  • ActionSpace: declares the tools the agent may use.
  • DesignSpace: verifies proposed design variables.
  • EvaluationModel: evaluates verified design variables.
  • WorldModel: verifies, evaluates, records, and checks convergence.
  • RunLoop: executes the default AFO loop.

Minimal Example

from afo.logical.world_model.evaluation_model import EvaluationModel
from afo.logical.world_model.evaluation_result import EvaluationResult


class MyEvaluationModel(EvaluationModel):
    def evaluate(self, design_variable, evaluation_inputs=None):
        return EvaluationResult(value=design_variable["x"] ** 2)

See examples/quadratic/ for a complete runnable example.

SysML

The repository includes AFO.sysml, the SysML source describing the framework requirements, functional actions, logical contracts, and physical flow.

License

AFO is distributed under the GNU General Public License v3.0 only.

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

afo-0.1.2.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

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

afo-0.1.2-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file afo-0.1.2.tar.gz.

File metadata

  • Download URL: afo-0.1.2.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for afo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 54fefca0659430cdbc579c7f0313e27fddbd6c1134e867bc674fef9998187f18
MD5 16e5f15717de369d3b6caeaeeb1e54d6
BLAKE2b-256 73bf2236579461dad0109b5c77906ca122eb18528d9fb70da23d048a1f00cead

See more details on using hashes here.

Provenance

The following attestation bundles were made for afo-0.1.2.tar.gz:

Publisher: workflow.yml on triet228/AFO

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

File details

Details for the file afo-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: afo-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for afo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69902eba40b75df16d03c73ace4069329040284af9e540e0cbea9261a1f76978
MD5 5824d70efe99c7de48f44d735b44f863
BLAKE2b-256 2932258142a1151cb81a23aef88f871dc01a1ef473d036be89f4a889b70d0991

See more details on using hashes here.

Provenance

The following attestation bundles were made for afo-0.1.2-py3-none-any.whl:

Publisher: workflow.yml on triet228/AFO

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