@ax-llm/ax 23.0.0 → 23.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +424 -393
- package/index.cjs.map +1 -1
- package/index.d.cts +550 -12
- package/index.d.ts +550 -12
- package/index.global.js +324 -293
- package/index.global.js.map +1 -1
- package/index.js +430 -399
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/ax-agent-context.md +1 -1
- package/skills/ax-agent-memory-skills.md +1 -1
- package/skills/ax-agent-observability.md +1 -1
- package/skills/ax-agent-optimize.md +2 -1
- package/skills/ax-agent-rlm.md +1 -1
- package/skills/ax-agent.md +11 -1
- package/skills/ax-ai.md +1 -1
- package/skills/ax-audio.md +1 -1
- package/skills/ax-flow.md +1 -1
- package/skills/ax-gen.md +1 -1
- package/skills/ax-gepa.md +1 -1
- package/skills/ax-llm.md +1 -1
- package/skills/ax-playbook.md +14 -4
- package/skills/ax-refine.md +1 -1
- package/skills/ax-signature.md +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-agent-context
|
|
3
3
|
description: This skill helps an LLM pick the right AxAgent context tool for a job - contextMap for recurring corpora, contextPolicy presets for within-run trajectory compaction, agent.optimize for offline GEPA instruction/demo tuning, agent.playbook for an evolving context playbook (offline evolve + online update), and recall/memories + skills for per-turn retrieval. Use when the user asks "which context feature should I use", confuses contextMap with contextPolicy or memory, or wants a decision guide for long-context agents. For contextPolicy/contextMap codegen use ax-agent-rlm; for recall/skills use ax-agent-memory-skills; for agent.optimize or agent.playbook use ax-agent-optimize.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent Context Selection (@ax-llm/ax)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-agent-memory-skills
|
|
3
3
|
description: This skill helps an LLM generate correct AxAgent memory retrieval, context-map, and dynamic skill-loading code using @ax-llm/ax. Use when the user asks about contextMap, AxAgentContextMap, onMemoriesSearch, memoriesCatalog, recall(...), inputs.memories, onLoadedMemories, onUsedMemories, onSkillsSearch, skillsCatalog, AxAgentCatalogSkill, discover({ skills }), onLoadedSkills, onUsedSkills, preloaded skills, preloading memories at forward time, relevanceRanking hints, loaded memory/skill IDs, or carrying memories across forward() calls.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent Memory And Skills Rules (@ax-llm/ax)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-agent-observability
|
|
3
3
|
description: This skill helps an LLM generate correct AxAgent observability code using @ax-llm/ax. Use when the user asks about actorTurnCallback, onContextEvent, agentStatusCallback, onFunctionCall, reportSuccess, reportFailure, getChatLog(), getUsage(), resetUsage(), debug traces, progress updates, or telemetry for AxAgent runs.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent Observability Rules (@ax-llm/ax)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-agent-optimize
|
|
3
3
|
description: This skill helps an LLM generate correct AxAgent tuning and evaluation code using @ax-llm/ax. Use when the user asks about agent.optimize(...), judgeOptions, eval datasets, optimization targets, saved optimizedProgram artifacts, or agent optimization guidance.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent Optimize Codegen Rules (@ax-llm/ax)
|
|
@@ -45,6 +45,7 @@ Pick the optimization shape from the user's need:
|
|
|
45
45
|
- "Make the whole agent better" -> use the default actor target first; only broaden target selection when the user clearly wants that extra scope.
|
|
46
46
|
- "Tune child-agent delegation" -> use tasks that exercise when to call the child agent, when to call normal tools, and when to answer directly.
|
|
47
47
|
- "Compare before and after" -> include a held-out task plus artifact save/load and replay.
|
|
48
|
+
- "Repair the tasks it keeps failing, without eroding what works" -> this is playbook territory, not GEPA: use `agent.playbook().evolve(dataset)` (mines failures into verified playbook bullets under a held-out gate). See `ax-playbook`. `optimize(...)` maximizes a metric by tuning instructions and demos; `evolve(...)` grows the playbook.
|
|
48
49
|
|
|
49
50
|
Choose task design carefully:
|
|
50
51
|
|
package/skills/ax-agent-rlm.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-agent-rlm
|
|
3
3
|
description: This skill helps an LLM generate correct AxAgent RLM/runtime code using @ax-llm/ax. Use when the user asks about RLM code execution, AxJSRuntime, contextFields, contextPolicy, liveRuntimeState, promptLevel, stage prompt controls, executorModelPolicy, maxRuntimeChars, agent.test(...), llmQuery(...), recursionOptions, or long-running agent runtime behavior.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent RLM Runtime Rules (@ax-llm/ax)
|
package/skills/ax-agent.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-agent
|
|
3
3
|
description: This skill helps an LLM generate correct core AxAgent code using @ax-llm/ax. Use when the user asks about agent(), child agents, namespaced functions, discovery mode, clarification, bubbleErrors, host-side final/clarification protocol, or ordinary agent runtime behavior. For RLM/code-runtime work use ax-agent-rlm; for callbacks and telemetry use ax-agent-observability; for recall/memory/skill loading use ax-agent-memory-skills; for agent.optimize(...) use ax-agent-optimize.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent Codegen Rules (@ax-llm/ax)
|
|
@@ -529,6 +529,8 @@ agent(signature, {
|
|
|
529
529
|
functions,
|
|
530
530
|
functionDiscovery,
|
|
531
531
|
autoUpgrade,
|
|
532
|
+
playbook,
|
|
533
|
+
citations,
|
|
532
534
|
...agentOptions,
|
|
533
535
|
});
|
|
534
536
|
```
|
|
@@ -576,6 +578,13 @@ Rules:
|
|
|
576
578
|
- Values in required non-string fields (arrays, objects, numbers, media) are never auto-promoted — declare those in `contextFields` explicitly when they can be large.
|
|
577
579
|
- Each promotion emits a `field_auto_promoted` context event (`onContextEvent`) with the field name, original size, and preview size; use it to observe what was kept out of the prompt.
|
|
578
580
|
|
|
581
|
+
### Learning And Citations
|
|
582
|
+
|
|
583
|
+
Two optional construction-time options (TypeScript, both default off):
|
|
584
|
+
|
|
585
|
+
- `playbook`: attach an ACE playbook at construction. `learn` is on by default — after each run that produced failure signals (error turns, dead-ends, failing tool calls) one bounded update curates durable avoidance rules that ride the next run's actor prompt; zero LLM cost on clean runs. Seed a prior session with `playbook: { playbook: snapshot }`, persist via `onUpdate`, read the live handle with `getPlaybook()`, gate with `learn: { minSignals, dedupe }`, or disable with `learn: false`. To grow the same playbook from a task set with a held-out verify gate, use `agent.playbook().evolve(...)` — see `ax-playbook`.
|
|
586
|
+
- `citations`: add an optional `evidenceCitations: string[]` responder output listing which evidence entries (top-level keys of the curated evidence, plus memory ids) the answer relied on. Validated in-pipeline — the model cannot cite evidence it never collected (existence, not entailment). Pass `true`, or `{ field?, surface?: 'output' | 'hidden', includeMemoryIds?, onCitations? }`.
|
|
587
|
+
|
|
579
588
|
## Public Surface
|
|
580
589
|
|
|
581
590
|
Use these method groups as the compact AxAgent surface map:
|
|
@@ -585,6 +594,7 @@ Use these method groups as the compact AxAgent surface map:
|
|
|
585
594
|
- State and control: `getState()`, `setState(state?)`, `getContextMap()`, `setContextMap(map?)`, `stop()`, `getSignature()`, `setSignature(signature)`, `getFunction()`, `getId()`, and `setId(id)`. Context-map evolve policy lives on `AxAgentContextMap` (`infiniteEvolve`, `evolveSteps`, `maxChars`), not on the agent config. See [`src/examples/rlm-context-map-live.ts`](https://raw.githubusercontent.com/ax-llm/ax/refs/heads/main/src/examples/rlm-context-map-live.ts) for provider-backed persistence and finite-evolve usage.
|
|
586
595
|
- Observability: `getChatLog()`, `getUsage()`, `getStagedUsage()`, `resetUsage()`, and `getTraces()`; use `ax-agent-observability` for details.
|
|
587
596
|
- Demos and tuning: `setDemos(...)`, `namedPrograms()`, `namedProgramInstances()`, `optimize(...)`, `applyOptimization(...)`, `getOptimizableComponents()`, and `applyOptimizedComponents(...)`; use `ax-agent-optimize` for tuning details.
|
|
597
|
+
- Learning: `playbook()` returns an agent-aware `AxAgentPlaybook` handle (`update(...)`, `render()`, `getState()`, `load(...)`, and `evolve(dataset, options)`); `getPlaybook()` reads the current handle. Use `ax-playbook` for details.
|
|
588
598
|
|
|
589
599
|
Rules:
|
|
590
600
|
|
package/skills/ax-ai.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-ai
|
|
3
3
|
description: This skill helps an LLM generate correct AI provider setup and configuration code using @ax-llm/ax. Use when the user asks about ai(), providers, models, presets, embeddings, batch audio with ai.transcribe() or ai.speak(), extended thinking, context caching, or mentions OpenAI/Anthropic/Google/Azure/DeepSeek/Mistral/Cohere/Reka/Grok with @ax-llm/ax.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AI Provider Codegen Rules (@ax-llm/ax)
|
package/skills/ax-audio.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-audio
|
|
3
3
|
description: This skill helps an LLM generate correct audio code with @ax-llm/ax. Use when the user asks about ai.transcribe(), ai.speak(), signature audio inputs or outputs, agent audio behavior, .chat() conversational audio, OpenAI audio or realtime models, Gemini Live native audio, Grok Voice Agent models, voices, formats, transcripts, or how audio fits with structured outputs.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Audio I/O Codegen Rules (@ax-llm/ax)
|
package/skills/ax-flow.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-flow
|
|
3
3
|
description: This skill helps an LLM generate correct AxFlow workflow code using @ax-llm/ax. Use when the user asks about flow(), AxFlow, workflow orchestration, parallel execution, DAG workflows, conditional routing, map/reduce patterns, or multi-node AI pipelines.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxFlow Codegen Rules (@ax-llm/ax)
|
package/skills/ax-gen.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-gen
|
|
3
3
|
description: This skill helps an LLM generate correct AxGen code using @ax-llm/ax. Use when the user asks about ax(), AxGen, generators, forward(), streamingForward(), validation, assertions, streaming assertions, field processors, step hooks, self-tuning, or structured outputs.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxGen Codegen Rules (@ax-llm/ax)
|
package/skills/ax-gepa.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-gepa
|
|
3
3
|
description: This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax. Use when the user asks about AxGEPA, GEPA, Pareto optimization, multi-objective prompt tuning, reflective prompt evolution, validationExamples, maxMetricCalls, or optimizing a generator, flow, or agent tree.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# GEPA Optimization Codegen Rules (@ax-llm/ax)
|
package/skills/ax-llm.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-llm
|
|
3
3
|
description: This skill helps with using the @ax-llm/ax TypeScript library for building LLM applications. Use when the user asks about ax(), ai(), f(), s(), agent(), flow(), AxGen, AxAgent, AxFlow, signatures, streaming, or mentions @ax-llm/ax.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Ax Library (@ax-llm/ax) Quick Reference
|
package/skills/ax-playbook.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-playbook
|
|
3
3
|
description: This skill helps an LLM generate correct playbook code using @ax-llm/ax. Use when the user asks about playbook(), AxPlaybook, context playbooks, evolving context, ACE / Agentic Context Engineering, agent.playbook(), or growing/applying task knowledge offline and online with evolve() and update().
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Playbook Codegen Rules (@ax-llm/ax)
|
|
@@ -68,13 +68,23 @@ playbook(prodProgram, { studentAI }).load(snapshot).applyTo(prodProgram);
|
|
|
68
68
|
|
|
69
69
|
## Agents
|
|
70
70
|
|
|
71
|
+
`a.playbook({ target })` returns an agent-aware `AxAgentPlaybook` (the stage `AxPlaybook` handle plus an agent-level `evolve`). The one playbook the agent renders into its prompt grows three ways:
|
|
72
|
+
|
|
73
|
+
- Continuous (trust): the construction-time `playbook` option (see `ax-agent`) harvests each run's failures automatically — no dataset.
|
|
74
|
+
- On-demand (trust): `apb.update({ example, prediction, feedback })`.
|
|
75
|
+
- Batch verified (proof): `apb.evolve(dataset, options)` runs the full agent over a task set, mines failure clusters, and proposes one playbook bullet per weakness; with `verify` (default on) it keeps a bullet only if held-in improves AND the `validation` held-out set does not regress, else exact rollback. `verify: false` = trust-batch. Bullets-only.
|
|
76
|
+
|
|
71
77
|
```typescript
|
|
72
78
|
const a = agent('ticket:string -> reply:string', { ai });
|
|
73
|
-
const apb = a.playbook({ target: 'actor' }); // 'actor' (default) or 'responder'
|
|
74
|
-
await apb.update({ example, prediction, feedback }); // injected into the live stage prompt
|
|
79
|
+
const apb = a.playbook({ target: 'actor' }); // agent-aware handle; 'actor' (default) or 'responder'
|
|
80
|
+
await apb.update({ example, prediction, feedback }); // online: injected into the live stage prompt
|
|
81
|
+
const result = await apb.evolve(
|
|
82
|
+
{ train, validation }, // AxAgentEvalDataset
|
|
83
|
+
{ metric, runsPerTask: 2 }, // verify:true by default
|
|
84
|
+
);
|
|
75
85
|
```
|
|
76
86
|
|
|
77
|
-
|
|
87
|
+
The agent-level `evolve(dataset, options)` is distinct from the program-level `pb.evolve(examples, metric)` above: it takes an `AxAgentEvalDataset` plus options, runs the whole pipeline, and returns baseline/final held-in & held-out with per-bullet outcomes (no `{ bestScore }`). For full-pipeline tuning of agent instructions and demos (not the playbook) use `agent.optimize(...)` (GEPA).
|
|
78
88
|
|
|
79
89
|
## Playbook vs optimize()
|
|
80
90
|
|
package/skills/ax-refine.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-refine
|
|
3
3
|
description: Use this skill when writing or reviewing Ax bestOfN/refine code, reward functions, thresholds, native sample selection, serial attempts, generated advice, and attempt diagnostics.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Ax Refine And BestOfN
|
package/skills/ax-signature.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-signature
|
|
3
3
|
description: This skill helps an LLM generate correct DSPy signature code using @ax-llm/ax. Use when the user asks about signatures, s(), f(), field types, string syntax, fluent builder API, validation constraints, or type-safe inputs/outputs.
|
|
4
|
-
version: "23.0.
|
|
4
|
+
version: "23.0.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Ax Signature Reference
|