{
"schema_version": "axir-api-v1",
"axir_version": "0.1",
"target": "rust",
"package_name": "axllm",
"sections": [
{
"id": "signatures",
"title": "Signatures",
"summary": "Describe typed Ax inputs and outputs once, then reuse that shape for schemas, prompts, validation, tools, and structured results.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "s",
"public_name": "s",
"kind": "function",
"description": "Parse an Ax string signature into the target language signature object.",
"form": "s(spec: \u0026str)",
"returns": "AxResult\u003cAxSignature\u003e",
"example": "let sig = s(\"question:string -\u003e answer:string\")?;"
},
{
"target_name": "rust",
"canonical_name": "f",
"public_name": "f",
"kind": "function",
"description": "Build signatures and field types fluently when the target has a fluent helper.",
"form": "f().input(...).output(...).build()",
"important_options": [
"input fields",
"output fields",
"field descriptions",
"constraints"
],
"returns": "signature builder or field factory"
},
{
"target_name": "rust",
"canonical_name": "AxSignature",
"public_name": "AxSignature",
"kind": "type",
"description": "Parsed signature with input/output fields, descriptions, and JSON schema helpers.",
"form": "AxSignature",
"important_options": [
"inputs",
"outputs",
"description"
],
"returns": "signature object"
}
]
},
{
"id": "axgen",
"title": "AxGen",
"summary": "Run structured generation with Core-owned prompts, indexed multi-sampling, result selection, tool loops, retries, streaming folds, traces, usage, examples, and field processors.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "ax",
"public_name": "ax",
"kind": "function",
"description": "Create an AxGen program from a string or parsed signature.",
"form": "ax(spec: \u0026str)",
"important_options": [
"functions",
"examples",
"demos",
"sample count",
"result picker",
"modelConfig",
"maxRetries",
"streaming assertions",
"field processors"
],
"returns": "AxResult\u003cAxGen\u003e",
"example": "let qa = ax(\"question:string -\u003e answer:string\")?;"
},
{
"target_name": "rust",
"canonical_name": "AxGen",
"public_name": "AxGen",
"kind": "type",
"description": "Structured generation program with indexed multi-sampling, winner selection, forward, streaming, optimization, trace, usage, and tool-call behavior.",
"form": "AxGen",
"important_options": [
"signature",
"functions",
"examples",
"demos",
"sample count",
"result picker",
"memory",
"prompt template"
],
"returns": "program object"
}
]
},
{
"id": "axai",
"title": "AxAI",
"summary": "Call supported providers through the shared provider descriptor registry, scripted transports, routers, and balancers.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "ai",
"public_name": "ai",
"kind": "function",
"description": "Create a provider client from a named deployment profile and options.",
"form": "ai(provider, options)",
"important_options": [
"api key or credential provider",
"model",
"api URL",
"headers",
"transport"
],
"returns": "AxResult\u003cOpenAICompatibleClient\u003e",
"example": "let client = ai(\"openai\", json!({\"apiKey\": std::env::var(\"OPENAI_API_KEY\")?}))?;"
},
{
"target_name": "rust",
"canonical_name": "AxCredentialRequest",
"public_name": "AxCredentialRequest",
"kind": "type",
"description": "Request metadata passed to a renewable credential callback for every transport attempt.",
"form": "AxCredentialRequest",
"important_options": [
"profile",
"operation",
"method",
"URL"
],
"returns": "credential request"
},
{
"target_name": "rust",
"canonical_name": "AxCredentialProvider",
"public_name": "AxCredentialProvider",
"kind": "interface",
"description": "Return fresh request headers that override static profile authentication.",
"form": "dyn AxCredentialProvider",
"important_options": [
"chat",
"stream",
"embeddings",
"Responses",
"audio",
"retries"
],
"returns": "header map or credential error"
},
{
"target_name": "rust",
"canonical_name": "OpenAICompatibleClient",
"public_name": "OpenAICompatibleClient",
"kind": "type",
"description": "OpenAI-compatible chat, stream, embedding, audio, and realtime provider boundary.",
"form": "OpenAICompatibleClient / ai(provider, options)",
"important_options": [
"api key",
"model",
"base URL",
"transport"
],
"returns": "provider client"
},
{
"target_name": "rust",
"canonical_name": "OpenAIResponsesClient",
"public_name": "OpenAIResponsesClient",
"kind": "type",
"description": "OpenAI Responses provider mapping using the same Core-owned request and response contract.",
"form": "OpenAIResponsesClient / ai(provider, options)",
"important_options": [
"api key",
"model",
"audio",
"realtime"
],
"returns": "provider client"
},
{
"target_name": "rust",
"canonical_name": "GoogleGeminiClient",
"public_name": "GoogleGeminiClient",
"kind": "type",
"description": "Gemini provider mapping for chat, streaming, media, tools, embeddings, and usage normalization.",
"form": "GoogleGeminiClient / ai(provider, options)",
"important_options": [
"api key",
"model",
"embed model"
],
"returns": "provider client"
},
{
"target_name": "rust",
"canonical_name": "AnthropicClient",
"public_name": "AnthropicClient",
"kind": "type",
"description": "Anthropic provider mapping for messages, thinking, cache control, streaming, and usage normalization.",
"form": "AnthropicClient / ai(provider, options)",
"important_options": [
"api key",
"model",
"thinking",
"cache control"
],
"returns": "provider client"
},
{
"target_name": "rust",
"canonical_name": "AxUsageContext",
"public_name": "AxUsageContext",
"kind": "type",
"description": "Application attribution merged from service defaults and per-call overrides.",
"form": "AxUsageContext",
"important_options": [
"tenant",
"user",
"request",
"run",
"feature",
"attributes"
],
"returns": "usage context"
},
{
"target_name": "rust",
"canonical_name": "AxUsageEvent",
"public_name": "AxUsageEvent",
"kind": "type",
"description": "Normalized token usage and correlation data for one completed chat or embedding operation.",
"form": "AxUsageEvent",
"important_options": [
"provider",
"model",
"tokens",
"context",
"correlation IDs",
"streaming"
],
"returns": "usage event"
},
{
"target_name": "rust",
"canonical_name": "AxUsageObserver",
"public_name": "AxUsageObserver",
"kind": "interface",
"description": "Best-effort process-wide callback for normalized usage events.",
"form": "AxUsageObserver",
"important_options": [
"fail-open delivery",
"synchronous enqueue"
],
"returns": "usage observer"
},
{
"target_name": "rust",
"canonical_name": "set_usage_observer",
"public_name": "set_usage_observer",
"kind": "function",
"description": "Register, replace, or clear the process-wide usage observer.",
"form": "set_usage_observer(observer)",
"important_options": [
"observer",
"clear"
],
"returns": "void",
"example": "set_usage_observer(Some(Arc::new(move |event| events.lock().unwrap().push(event))));"
},
{
"target_name": "rust",
"canonical_name": "AxBalancer",
"public_name": "AxBalancer",
"kind": "type",
"description": "Retry and route requests across multiple provider services, with opt-in adaptive cost, reliability, and deadline routing.",
"form": "AxBalancer",
"important_options": [
"services",
"retry policy",
"capability requirements",
"adaptive strategy"
],
"returns": "AI service"
},
{
"target_name": "rust",
"canonical_name": "AxBalancerAdaptiveStrategy",
"public_name": "AxBalancerAdaptiveStrategy",
"kind": "type",
"description": "Configure adaptive provider routing without changing the ordered default.",
"form": "AxBalancerAdaptiveStrategy",
"important_options": [
"deadline",
"bad outcome cost",
"expected tokens",
"stable route keys",
"slice",
"stats store",
"routing events"
],
"returns": "adaptive strategy"
},
{
"target_name": "rust",
"canonical_name": "AxBalancerStatsStore",
"public_name": "AxBalancerStatsStore",
"kind": "interface",
"description": "Store shared adaptive decision state with atomic observations.",
"form": "AxBalancerStatsStore",
"important_options": [
"get",
"observe"
],
"returns": "stats store"
},
{
"target_name": "rust",
"canonical_name": "AxInMemoryBalancerStatsStore",
"public_name": "AxInMemoryBalancerStatsStore",
"kind": "type",
"description": "Thread-safe in-memory adaptive stats store.",
"form": "AxInMemoryBalancerStatsStore",
"returns": "stats store"
},
{
"target_name": "rust",
"canonical_name": "create_balancer_route_stats",
"public_name": "create_balancer_route_stats",
"kind": "function",
"description": "Create neutral adaptive route statistics.",
"form": "create_balancer_route_stats",
"returns": "route stats"
},
{
"target_name": "rust",
"canonical_name": "update_balancer_route_stats",
"public_name": "update_balancer_route_stats",
"kind": "function",
"description": "Purely reduce one success or failure observation into route statistics.",
"form": "update_balancer_route_stats",
"important_options": [
"current stats",
"observation"
],
"returns": "route stats"
},
{
"target_name": "rust",
"canonical_name": "sample_balancer_route_health",
"public_name": "sample_balancer_route_health",
"kind": "function",
"description": "Sample failure and deadline-miss probability for adaptive exploration.",
"form": "sample_balancer_route_health",
"important_options": [
"route stats",
"deadline"
],
"returns": "sampled health"
},
{
"target_name": "rust",
"canonical_name": "MultiServiceRouter",
"public_name": "MultiServiceRouter",
"kind": "type",
"description": "Choose a service by capability or model routing policy.",
"form": "MultiServiceRouter",
"important_options": [
"services",
"routing"
],
"returns": "AI service"
},
{
"target_name": "rust",
"canonical_name": "ProviderRouter",
"public_name": "ProviderRouter",
"kind": "type",
"description": "Route requests by capability, preserving native media for supporting providers and degrading only when required.",
"form": "ProviderRouter",
"important_options": [
"providers",
"routing",
"processing"
],
"returns": "AI service"
}
]
},
{
"id": "agents-rlm",
"title": "Agents And RLM",
"summary": "Run AxAgent through the RLM executor loop with stage instructions, validated evidence citations, persistent playbooks, and actor-code execution through an AxCodeRuntime session.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "agent",
"public_name": "agent",
"kind": "function",
"description": "Create an AxAgent from a signature and agent/runtime options.",
"form": "agent(spec: \u0026str)",
"important_options": [
"name",
"description",
"runtime",
"maxSteps",
"context fields",
"discovery",
"recall",
"functions",
"skills",
"skillsCatalog",
"memoriesCatalog",
"relevanceRanking",
"load observers",
"used observers",
"citations",
"playbook",
"instruction",
"instructionAddenda"
],
"returns": "AxResult\u003cAxAgent\u003e",
"example": "let helper = agent(\"query:string -\u003e answer:string\")?;"
},
{
"target_name": "rust",
"canonical_name": "AxAgent",
"public_name": "AxAgent",
"kind": "type",
"description": "RLM agent with Core-owned envelopes, complete runtime-state export/restore, traces, discovery, recall, loaded skills and memories, usage observers, delegation, validated citations, stage instructions, persistent run-end learning, and verified playbook evolution.",
"form": "AxAgent",
"important_options": [
"executor model",
"runtime",
"policy",
"context",
"skills",
"memories",
"relevance ranking",
"observers",
"runtime state",
"optimizer metadata",
"citations",
"playbook"
],
"returns": "agent program"
}
]
},
{
"id": "flow",
"title": "Flow",
"summary": "Compose AxGen, AxAgent, and nested flows into a portable program graph.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "flow",
"public_name": "flow",
"kind": "function",
"description": "Create an AxFlow program graph or compile the portable Mermaid shorthand.",
"form": "flow(source) / flow_with_bindings(source, bindings)",
"important_options": [
"nodes",
"execute mappers",
"conditions",
"cache",
"returns",
"Mermaid roundtrip"
],
"returns": "AxFlow",
"example": "let wf = flow(\"workflow\");"
},
{
"target_name": "rust",
"canonical_name": "AxFlow",
"public_name": "AxFlow",
"kind": "type",
"description": "Workflow graph with Core-owned planning, cache keys, state merge, child aggregation, optimization, and returns projection.",
"form": "AxFlow",
"important_options": [
"steps",
"state",
"parallel groups",
"returns"
],
"returns": "flow program"
}
]
},
{
"id": "tools",
"title": "Tools",
"summary": "Expose host functions to AxGen and AxAgent with typed argument and return schemas.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "fn",
"public_name": "tool",
"kind": "function",
"description": "Build a typed function tool. Rust uses `tool` because `fn` is reserved.",
"form": "tool(name).description(...).arg(...).handler(...).build()",
"important_options": [
"name",
"description",
"args",
"returns",
"handler"
],
"returns": "ToolBuilder",
"example": "let search = tool(\"search\").description(\"Search docs\").build();"
},
{
"target_name": "rust",
"canonical_name": "Tool",
"public_name": "Tool",
"kind": "type",
"description": "Callable tool descriptor with JSON-schema-compatible parameters and a host handler.",
"form": "Tool",
"important_options": [
"parameters",
"returns",
"handler"
],
"returns": "tool descriptor"
}
]
},
{
"id": "mcp",
"title": "MCP",
"summary": "Use MCP clients and transports while keeping JSON-RPC lifecycle, tools, prompts, resources, OAuth, cancellation, and SSRF checks aligned.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "AxMCPClient",
"public_name": "AxMCPClient",
"kind": "type",
"description": "MCP client that lists tools/prompts/resources and converts MCP tools to Ax functions.",
"form": "AxMCPClient::new(transport, options)",
"important_options": [
"transport",
"client info",
"roots",
"tool overrides"
],
"returns": "MCP client",
"example": "let client = AxMCPClient::new(transport, json!({}));"
},
{
"target_name": "rust",
"canonical_name": "AxMCPStreamableHTTPTransport",
"public_name": "AxMCPStreamableHTTPTransport",
"kind": "type",
"description": "Streamable HTTP transport with session headers, OAuth options, and SSRF protection.",
"form": "AxMCPStreamableHTTPTransport",
"important_options": [
"endpoint",
"headers",
"OAuth",
"SSRF protection"
],
"returns": "MCP transport"
},
{
"target_name": "rust",
"canonical_name": "AxMCPStdioTransport",
"public_name": "AxMCPStdioTransport",
"kind": "type",
"description": "Stdio transport with JSON-RPC framing for local MCP servers.",
"form": "AxMCPStdioTransport",
"important_options": [
"command",
"args",
"env"
],
"returns": "MCP transport"
}
]
},
{
"id": "runtime-profiles",
"title": "Runtime Profiles",
"summary": "Run RLM actor code through the portable AxCodeRuntime and optional target-specific runtime profiles.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "ProcessCodeRuntime",
"public_name": "ProcessCodeRuntime",
"kind": "type",
"description": "Process/JSONL runtime adapter for actor-code sessions and runtime protocol tests.",
"form": "ProcessCodeRuntime::new(command)",
"important_options": [
"command",
"env",
"cwd",
"timeout"
],
"returns": "AxCodeRuntime",
"example": "let runtime = ProcessCodeRuntime::new(vec![\"node\".into(), \"runtime-server.mjs\".into()]);"
},
{
"target_name": "rust",
"canonical_name": "RuntimeCapabilities",
"public_name": "RuntimeCapabilities",
"kind": "type",
"description": "Runtime capability envelope visible to the agent runtime policy.",
"form": "RuntimeCapabilities",
"important_options": [
"language",
"snapshot",
"patch",
"abort",
"usage instructions"
],
"returns": "capability record"
},
{
"target_name": "rust",
"canonical_name": "RuntimeEnvelope",
"public_name": "RuntimeEnvelope",
"kind": "type",
"description": "Actor primitive envelope for final, clarification, discovery, recall, used, guidance, and runtime results.",
"form": "RuntimeEnvelope",
"important_options": [
"type",
"args",
"result",
"error"
],
"returns": "runtime envelope"
},
{
"target_name": "rust",
"canonical_name": "runtime-profile:javascript-quickjs",
"public_name": "javascript-quickjs",
"kind": "runtime-profile",
"description": "Optional runtime profile for javascript actor code.",
"form": "tools/axir verify --targets rust --runtime-profiles javascript-quickjs",
"important_options": [
"actor language: javascript",
"support mode: embedded",
"dependency mode: optional-feature",
"feature gate: runtime-quickjs"
],
"returns": "AxCodeRuntime-compatible actor execution profile"
}
]
},
{
"id": "optimizers",
"title": "Optimizers",
"summary": "Optimize Ax programs through BootstrapFewShot -\u003e GEPA composition and evolve program or agent playbooks through grounded, budgeted, rollback-safe learning.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "optimize",
"public_name": "optimize",
"kind": "function",
"description": "Convenience optimizer helper that composes AxBootstrapFewShot before AxGEPA and returns an artifact without applying final component changes.",
"form": "optimize(program, examples, options)",
"important_options": [
"student/client",
"teacher/reflection client",
"metric budget",
"bootstrap"
],
"returns": "AxResult\u003cOptimizedArtifact\u003e",
"example": "let artifact = optimize(\u0026mut qa, train, json!({\"maxMetricCalls\": 100}))?;"
},
{
"target_name": "rust",
"canonical_name": "playbook",
"public_name": "playbook",
"kind": "function",
"description": "Bind an ACE-backed playbook to a program; agents also expose an agent-bound playbook handle.",
"form": "playbook(program, student, teacher, options)",
"important_options": [
"student/client",
"teacher",
"seed snapshot",
"online updates",
"verification budget"
],
"returns": "AxPlaybook",
"example": "let pb = playbook(program, student, None::\u003cRc\u003cRefCell\u003cOpenAICompatibleClient\u003e\u003e\u003e, json!({}));"
},
{
"target_name": "rust",
"canonical_name": "AxPlaybook",
"public_name": "AxPlaybook",
"kind": "type",
"description": "Persistent playbook with render/update/snapshot operations and agent-bound verified evolve over train/validation task sets.",
"form": "AxPlaybook / agent.playbook(...)",
"important_options": [
"verify",
"minHeldInGain",
"epsilon",
"runsPerTask",
"maxMetricCalls",
"maxProposals"
],
"returns": "playbook handle"
},
{
"target_name": "rust",
"canonical_name": "AxBootstrapFewShot",
"public_name": "AxBootstrapFewShot",
"kind": "type",
"description": "Few-shot demonstration optimizer that selects successful evaluator rollouts before prompt/component evolution.",
"form": "AxBootstrapFewShot::new(options)",
"important_options": [
"quality threshold",
"max demos",
"max rounds",
"batch size"
],
"returns": "optimizer engine",
"example": "let bootstrap = AxBootstrapFewShot::new(json!({\"qualityThreshold\": 0.7}));"
},
{
"target_name": "rust",
"canonical_name": "AxGEPA",
"public_name": "AxGEPA",
"kind": "type",
"description": "Generated GEPA optimizer engine with Core-owned reflection, Pareto, bootstrap, and selector-state behavior.",
"form": "AxGEPA::new(reflection, options)",
"important_options": [
"reflection client",
"budget",
"metric",
"candidate count"
],
"returns": "optimizer engine",
"example": "let engine = AxGEPA::new(reflection_client, json!({}));"
},
{
"target_name": "rust",
"canonical_name": "OptimizerEngine",
"public_name": "OptimizerEngine",
"kind": "interface",
"description": "Optimizer boundary consumed by AxGen, AxAgent, and AxFlow optimization helpers.",
"form": "OptimizerEngine::optimize(request, evaluator)",
"important_options": [
"request",
"evaluator"
],
"returns": "optimized artifact"
},
{
"target_name": "rust",
"canonical_name": "OptimizerEvaluator",
"public_name": "OptimizerEvaluator",
"kind": "interface",
"description": "Evaluator callback boundary used by generated optimizers.",
"form": "OptimizerEvaluator::evaluate(request)",
"important_options": [
"dataset rows",
"candidate map",
"evidence"
],
"returns": "score/evidence result"
}
]
},
{
"id": "errors-values",
"title": "Errors And Values",
"summary": "Handle target-native errors and dynamic values at Ax host boundaries.",
"symbols": [
{
"target_name": "rust",
"canonical_name": "AxError",
"public_name": "AxError",
"kind": "type",
"description": "Target-native error envelope for validation, provider, runtime, MCP, and optimizer failures.",
"form": "AxError with target-native error handling",
"important_options": [
"category",
"message",
"status",
"code",
"retryable"
],
"returns": "error"
},
{
"target_name": "rust",
"canonical_name": "Value",
"public_name": "serde_json::Value",
"kind": "type",
"description": "Dynamic JSON-like value boundary used by generated package APIs, tools, providers, MCP, and runtime sessions.",
"form": "serde_json::Value",
"important_options": [
"string",
"number",
"boolean",
"object",
"array",
"null"
],
"returns": "dynamic value"
}
]
}
]
}