Optimal

Coordinate coding agents on one codebase.

A Python library that plans and checks AI coding agents’ work.

Checked, recorded

A finished house: each part is a coding task, and all five tasks show a check mark.
  • ready
  • >_running
  • checked
  • reused
  • redo

Five coding tasks drawn as house parts: schema is the foundation, api the frame, search the entrance, ui the roof and payments the wing. Optimal lists schema as ready first. Then api and search run in parallel. ui and payments wait until what they need has passed its checks. A change to search marks search and ui to redo, while schema, api and payments are reused. The checks pass and the record is kept.

Private preview

from optimal.graph import GraphIndex
needs = {"schema": [], "api": ["schema"], "search": ["schema"], "ui": ["api", "search"], "payments": ["api"]}
graph = GraphIndex([{"id": t, "depends_on": d} for t, d in needs.items()])
graph.ready({"schema"})                     # ['api', 'search']
graph.ready({"schema", "api", "search"})    # ['payments', 'ui']
graph.invalidation({"search"})["affected"]  # ['search', 'ui']
Read the guide