Documentation

Build LLM-powered agents
with production-ready TypeScript

DSPy for TypeScript. Working with LLMs is complex—they don't always do what you want. DSPy makes it easier to build amazing things with LLMs. Just define your inputs and outputs (signature) and an efficient prompt is auto-generated and used. Connect together various signatures to build complex systems and workflows using LLMs.

15+ LLM Providers
End-to-end Streaming
Auto Prompt Tuning

AxLearnOptions

Defined in: https://github.com/ax-llm/ax/blob/242cf18d21de9f9d58c7c82f53305f0605497473/src/ax/dsp/learn.ts#L35

Configuration for the AxLearn agent. Combines agent configuration (name, storage) with learning configuration (teacher, budget).

Properties

PropertyTypeDescription
budget?numberMaximum optimization rounds (default: 20)
criteria?stringCustom evaluation criteria for judge
enableTracing?booleanWhether to log traces (default: true)
examples?AxTypedExample<AxGenIn>[]Training examples (manual)
generateExamples?booleanWhether to generate synthetic examples (default: true if no other data)
judgeOptions?Partial<AxJudgeOptions>Judge options when auto-generating metric
metadata?Record<string, unknown>Custom metadata for all traces
metric?AxMetricFnCustom metric function (if not provided, auto-generates using AxJudge)
namestringUnique identifier/name for this agent
onProgress?(progress: AxLearnProgress) => voidProgress callback
onTrace?(trace: AxTrace) => voidCallback when a trace is logged
storageAxStorageStorage backend (Required)
synthCount?numberNumber of synthetic examples to generate
synthOptions?Partial<AxSynthOptions>Synth options for data generation
teacherAxAIServiceTeacher AI for synthetic data generation and judging (Required)
useTraces?booleanWhether to use capture traces as training examples (default: true)
validationSplit?numberValidation split ratio (default: 0.2)