improve() runs a complete optimization method against one profile field.
The method receives train and selection cases.
Runtime keeps the final-test cases private, compares the selected candidate with the baseline, and returns a detached candidate.
It never changes the input profile.
pnpm tsx examples/improve/improve.tsRuns offline, no credentials.
- Runtime extracts the exact profile field selected by
surface. - Runtime binds saved work to
executionRefplus the complete baseline profile. - The supplied
OptimizationMethodgenerates and selects a candidate using train and selection cases. - Runtime scores the baseline and candidate on the untouched final-test cases.
- Runtime returns
shiponly when the paired confidence interval clears the required lift. - Approval and activation remain separate operations.
improve() proposed a detached prompt candidate and measured it on final-test scenarios
decision: ship lift: 1.000
candidate prompt: PROMOTED
live prompt unchanged: BASELINE
The starting prompt is BASELINE; the candidate is PROMOTED.
The final-test lift is 1.000.
The example supplies a deterministic complete method, agent, and judge.
The method returns PROMOTED; the judge scores that literal string as 1.
The partition firewall, final comparison, cost receipts, and confidence interval are production code.
Replace scriptedWinner with officialGepa(...), officialSkillOpt(...), or another complete method from @tangle-network/agent-eval.
The root README documents the optional Python installation for official GEPA.
| file | what it is |
|---|---|
improve.ts |
The profile, complete method, three partitions, agent, judge, and result |
The same path is covered by src/improvement/improve.test.ts.