Skip to main content
This example demonstrates a multi‑agent workflow for fraud analysis. The flow is: Triage → Retrieve & Augment → Analyze.

Step 1: Preflight — Triage and Refine

First, we triage the user’s request to see if it’s actionable. This agent refines the query and produces a structured PreflightOut model.
The handler for this step checks the ambiguous flag and decides whether to STOP (returning PreflightOut to the user) or CONTINUE with the refined_requirements.

Step 2: Retrieve & Augment

This step uses a handler to perform the core RAG logic: retrieve business knowledge from a vector DB (Pinecone) and then augment a prompt with that context for the final analysis. We use a simple passthrough agent to trigger this handler.
  • Input: The refined_requirements string from the preflight_handler.
  • Output: The augmented_prompt string, which is passed to the final analyzer.

Step 3: Analyze — Classify and Report

The final agent takes the augmented prompt and performs the fraud analysis, returning a structured report.
  • Input: The augmented_prompt from the retrieval handler.
  • Output: An AnalysisReport Pydantic object.

Putting it all together

The workflow assembles these steps in order.