Логотип Cxas Loss Analysis

Cxas Loss Analysis

Організація
GoogleCloudPlatform
cxas-loss-analysis

Retrieves non-contained CCAI Insights conversations (losses), uses agent intelligence to cluster them into common failure patterns, and generates a markdown report. Use when you need to analyze failure patterns and build targeted regression/evaluation reports.

Огляд

ВидавецьGoogleCloudPlatform
Репозиторійcxas-scrapi
Назва навичкиcxas-loss-analysis
Зірки
113
Форки
106
Файли в пакеті
1
ЛіцензіяApache-2.0
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 1

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем GoogleCloudPlatform. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Cxas Loss Analysis у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/GoogleCloudPlatform/cxas-scrapi/tree/main/.agents/skills/cxas-loss-analysis
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/GoogleCloudPlatform/cxas-scrapi.git /tmp/cxas-scrapi
mkdir -p .claude/skills
cp -r /tmp/cxas-scrapi/.agents/skills/cxas-loss-analysis .claude/skills/cxas-loss-analysis
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Cxas Loss Analysis в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Cxas Loss Analysis, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Cxas Loss Analysis не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Insights Loss Analysis & Report Generator

This skill instructs you (the AI Agent) to retrieve recent conversations from CCAI Insights, isolate escalated/non-contained sessions (losses), analyze their root causes to group them into failure patterns, and write a professional Markdown report.


Execution Routine

Follow these steps in exact sequence:

Step 1: Parameter Verification

Verify that the user has provided the following required parameters:

  • project_id: GCP Project ID hosting Insights.
  • location: Insights location (e.g., us).
  • app_id: Target CXAS App ID (e.g., db9ee866-28db-458b-b835-78137c974779).
  • output_dir: Directory where the final report and test cases will be saved.

And the following optional parameters if they wish to scope the analysis:

  • start_time: RFC 3339 timestamp for start of time period (e.g., 2026-05-20T00:00:00Z).
  • end_time: RFC 3339 timestamp for end of time period (e.g., 2026-05-26T23:59:59Z).
  • filter: Custom API filter string to apply (overrides the default loss filter -labels.sessionContained="true").
  • limit: Maximum conversations to retrieve and process (default: 500).

Step 2: Extract Loss Transcripts

Run the lightweight data-extraction script to dump the loss transcripts into chunked JSON files in your workspace.

Command Template:

bash
python3 -P .agents/skills/cxas-loss-analysis/scripts/fetch_losses.py \
  --project-id "{project_id}" \
  --location "{location}" \
  --app-id "{app_id}" \
  --limit {limit} \
  --output-file "{output_dir}/raw_losses.json" \
  [--start-time "{start_time}"] \
  [--end-time "{end_time}"] \
  [--filter "{filter}"]

Note: Always run python using the virtual environment's executable with the -P flag (e.g., .venv/bin/python -P) to avoid path pollution.

Step 3: Read Transcripts & Summarize Escalations

Use the view_file or other file-reading tools to read the generated {output_dir}/raw_losses.json file. Extract the list of chunks (which contains paths to the chunked JSON files).

For each chunk file in the chunks list:

  1. Read the chunk file to load the batch of transcripts.
  2. For each conversation transcript: a. Analyze the conversation between the customer (user) and the virtual agent (agent). b. Identify if the user displayed "AI aversion":
    • Definition: Sessions where the user did not meaningfully engage with the agent or expressed a strong preference for a human agent (e.g., immediately asking for "human", "agent", "representative" in the first 1-2 turns without describing their issue, or explicitly stating they do not want to talk to an AI/robot).
    • If "AI aversion" is detected, mark this session as ignored from the core loss analysis. Note the reason (e.g., "AI aversion: User demanded human agent immediately"). c. For non-ignored genuine losses:
    • Identify why the conversation escalated or was not contained.
    • Formulate a concise, 1-sentence primary reason for failure/escalation (max 20 words). E.g., "Virtual agent failed to authenticate the user due to repeated pin entry errors."

Step 4: Cluster Failures into Loss Patterns

Review the complete list of genuine (non-ignored) failure reasons you generated in Step 3. Using your analytical capabilities, group these failure reasons into 8 to 10 distinct, mutually exclusive failure patterns to provide granular insights.

For each pattern, define:

  1. Pattern ID: A simple key (e.g., pattern_1, pattern_2, ...).
  2. Name: A short, descriptive name (e.g., "Authentication Loop", "Unsupported Customer Intent", "Agent Transfer on Disambiguation").
  3. Description: A clear 1-2 sentence description explaining the pattern and what triggers it.

Step 5: Categorize All Sessions

Map every analyzed conversation_id to either:

  • One of the 8 to 10 defined failure patterns.
  • ignored_ai_aversion if the user displayed AI aversion.

Keep track of this mapping for the final report.

Step 6: Write the Markdown Report

Compile your analysis into a structured Markdown report and write it to {output_dir}/loss_patterns_report.md. Use the following structure:

markdown
# Loss Patterns Analysis Report

**Project**: `{project_id}`
**App ID**: `{app_id}`

## Executive Summary

A sample of up to {limit} conversations matching the filter was selected for detailed manual analysis and clustering to identify key patterns.

## Loss Patterns Distribution

| Pattern ID | Name | Count | Percentage of Genuine Losses |
| --- | --- | --- | --- |
| `pattern_1` | Pattern Name | Count | Pct% |
| ... | ... | ... | ... |

*Note: Ignored AI aversion sessions are excluded from the pattern distribution.*

## Detailed Patterns Breakdown

### `pattern_1`: Pattern Name

**Description**: Pattern description.
**Total Conversations**: Count

#### Examples & Failure Reasons:
- **Session `{conversation_id_1}`**: Failure reason from Step 3.
- **Session `{conversation_id_2}`**: Failure reason from Step 3.

---

## Appendix: Ignored Sessions (AI Aversion)
The following sessions were ignored from the pattern analysis because the user displayed AI aversion:
- **Session `{conversation_id_3}`**: AI aversion reason (e.g., *"User demanded human agent immediately"*).
- **Session `{conversation_id_4}`**: AI aversion reason.

Step 7: Present Summary to User

Present a clear summary of your findings directly in the chat, pointing the user to {output_dir}/loss_patterns_report.md and highlighting the key patterns and the adjusted containment rate.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Cxas Loss Analysis?

Retrieves non-contained CCAI Insights conversations (losses), uses agent intelligence to cluster them into common failure patterns, and generates a markdown report. Use when you need to analyze failure patterns and build targeted regression/evaluation reports.

Навіщо використовувати Cxas Loss Analysis у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Cxas Loss Analysis — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Cxas Loss Analysis у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/GoogleCloudPlatform/cxas-scrapi/tree/main/.agents/skills/cxas-loss-analysis. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Cxas Loss Analysis?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Cxas Loss Analysis?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Cxas Loss Analysis — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Cxas Loss Analysis?

Так. Навичку опубліковано на GitHub: GoogleCloudPlatform, за ліцензією Apache-2.0. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇