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.0.tar.gz (27.6 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.0-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: afo-0.1.0.tar.gz
  • Upload date:
  • Size: 27.6 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.0.tar.gz
Algorithm Hash digest
SHA256 2ea500b79fbaec4625926cd7b93d2a89082daf64e17430fd76ea0198960ab1ad
MD5 a26a6b10ebd571e74cfd9d0645d979a6
BLAKE2b-256 fdbc8885dfc479f984b5a77019d01fec87df677983580bccb02d0809c093f2f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for afo-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: afo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 41.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d907de409c30f2cbf09e72b5bb85a10016a3e6a12d65873e34a55c0d7277b5d2
MD5 2c87aee1e9d5ccec1e4f0eaebcb72df2
BLAKE2b-256 934e1052579f61d812f0fd65f4856aa918af36f1c7f3542522088c58ecfa05ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for afo-0.1.0-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