К основному содержанию
скилл CX Codex

inngest-agent-evals — скилл для Claude Code

Скилл помогает внедрять оценку результатов ИИ-агентов, настраивать прямое и отложенное скорирование, группировать сессии и запускать эксперименты в Inngest.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add inngest/inngest-skills --skill inngest-agent-evals -a claude-code
Открыть на GitHub

Что делает inngest-agent-evals

Скилл содержит инструкции и примеры для оценки работы ИИ-агентов в Inngest через durable-шаги. Он объясняет, как зафиксировать метрики прямо во время выполнения функции с помощью step.score() и как организовать отложенный скоринг через createScorer() и defer(), если отзыв пользователя или вердикт судьи приходит позже.

Внутри разобрана разметка сессий через meta.sessions для сквозного отслеживания диалогов или тикетов, а также сплит-тесты промптов и моделей с помощью group.experiment(). Для работы скоринга требуется TypeScript SDK версии v4 и подключение scoreMiddleware() из пакета inngest/experimental.

Какие задачи решает

  • внедрить прямое скорирование ответов агента через step.score()
  • настроить отложенный сбор пользовательского фидбека с createScorer() и defer()
  • объединить запуски функций в сквозные сессии по ticket_id или conversation_id
  • настроить сравнительные эксперименты промптов и моделей через group.experiment()

Примеры запросов агенту

  • Помоги добавить скоринг качества ответа в функцию Inngest с помощью step.score()
  • Настрой отложенный сбор фидбека через createScorer и свяжи его с запуском тикета
  • Как сгруппировать шаги агента в сессии по ticket_id для отслеживания в Insights?

Как установить inngest-agent-evals

1Через Skills CLI (Vercel)

npx skills add inngest/inngest-skills --skill inngest-agent-evals -a claude-code

2Вручную: положить файлы

~/.claude/skills/inngest-agent-evals/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/inngest-agent-evals/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о inngest-agent-evals

Как установить inngest-agent-evals в Claude Code?

Выполните команду npx skills add inngest/inngest-skills --skill inngest-agent-evals -a claude-code. Файл скилла сохранится в ~/.claude/skills/inngest-agent-evals/SKILL.md.

Что делает скилл inngest-agent-evals?

Он направляет ассистента при настройке метрик качества ИИ, организации трассировки, связывании экспериментов и разметке сессий в коде Inngest.

Какие версии Inngest SDK требуются для работы?

Нужен TypeScript SDK v4 (npm install inngest@latest). Поддержка сессий через SDK появилась в v4.7.0, а метод group.experiment() требует версии v4.8.0 или новее.

Исходный текст

SKILL.md · Apache-2.0
---
name: inngest-agent-evals
description: "Use when building, migrating, or debugging Agent Evals on Inngest: scoring AI agent or workflow outcomes, deferred scorers, sessions, traces, step experiments, experiment variant attribution, Insights queries, or production eval loops for prompts, models, tools, providers, and agent behavior. Covers TypeScript SDK v4 scoring beta APIs, `scoreMiddleware`, `step.score`, `inngest.score`, `createScorer`, `defer`, `group.experiment`, `experimentRef`, `meta.sessions`, and when to use durable workflow primitives for outcome-based evaluation."
---

# Inngest Agent Evals

Use this skill when the user wants to evaluate AI agents or AI workflows in
production, add scoring, compare prompts/models/tools, group related runs, or
debug why an agent outcome was good or bad.

Agent Evals is not a separate package. It is the production evaluation workflow
built from Inngest functions, durable steps, scores, deferred scorers, sessions,
traces, experiments, and Insights.

## Canonical References

Check the public docs first when exact API details matter:

- Agent Evals overview: https://www.inngest.com/docs/learn/agent-evals
- Scoring guide: https://www.inngest.com/docs/features/inngest-functions/steps-workflows/scoring
- Deferred scoring guide: https://www.inngest.com/docs/features/inngest-functions/steps-workflows/deferred-scoring
- Step experiments guide: https://www.inngest.com/docs/features/inngest-functions/steps-workflows/step-experiments
- Sessions: https://www.inngest.com/docs/features/events-triggers/sessions
- Traces: https://www.inngest.com/docs/platform/monitor/traces
- Insights: https://www.inngest.com/docs/platform/monitor/insights
- Scoring reference: https://www.inngest.com/docs/reference/typescript/v4/functions/scoring
- `group.experiment()` reference: https://www.inngest.com/docs/reference/typescript/v4/functions/group-experiment
- Launch context: https://www.inngest.com/blog/introducing-agent-evals

## Decision Flow

Start from the outcome, not the mechanism:

1. Identify the product or quality signal: helpful click, ticket resolution,
   conversion, guardrail pass, retrieval quality, model confidence, latency,
   cost, human review, or LLM-as-judge result.
2. Decide when the signal appears:
   - During the run: use direct scoring with `step.score()` or
     `inngest.score()`.
   - After the run: use deferred scoring with `createScorer()` and `defer()`,
     or explicit `inngest.score({ runId })`.
3. Decide how humans will inspect related work:
   - Use `meta.sessions` for repeated high-cardinality identifiers such as
     `conversation_id`, `ticket_id`, `agent_run_id`, or `import_id`.
   - Use Insights for ad hoc historical analysis, low-cardinality filters, SQL
     aggregates, and broad investigation.
4. Decide whether to compare variants:
   - Use `group.experiment()` for prompt, model, provider, tool, workflow, or
     rollout comparisons.
   - Pass `experimentRef` to deferred or later scores when the score should be
     credited to the selected variant.
5. Preserve traceability:
   - Keep model calls, tool calls, waits, database writes, and scoring work in
     durable steps so traces explain why the score happened.

## Setup Requirements

- Use TypeScript SDK v4 and install the latest SDK: `npm install inngest@latest`.
- Scoring and deferred scoring are beta APIs; verify current imports against
  the docs before shipping user-facing examples.
- `step.score()` requires `scoreMiddleware()` from `inngest/experimental` on
  the Inngest client.
- `createScorer()` is imported from `inngest/experimental` and the scorer must
  be registered in the serve handler with other functions.
- Sessions sent through the TypeScript SDK require v4.7.0 or later.
- Step experiments require v4.8.0 or later for `group.experiment()` and the
  `experiment` helper from `inngest`.

Client shape:

```typescript
import { Inngest } from "inngest";
import { scoreMiddleware } from "inngest/experimental";

export const inngest = new Inngest({
  id: "support-agent",
  middleware: [scoreMiddleware()],
});
```

## Sessions

Add sessions when events belong to a user flow, conversation, ticket, import,
or agent task that someone will inspect repeatedly.

```typescript
await inngest.send({
  name: "support/ticket.created",
  data: {
    ticketId: "tk_123",
    message: "I can't sign in.",
  },
  meta: {
    sessions: {
      ticket_id: "tk_123",
    },
  },
});
```

Rules:

- Use stable, non-secret, high-cardinality IDs.
- Keep the key generic, such as `conversation_id`; put the actual ID in the
  value.
- Pass sessions explicitly through `step.invoke()` and `step.sendEvent()` when
  downstream runs should join the same session.
- Do not use sessions for labels like `environment: prod`; use Insights for
  that style of filtering.

## Direct Scoring

Use direct scoring when the score is known during the function run.

Good direct scores:

- guardrail pass/fail
- JSON validity
- retrieval confidence
- tool success
- model confidence
- inline LLM-as-judge result

```typescript
export const answerTicket = inngest.createFunction(
  {
    id: "answer-ticket",
    triggers: [{ event: "support/ticket.created" }],
  },
  async ({ event, step }) => {
    const answer = await step.run("generate-answer", () =>
      generateAnswer(event.data.ticketId)
    );

    const passed = await step.run("check-answer", () => validateAnswer(answer));

    await step.score("score-answer-quality", {
      name: "answer-quality",
      value: passed,
    });

    return { answer, passed };
  }
);
```

Use stable score names. Changing a score name creates a separate metric.
Score values must be finite numbers or booleans.

## Deferred Scoring

Use deferred scoring when the useful signal arrives after the parent workflow
finishes, such as user feedback, conversion, ticket reopen, retention, or a
slow LLM-as-judge run.

```typescript
import { createScorer } from "inngest/experimental";
import { z } from "zod";

export const feedbackScorer = createScorer(
  inngest,
  {
    id: "support-feedback-scorer",
    schema: z.object({ ticketId: z.string() }),
  },
  async ({ event, step }) => {
    const feedback = await step.waitForEvent("wait-for-feedback", {
      event: "support/feedback.received",
      timeout: "7d",
      if: `async.data.ticketId == '${event.data.ticketId}'`,
    });

    return {
      name: "user-feedback",
      value: feedback?.data.helpful ? 1 : 0,
    };
  }
);
```

Trigger it from the producing function:

```typescript
async ({ event, step, defer }) => {
  const answer = await step.run("generate-answer", () =>
    generateAnswer(event.data.ticketId)
  );

  defer("score-feedback", {
    function: feedbackScorer,
    data: { ticketId: event.data.ticketId },
  });

  return { answer };
}
```

Guardrails:

- Register scorers with `serve({ functions: [...] })`.
- `defer()` is fire-and-forget; do not `await` it.
- The parent run is attributed automatically for deferred scorers.
- Return a default score or `null` when a signal times out, based on the
  product semantics.

## Experiments

Use `group.experiment()` when comparing prompts, models, providers, tools,
workflow rewrites, or operational settings against real traffic.

```typescript
import { experiment } from "inngest";

const { result, variant, experimentRef } = await group.experiment(
  "answer-style",
  {
    variants: {
      concise: () => step.run("answer-concise", () => answerConcise(event.data)),
      detailed: () =>
        step.run("answer-detailed", () => answerDetailed(event.data)),
    },
    select: experiment.bucket(event.data.accountId, {
      weights: { concise: 50, detailed: 50 },
    }),
  }
);
```

Selection strategy:

- `experiment.weighted()` for run-level traffic splits.
- `experiment.bucket(stableId, { weights })` when a user, account, or tenant
  should usually keep the same experience.
- `experiment.custom()` when assignment comes from a database, flag service, or
  rollout table.
- `experiment.fixed()` to force one variant during testing or after choosing a
  winner.

Rules:

- Each variant callback must call at least one `step.*` tool.
- Keep experiment IDs and variant names stable because they appear in traces.
- The selected variant is memoized for retries and replays.
- Persist `experimentRef` and the parent run ID if a later, separate process
  will score the selected variant.

When deferred scoring a variant, pass the ref:

```typescript
defer("score-answer-feedback", {
  function: feedbackScorer,
  data: { ticketId: event.data.ticketId },
  experiment: experimentRef,
});
```

When scoring from a later run explicitly:

```typescript
await inngest.score.experiment({
  name: "clickthrough",
  value: 1,
  experiment: experimentRef,
  runId: originalRunId,
});
```

## Brownfield Migration

When adding Agent Evals to an existing app:

1. Search for existing agent/workflow outputs and where users act on them.
2. Find durable identifiers already in the domain: conversation ID, ticket ID,
   account ID, import ID, run ID, or recommendation ID.
3. Add `meta.sessions` at event producers before building dashboards around
   correlation.
4. Add one direct score where the outcome is already known.
5. Add a deferred scorer only after the signal event exists or can be emitted
   cleanly.
6. Add `group.experiment()` only around one isolated decision at a time.
7. Keep old prompt/model/tool behavior stable until scoring proves the new path.

Use `inngest-brownfield-audit` first when the repo has many candidate
workflows. Use `inngest-agents` with this skill when the work is an AgentKit or
durable agent workflow.

## Anti-Patterns

- Starting with a prompt experiment before naming the outcome metric.
- Scoring with unstable names, strings, objects, `NaN`, or `Infinity`.
- Forgetting `scoreMiddleware()` and then assuming `step.score()` is missing.
- Running scorers in an external queue when the scorer needs durable waits.
- Keeping experiment assignment only in memory.
- Scoring an experiment variant from a later run without the original `runId`.
- Using sessions for low-cardinality labels or sensitive personal data.
- Leaving model/tool work outside steps, making traces unable to explain the
  score.

## Verification

- Typecheck the Inngest client, functions, scorer schemas, and serve handler.
- Confirm scorers are registered with the serve endpoint.
- Test the producer emits events with expected `meta.sessions`.
- Test direct scores use stable names and finite number/boolean values.
- Test deferred scorer timeout behavior.
- For experiments, test that each variant callback contains step work and that
  later scoring receives `experimentRef` plus the original run ID when needed.
- If possible, run the Inngest dev server and inspect traces, sessions, scores,
  and experiment variant selection in the dashboard or through available CLI/API
  tooling.

© inngest · Apache-2.0 · inngest/inngest-skills

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
adk-evals botpress Справочник по написанию и запуску диалоговых тестов для агентов Botpress ADK. Помогает проверять ответы бота, вызовы инструментов и состояние без моков. CX Codex +1 1 600установок aiconfig-online-evals launchdarkly Устаревший скилл-редирект от LaunchDarkly. Он сообщает о переименовании инструмента в online-evals и перенаправляет агента на актуальные инструкции. CX Codex +1 2 700установок online-evals launchdarkly Подключает судей к вариантам конфига, чтобы ответы модели автоматически получали оценку от 0.0 до 1.0. Пригодится, когда нужно следить за качеством промптов в проде. CX Codex +1 1 800установок evals-start ai-evals-course Направляет запрос по оценке ИИ-системы в нужный специализированный скилл. Нужен, когда неясно, с чего начать или какой сценарий выбрать. CX Codex +1 776установок agent-evals devops-skills Скилл собирает автотесты для ИИ-агентов: golden-датасеты, рубрики оценки и регрессионные гейты в CI. Пригодится, когда меняешь промпты и хочешь видеть, что стало хуже. CX Codex +1 340установок logfire-evals pydantic Прогоняет офлайн-оценки Python и Node.js, разбирает отчёты в Logfire и перенаправляет существующие наборы Braintrust. CX Codex +1 554установок

Из того же набора14

inngest-flow-control Скилл по flow control в Inngest: concurrency, throttling, rate limiting, debounce, priority, singleton и батчинг событий. Пригодится, когда внешние API отвечают 429. CX Codex +1 1 600установок inngest-cli Помогает агенту поднять локальный Dev Server Inngest, отладить serve-эндпоинт и прогнать функции через @inngest/test. CX Codex +1 808установок inngest-realtime Скилл учит агента публиковать обновления из durable-функций Inngest в живой интерфейс: статусы заказов, стриминг токенов, логи и подтверждения от пользователя. CX Codex +1 797установок inngest-api Инструктирует агента по работе с REST API v2 Inngest через прямые HTTP-запросы, спецификацию OpenAPI и документацию, когда возможностей CLI или MCP недостаточно. CX Codex +1 783установок inngest-api-cli Скилл учит агента работать с ресурсами Inngest через npx inngest-cli@latest api: разбирать запуски, искать события, синхронизировать приложения. CX Codex +1 776установок inngest-agents Скилл для сборки и отладки агентов на Inngest и AgentKit: вызовы моделей, инструменты, ожидание одобрения человека, прогресс в реальном времени. CX Codex +1 657установок inngest-brownfield-audit Разбирает существующий TypeScript- или JavaScript-проект и показывает, где фоновая работа теряется при деплое или падении процесса. CX Codex +1 659установок inngest-v3-v4-migration Помогает обновить TypeScript-код с Inngest SDK v3 до v4 или устранить ошибки смешанного API. Сканирует репозиторий, меняет триггеры, схемы и вызовы функций по шагам. CX Codex +1 589установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой