Skip to content

Basic Chain

Basic Chain sends an AI model a set of fixed instructions together with a piece of data that changes on every run, and returns the model’s answer as structured data in JSON format. It is useful when you need the model to always return the same structure, for example specific fields extracted from a text.

You write the instructions once: the data of each run fills the gap you mark between braces.

When to use it

  • Extract the order number, reason and urgency from a customer email into separate fields.
  • Classify a review as positive, neutral or negative and also return the topics it mentions.
  • Turn the free-text description of an incident into a record with category, responsible team and summary.

Configuration

FieldWhat it does
System PromptThe general instructions for the model: its role and how it must answer. Ask it to answer only in JSON format and describe the fields you expect.
PromptThe message sent to the model on each run. Include a single gap between braces, for example {text}, which is filled with Input Data.
Input DataThe data of each run, for example the email text. You can type it or connect it to the text output of another component.
ConnectionWhat to connect
ModelAn AI model component, for example OpenAI.

Advanced options

FieldWhat it does
Disable StreamingMakes the model deliver the full answer at once instead of in parts. Default: off.

Output

  • Result: the model’s answer in JSON format. Connect it to any text input, for example a Chat Output or a component that turns the text into data.
  • Runnable: the component ready to be run by another one. Connect it to Runnable As Tool so an agent can use it as a tool. When Runnable is connected, Input Data and Result are hidden, because whoever runs it provides the data.

Example

Mensajería Tajo receives customer notices about shipments by email:

  1. In System Prompt write: “You are a customer service assistant. Answer only with a JSON with the fields shipment_number, reason and urgency (high, medium or low).”
  2. In Prompt write: “Analyse this email: {email}”.
  3. Connect the email text to Input Data and a model to Model.

For the email “My parcel 48213 has been stuck for a week and it’s a gift for tomorrow”, Result returns a JSON with number 48213, reason “shipment stuck” and high urgency.