Skip to main content

Build a structured extractor

A lot of AI work has nothing to do with conversation: "take this unstructured input and give me back something my code can use." A support ticket → a queue. A contract → its key terms. A review → a sentiment and a set of themes. For that, skip the agent and use a flow whose output shape is guaranteed. Two patterns cover it.

Classifier — one of N categories

When the answer is a single label from a fixed set, use the Classifier pattern.

  1. New flow → Classifier

    Define your categories — say {billing, technical, account, urgent} — with a short description of what belongs in each. The descriptions are what make it accurate; be specific about the boundaries.

  2. Test and publish

    Run real inputs through the test pane, tighten the category descriptions where it gets confused, and publish a version.

  3. Call it

    Run it (form shape) and the output is one of your categories — a value you can switch on directly, no parsing.

Structurer — typed JSON against a schema

When you need multiple fields out, use the Structurer pattern. You give it a JSON Schema and it returns an object matching it.

  1. New flow → Structurer

    Describe the shape you want — the fields, their types, which are required. A contract extractor might return { parties: string[], effectiveDate: string, autoRenews: boolean }.

  2. Test and publish

    Feed it representative inputs, confirm the fields come back right, and publish.

  3. Call it

    The run returns an object matching your schema — drop it straight into your code, no free-text parsing, no "sometimes it wraps it in prose."

Compose them

A structurer or classifier can be attached to an agent as a tool, or imported into a bigger flow as a step. Build the reliable piece once, reuse it everywhere.

2 min read