agno-testing-strategy

Test and optimize Agno agents with deterministic fakes, evals, and parameter search.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/allankltsn/setup_kiro --skill agno-testing-strategy-allankltsn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agno-testing-strategy
Source: https://github.com/allankltsn/setup_kiro/tree/main/.kiro/skills/agno-testing-strategy
Command: npx skills add https://github.com/allankltsn/setup_kiro --skill agno-testing-strategy-allankltsn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, optuna, dspy, ragas, fastapi, httpx.

What problem does it solve? Testing LLM agents is hard because model output is non-deterministic, real API calls are slow and expensive, and tuning prompts or sampling parameters by hand leads to overfitting and wasted tokens. This Skill defines an objective, gate-based testing and optimization strategy for Agno v2 agents so quality becomes measurable and improvable. ## Core Features & Use Cases - Three-layer test strategy: deterministic transport e2e with fake LLM adapters for PR gates, behavior evals with real models in nightly pipelines, and live smoke tests against deployed API Gateway/Lambda targets. - Eval harness with golden sets: versioned JSONL datasets, deterministic scorers plus LLM-as-judge signals, accuracy and out-of-scope recall thresholds, and structured-log assertions for p95 latency, token budgets, and fallback rates. - Systematic optimization: Optuna (TPE, pruning, Pareto multi-objective) for sampling/RAG/orchestration parameters, DSPy for prompt and few-shot compilation, promptfoo for model comparison matrices, and Ragas for RAG faithfulness, all guarded by train/validation/holdout splits and trial budgets. - Use Case: Before changing a support agent's model or prompt, run the golden set through the eval harness, optimize temperature and RAG top_k with Optuna against the train split, then validate once on the holdout before promoting the change. ## Quick Start Ask the agent to design a pytest test suite with fake LLM adapters, a golden-set eval, and an Optuna optimization loop for your Agno agent project.

Frequently Asked Questions about agno-testing-strategy

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

FAQPage Schema
How do I test an LLM agent deterministically without real API calls?▼

Depend on an LLMPort interface and inject fake adapters that return fixed answers or fail a programmed number of times. Use a FakeClock instead of real time so timeout, backoff, and fallback logic run fast and deterministically in pytest.

How do I evaluate LLM agent answer quality automatically?▼

Build a versioned golden set in JSONL with expected outcomes, then score responses with deterministic checks like escalation flags and required mentions, using LLM-as-judge only as a secondary signal. Gate on aggregate accuracy and out-of-scope recall thresholds, never on individual cases.

Optuna vs DSPy for optimizing LLM agents?▼

Optuna tunes numeric parameters like temperature, top_p, RAG top_k, and timeouts via TPE search with pruning and budgets. DSPy optimizes the prompt text and few-shot examples themselves using optimizers like MIPROv2 or GEPA against your metric.

Should LLM evals run in the PR pipeline?▼

No. Real-LLM evals are slow, costly, and non-deterministic, so they belong in nightly or pre-release pipelines. PR gates should only run deterministic tests with fake adapters, resilience checks, and structured-log budget assertions.

How do I avoid overfitting when optimizing prompts and models?▼

Split the golden set into train, validation, and holdout partitions fixed by hashing case IDs. Optimize only against train, select candidates on validation, and touch the holdout exactly once for an honest final number.

Why does my agent test suite run slowly or flake intermittently?▼

Components calling time.sleep or time.monotonic directly make tests slow and timing-dependent. Refactor them to accept an injectable clock, and replace real providers with programmable fake adapters to remove network variance.