Full-Code · Agent SDKsactive

Ax (AxACE optimizer)

Type: full-code · Vendor: ax-llm · Language: TypeScript · License: Apache-2.0 · Status: active · Status in practice: emerging · First released: 2023-12-01

Links: homepage docs repo

Ax is a DSPy port that compiles typed declarative signatures into LLM calls and optimizes the resulting prompts and demonstrations against an evaluation metric.

Description. Ax is a framework for building LLM applications around declarative signatures rather than hand-written prompts. A signature declares the typed inputs and outputs of a step, and Ax turns it into the prompt, the output parser, the validators, and the retry loop, returning typed data. Ax includes optimizers, among them AxACE, which mirrors the Agentic Context Engineering paper's Generator-Reflector-Curator loop and a Genetic-Pareto optimizer that tunes prompts and demonstrations against evals. It is released under Apache 2.0.

Agent loop shape. A developer declares a signature stating what goes in and what comes out. Ax compiles the signature into a prompt, schema, parser, validators, and retry loop, runs it against the model, and returns typed output. Given example input/output pairs and a metric, an optimizer such as GEPA or AxACE searches for better prompts and demonstrations; AxACE additionally maintains a structured bullet playbook updated through add/update/remove deltas at inference time.

Primary use cases

  • building LLM pipelines from typed signatures
  • automatic prompt and few-shot optimization
  • agentic context engineering with an evolving playbook
  • type-safe structured outputs from LLMs

Key concepts

  • Signature dspy-signatures (docs)A one-line declaration of a step's typed inputs and outputs that Ax compiles into the prompt, output parser, validators, and retry loop, so the developer states what goes in and out rather than writing a prompt.
  • GEPA optimizer evaluator-optimizer (docs)The Genetic-Pareto optimizer that searches over prompts, demonstrations, flows, and agents against an evaluation metric to improve a signature-driven program without manual prompt edits.
  • AxACE agentic-context-engineering-playbook (docs)An optimizer that mirrors the Agentic Context Engineering Generator-Reflector-Curator loop, representing context as structured bullets and applying incremental add/update/remove deltas into a serialized playbook updatable at inference time.
  • AxAgent agent-as-tool-embedding (docs)A three-stage pipeline that turns a signature into a long-running, tool-using actor whose memory, skills, MCP tools, and child agents are exposed as typed capabilities behind the signature contract.
  • ai() provider handle multi-model-routing (docs)The single constructor that binds a program to a model provider — OpenAI, Claude, Gemini, a gateway, or a local OpenAI-compatible endpoint — leaving signatures, tools, traces, and outputs unchanged when the provider is swapped.

Patterns this full-code implements —

Neighbourhood

Click any neighbour to follow the lineage. Scroll to zoom, drag to pan.