Back to Blog

automation

Two-Phase Ingestion: From Raw CX Artifacts to Usable Transcripts

Extract structure and generate transcripts from customer artifacts with a strict two-phase protocol for AI agents.

OpenAgentSkillPublished:

Where this fits

You're building an agent that needs to analyze customer interaction artifacts—say, a Cyara test export or a raw IVR flow dump. The data is messy: XML, JSON, or logs with mixed structure. You need two outputs: a clean map of the system (taxonomy, intents, tools, transitions) and natural conversation transcripts that mirror real user journeys. Doing this in one pass usually yields sloppy results—the agent either invents transcripts too early or loses structural fidelity. This skill enforces a strict two-phase protocol: digest structure first, then generate transcripts from that digest.

Why agents benefit

  • Separation of concerns: Phase 1 forces pure structural extraction (YAML/Markdown) with no transcript inference, reducing hallucination risk in later generation.
  • Deterministic exception handling: If transcripts already exist in the source (e.g., Cyara XML), the protocol extracts them directly, skipping generation entirely.
  • Consistent output format: The append_turn.py script ensures transcripts are built turn-by-turn with a defined schema, making downstream parsing and evaluation trivial.
  • Reusable across artifact types: The protocol is format-agnostic—works on Cyara, Genesys, or custom exports—as long as Phase 1 maps the same core entities.
  • Auditable pipeline: Each phase can be run and verified independently, so you can debug where a transcript went wrong without redoing the whole analysis.

Practical scenarios

Migrating a legacy IVR to a new platform

You have a Visio diagram and old call-flow XML. Run Phase 1 to extract nodes, intents, and transitions into a structured YAML. Then Phase 2 generates realistic transcripts for each path, which you use to test the new platform's NLU model.

Building a conversational QA dataset

Your team needs thousands of labeled conversations for fine-tuning a support bot. Instead of manually writing transcripts, use the protocol to digest a few hundred real call logs, then generate synthetic variations from the structural map—keeping intent boundaries intact.

Auditing a customer service bot's compliance

Regulators require evidence of how the bot handles sensitive intents. Phase 1 gives you a clear map of all intents and tools. Phase 2 produces transcripts that demonstrate each flow, which you can attach to compliance reports.

Add it to your agent workflow

Install the skill via npx:

npx skills add GoogleCloudPlatform/cxas-scrapi --skill cxas-protocol-two-phase-ingestion

Then, in your agent's prompt, instruct it to follow the two phases. For example:

You are a CX analyst. Use the cxas-protocol-two-phase-ingestion skill.
Phase 1: Extract structure from the attached artifact into YAML. Do not generate transcripts.
Phase 2: Use ./append_turn.py to build transcripts from the YAML.

The skill's README provides the exact rules for each phase, so your agent can execute without further hand-holding. For a deeper dive, see the skill page on OpenAgentSkill.

Compare before adopting

  • Quality signals: Check if the skill's examples match your artifact formats. Does it handle your specific XML schema or JSON nesting?
  • Maintenance freshness: The repo is under GoogleCloudPlatform, but verify last commit date and open issues. A stale skill may miss new CX tooling.
  • Alternatives: Some agents use a single-pass prompt with a few-shot example. Compare transcript fidelity and structural accuracy against this two-phase approach.
  • Workflow fit: Does your pipeline already produce structured data? If so, you might only need Phase 2. The skill is modular enough to use either phase independently.

Why it is worth tracking

With 95 stars and an official Google Cloud origin, this skill signals a practical, opinionated approach to a common agent task. The two-phase design is a strong pattern—it reduces hallucination and makes output auditable. Watch for updates that add support for more artifact types or improve the append_turn.py script. Evaluate it when you next need to convert raw CX data into both a structural map and natural transcripts; it's a solid baseline that you can adapt to your own prompts.

Featured Skill

cxas-protocol-two-phase-ingestion

Skill by GoogleCloudPlatform