Skip to main content

A framework for making agents more aware of their environment through explicit modeling of pre and post effects

Project description

Frame-log

Overview

Frame-log is a framework aiming to make agents more aware of their environment through the explicit modeling of pre and post effects. The approach is inspired by logic-based AI theory such as the "AI Frame Problem".

Repository Overview

This repository implements the Frame-Log framework, providing utility methods that are usable across agentic workflows. Specifically, the following are included:

  • Prompt templates to elicit change-logs
  • Pre-defined change-log schema
    • Currently supports JSON. Future work can include XML or git diff formats.
  • Extraction methods to decompose a set of change-logs from an agent response into structured objects
  • Evaluation and sanity check methods for change-logs, including:
    • Schema validation
    • Action verification
    • Semantic similarity-based effect grounding via sentence embeddings

Setup

pip install framelog

Quick Start

from framelog.extract_log import to_dict
from framelog.evaluator import ChangeLogEvaluator, ChangeLogFailureType

evaluator = ChangeLogEvaluator()

# Parse a change log from an agent response
change_log = to_dict(response, evaluator=evaluator)

# Advance the evaluator timestep
evaluator.step()

# Inspect failure rates
print(evaluator.no_json_rate())
print(evaluator.invalid_action_rate())
print(evaluator.failure_breakdown())

Supported Benchmarks

License

MIT


Do you spot any bugs? Inefficiencies? Or have any general suggestions? Please create an issue or contact me via miller.j.nasir@gmail.com

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

framelog-0.1.4.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

framelog-0.1.4-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file framelog-0.1.4.tar.gz.

File metadata

  • Download URL: framelog-0.1.4.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for framelog-0.1.4.tar.gz
Algorithm Hash digest
SHA256 67e68c494d4a4280e913b8a28c9059a9e58e3ceab8ec4f508274519ba92edb21
MD5 a5c20c17f46af0a74956009801f78ac0
BLAKE2b-256 1b505f850eec34d44ef9b454b85ad72716f88c6f695deeddebc36a5b4189a813

See more details on using hashes here.

File details

Details for the file framelog-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: framelog-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for framelog-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f1b47416bbfc80dfc5cf273badde66a209d7d9b6a6daa8e32874e5d4f6659714
MD5 68243f7c7c5f6e54613a97e0c7f19dec
BLAKE2b-256 c2f870ef128351043cab09cb8de480b1b15402683f4b4aa652e724883d82c44f

See more details on using hashes here.

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