AI Chain

The TM AI Chain defines a configurable, multi-stage AI workflow in which each stage is handled by a distinct AI agent or directly by a language model using a custom prompt. These chains can be used across any domain — such as finance, law, marketing, healthcare, or operations — and are designed to enable step-by-step AI reasoning, transformation, and validation.

Overview

A TM AI Chain consists of an ordered list of stages, where each stage represents a specific task or function performed by either:

  • A reusable AI agent (defined in TM AI Agent), or
  • A direct prompt sent to the language model

This gives you full flexibility to combine reusable logic with fully customized prompting as needed.

Stage Fields

Each AI Chain consists of multiple stages. Each stage includes the following fields:

Field

Description

Label

Display name or title of the stage (e.g., “Financial Analyst”, “Legal Reviewer”).

AI Model

Optional override to specify a particular LLM model (e.g., Deepseek, Skylark) to be used in this stage.

AI Agent

Link to a reusable agent configuration (from TM AI Agent) used if Use AI Agent is enabled.

Use AI Agent

Toggles whether to use the linked AI Agent or a direct prompt and model combination. If unchecked, the stage uses the provided prompt instead.

Context

List of reusable context snippets or references injected into the prompt to guide AI behavior.

Tools

List of linked executable tools (from TM AI Tool) that provide Python-based utility functions, validations, enrichments, or transformations during the stage execution.

Prompt

Direct text instruction used to guide the AI Agent or Model. This is where you define the task the Agent or Model must perform.

Wait for Approval

If enabled, the chain will pause at this stage and wait for manual user approval before continuing to the next step.

Procedure

This guide explains how to use the TM AI Chain feature to orchestrate multi-step AI workflows using predefined agents and optional templates.

Step 1: Open the AI Chain Dialog

Navigate to the AI Chain menu. A dialog will appear with the title “Create or Edit TM AI Chain”.

  • Action: Choose between Create New or Edit Existing.

Step 2A: Create a New AI Chain

If you selected Create New:

Field

Description

Application

Select the application or module this AI Chain belongs to.

TM AI Chain Name

Specify a unique name for your new AI Chain.

Template

(Optional) Choose a TM AI Chain Template to load pre-defined stages automatically.

Click Create to proceed to the AI Chain editor screen where you can configure the stages.

Step 2B: Edit an Existing AI Chain

If you selected Edit Existing:

Field

Description

Select TM AI Chain

Select a previously created TM AI Chain Run instance to continue editing or reviewing.

Click Edit to continue working with the selected chain.

Step 3: Configure Chain Stages

Inside the TM AI Chain editor, define one or more stages. Each stage executes a specific reasoning task. You can:

  • Select a predefined AI Agent or write a custom prompt.
  • Inject relevant context snippets.
  • Attach any helper AI Tools if needed.
  • Enable Wait for Approval to require human validation before proceeding.

Step 4: Run the Chain

Once the chain is fully configured and saved, you can run it in two ways:

Execution Mode

Description

Run Immediately

The AI Chain executes synchronously, and results from each stage are returned in real time.

Queue

The AI Chain is added to a background job queue and will run at the specified time

Step 5: Reuse as a Template (Optional)

To save the chain as a reusable template:

  1. Click ... button.
  2. Select Save as Template.
  3. Assign the Application and input the Display name for the template.

This flow supports advanced orchestration of AI workflows using reusable components, making it ideal for tasks like financial reviews, legal analysis, or customer feedback synthesis.

Discard
Save

On this page

Review Changes ← Back to Content
Message Status Space Raised By Last update on