ACEPlaybook

class ACEPlaybook(storagePath: ResilientPath)

Mutable collection of curated PlaybookSections persisted to storagePath.

The playbook is the artifact optimized by ACEOptimizer: insights are accumulated as bullets, refined via DeltaUpdates, and injected into the agent's system prompt at run time. Backed by a JSON file that is loaded with load and persisted with save.

Constructors

Link copied to clipboard
constructor(storagePath: ResilientPath)

Types

Link copied to clipboard
data class UpdatedBullets(val helpfulBullets: List<String>, val harmfulBullets: List<String>, val neutralBullets: List<String>, val notFoundBullets: List<String>, val unknownBulletTags: List<ACEOptimizer.BulletTag>)

Outcome of an updateCounters call, partitioning the processed bullet tags by how they were handled.

Functions

Link copied to clipboard

Returns true if delta was applied; false otherwise.

Link copied to clipboard

Reads the playbook contents from storagePath into this instance and returns it.

Link copied to clipboard
fun save()

Persists the current sections to storagePath as pretty-printed JSON, creating parent directories as needed.

Link copied to clipboard
fun toJson(json: Json): String

Serializes the playbook sections to a JSON string using the provided json instance.

Link copied to clipboard

Renders the playbook as a human-readable, sectioned text block for embedding in an LLM prompt.

Link copied to clipboard

Applies bulletTags to the playbook, incrementing each referenced bullet's helpful/harmful counter, and returns a breakdown of what happened as UpdatedBullets.