Repair API
The Repair API takes a failing schema and its error codes, then returns an optimal sequence of repair actions. It uses beam search to explore multiple repair paths simultaneously and returns the highest-scoring candidates.
POST /rank-edits/jepa
Request:
Response:
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
schema | object | required | The schema to repair |
errors | string[] | required | Error category codes from /error-check |
beam_width | int | 5 | Number of parallel repair paths to explore |
max_steps | int | 10 | Maximum repair actions per path |
How Beam Search Works
The repair process explores multiple fix strategies in parallel:
- Start: The failing schema is the root state
- Expand: For each candidate, generate possible next repair actions
- Score: Predict the validity of each resulting schema
- Prune: Keep only the top
beam_widthcandidates - Repeat: Continue until all candidates are valid or
max_stepsis reached
This avoids greedy repair (fixing one error but introducing another) by evaluating the cumulative effect of each action sequence.
Python SDK
Next Steps
- Verification API - Get error codes to feed into repair
- Planning API - Plan from scratch instead of repairing