arize-prompt-optimization

Optimizes LLM prompts using Arize trace data, evaluations, and a data-driven iteration loop.

1|Updated Nov 9, 2025
One-click install
npx skills add https://github.com/akashjpal/question-generator --skill arize-prompt-optimization-akashjpal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: arize-prompt-optimization
Source: https://github.com/akashjpal/question-generator/tree/main/.agents/skills/arize-prompt-optimization
Command: npx skills add https://github.com/akashjpal/question-generator --skill arize-prompt-optimization-akashjpal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? LLM prompts often underperform in production, but teams lack a systematic way to find failures and improve them. This Skill extracts prompts from OpenInference trace spans, gathers evaluation and annotation feedback, and runs a structured optimization loop so prompt changes are driven by real performance data instead of guesswork. ## Core Features & Use Cases - Prompt Extraction from Traces: Locate and reconstruct prompts from LLM spans, including structured chat messages, prompt templates, and template variables, using the ax CLI and jq. - Performance Signal Gathering: Pull human annotations, LLM-as-judge eval scores and explanations, error spans, and experiment results to identify exactly where and why a prompt fails. - Guided Optimization Loop: Apply a meta-prompt that generates revised prompts while preserving template variables and avoiding overfitting, then measure improvement via A/B experiment comparison. - Use Case: A RAG chatbot hallucinates answers. Export unfaithful traces, inspect retriever and LLM spans, add grounding instructions to the system prompt, and verify the fix with a new experiment run. ## Quick Start Ask the AI to find failing LLM traces in your Arize project and optimize the prompt based on the evaluation feedback.

Frequently Asked Questions about arize-prompt-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize an LLM prompt using production trace data?

Export LLM spans with the ax CLI, extract the prompt from attributes.llm.input_messages, gather eval scores and annotations as performance signal, then run the optimization meta-prompt to generate a revised prompt. Measure improvement by comparing experiment runs.

How do I find which prompts are failing in Arize traces?

Filter spans by status_code = 'ERROR' or by low annotation and eval labels such as annotation.correctness.label = 'incorrect'. Export those traces and inspect the LLM span inputs, outputs, and eval explanations to identify failure patterns.

What do I need to use the ax CLI for prompt optimization?

You need the arize-ax-cli version 0.14.0 or higher installed, plus a configured Arize profile with an API key from app.arize.com. Set your space via the ARIZE_SPACE environment variable or pass it with --space flags.

Why is my prompt template null when I export a span?

Not all instrumentations emit prompt_template attributes. Use attributes.llm.input_messages for structured chat prompts or attributes.input.value as a fallback. Chain and Agent spans store prompts on their child LLM spans, not on themselves.

How do I avoid overfitting when optimizing prompts with test data?

Never copy test examples verbatim into the revised prompt. Extract general principles from failures, add synthetic few-shot examples instead of real data, and preserve all original template variables so the prompt generalizes to new inputs.