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.1.tar.gz (28.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.1-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: afo-0.1.1.tar.gz
  • Upload date:
  • Size: 28.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.1.tar.gz
Algorithm Hash digest
SHA256 3384194be0cdb2fc55f12c4c0fb5eb461090fddceaea3e8dfa00ecaa667889e9
MD5 b58daefccd9d374791dd984b3cce8502
BLAKE2b-256 7d7651fd33308375a683c5e707396504546d16e1b332ad66b52c12ac8f5a35b0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: afo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 41.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9cd82c5360bfdb924b96a7737137fc5589798b71bcd9d0e6f668d7a44674d7b4
MD5 d065b4a4b8422133a1721123d004e4ba
BLAKE2b-256 b6f6aec5db13c48779b12d95f12263ef73193a3984bdc05ef8809593e47b1b69

See more details on using hashes here.

Provenance

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