Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Teradata Agent Builder Workshop

Lab time: about 60 to 75 minutes

The Problem

A financial advisor needs to know which client portfolios hold a single stock above 30%, and whether that breaks FINRA concentration limits. Answering it takes two kinds of work: querying the portfolio database, which means knowing the tables and writing SQL, and reading through SEC and FINRA regulations to find the rule that applies. Usually that's two different people, and the advisor waits on both.

What You Will Build

A Portfolio Advisor Assistant on Teradata Vantage: a copilot that answers portfolio and compliance questions in one conversation. Ask it a question and it will:

  1. Find the relevant tables and columns in the portfolio database through a catalog

  2. Run the query in Teradata through an MCP server, so the work happens where the data lives

  3. Search SEC and FINRA compliance documents for the rules that apply

  4. Combine both into one summarized answer with citations

What You Will Learn

  • Build a data catalog from a Teradata schema and generate business metadata for each table

  • Connect an agent to Teradata through MCP (Model Context Protocol) to push query execution down to the database

  • Combine structured data and a compliance knowledge base in a single agent

  • Compare models side by side and inspect responses with Prompt Lens and traces

  • Deploy the agent as a copilot with citations, follow-up questions, feedback, and traces

Build Order

Build the catalog first, then the agent that uses it, then the recipe, and the copilot last.

Step
You create
Contains

1

Catalog: Portfolio Catalog

3 imported Teradata tables with business metadata

2

Agent prompt

3 tools: Portfolio Catalog, Teradata MCP, Compliance Reports

3

Workflow recipe: Portfolio Advisor

Chat, Start, Agent, End

4

Copilot: Portfolio Advisor Assistant

Chat page for end users

Before You Start

  • Access to the Karini AI platform, through the invitation email

  • Access to the Teradata catalog for client portfolios, with credentials provided separately

  • Access to the Teradata MCP server, set up by your admin

  • The Portfolio Advisor prompt template, available in Prompt Playground

  • The Compliance Reports dataset, pre-populated with FINRA and SEC compliance documents

Sign up for Karini AI

If you received an email invitation, follow the sign-up link in it and click Sign Up.

Fill in your Full name and a valid Email, click Submit, and follow the on-screen instructions to finish signing up. You can't sign up directly without an invitation email.

Log in for the first time

The first time you log in, Karini AI shows a Setup Wizard. Click Opt-Out in the top right corner.

You're redirected to the Karini AI homepage, ready to start.

Words You Will See

  • Catalog: a description of a database's tables and columns that helps the agent find the right data

  • Business metadata: plain-language descriptions of each table and column, generated so the agent understands what the data means

  • MCP: Model Context Protocol, a standard way for an agent to call tools on another system. Here it runs queries inside Teradata.

  • Prompt template: a ready-made prompt stored in Karini. You load it instead of typing it.

  • Tool: something an agent can call, such as a catalog, an MCP server, or a knowledge base

  • Prompt Lens: a view of the prompt and response details behind an answer

  • Trace: a record of every tool the agent called, with its inputs and outputs

  • Recipe: the workflow that connects everything on a canvas

  • Copilot: the chat assistant end users open to use the recipe

  • Publish: saves a version that recipes can use. Saved but unpublished changes are not used.

Step 1: Create the Database Catalog

1.1 Create the catalog

  1. Navigate to Catalog Schema using the vertical menu bar.

  2. Click Add new.

  1. Configure the catalog:

Field
Value

Name

Portfolio Catalog

Connector type

Teradata

Credentials

The credentials provided separately. Make sure to fill in the Database field

  1. Save the catalog, then open it.

1.2 Import the tables

  1. Click Browse schema.

  1. The View Schema panel opens with the Catalog Explorer. In the catalog hierarchy, expand FAsuperuser to see the available tables.

  1. Select these three tables:

Table

transaction_history

client_profiles

portfolio_holdings

  1. Click Import selected schemas on the right side of the screen.

1.3 Generate metadata and publish

  1. Open the Catalog Explorer and, one table at a time:

    • Select the table.

    • Enable all checkboxes for metadata generation.

    • Click Generate Metadata on the right side.

  1. After all three tables have metadata, click Publish in the upper-right corner.

Once published, the catalog is ready to use as a tool in your agent prompt.

Refer to the following video to create the database catalog.

Step 2: Create the Agent Prompt

2.1 Create the prompt

  1. Navigate to Prompt Playground using the vertical menu bar.

  2. Click Add new.

  1. Click Prompt templates.

  1. From the prompt templates table, select the Portfolio Advisor template.

  1. Click Use template.

  1. Increase Max State Updates from 3 to 50 for complex reasoning.

  1. Scroll down to the Agent input box and add this test query:

  1. Scroll up and rename your prompt with your initials.

  2. Save the prompt. You'll return to Prompt Playground; select your working prompt and open the Tools tab.

Save your changes before you navigate away to add tools, or they are lost.

2.2 Add tool 1: Portfolio Catalog

  1. Click Add new and fill in:

Field
Value

Name

Portfolio Catalog

Description

The catalog tool uses natural language questions to search relevant tables and columns to create a SQL query

Type

Catalog

Catalog

The catalog you created in Step 1

  1. Save the tool.

2.3 Add tool 2: Teradata MCP

  1. Click Add new and fill in:

Field
Value

Name

Teradata MCP

Description

MCP server providing tools to access Teradata database to push down query execution

Type

MCP (Model Context Protocol)

MCP

Teradata, created by your admin

  1. Save the tool.

2.4 Add tool 3: Compliance Reports

  1. Click Add New and fill in:

Field
Value

Name

Compliance Reports

Description

Retrieves compliance reports from a dataset.

Type

Dataset

Dataset

Compliance Reports, a vector knowledge base pre-populated with FINRA and SEC compliance documents

Prompt context

Use Embedding chunks

Top-K

3

  1. Save the tool. Your Tools tab now shows all three tools, and you're ready to test.

2.5 Test & Compare

  1. Open the Test & Compare tab.

  2. Select different models. Compare Bedrock Anthropic Claude Sonnet 3.7, Bedrock Anthropic Claude Sonnet 4.0, and Claude 3.5 Sonnet V2.

  3. Click Test.

  4. Wait for all three responses. While they run, the status shows Generating...

When the responses are ready, each model shows three icons:

Icon
What it does

Copy

Copies the response

Prompt Lens

Inspects the prompt and response

Trace

Shows each tool's inputs and outputs

  1. Click Format Response at the top to see the output in a structured format.

  1. Review the traces to check which tools were invoked, with their inputs and outputs.

  1. Compare the outputs of the models. Look at response times, input and output tokens, and the traces.

  2. Click Select as Best Answer on Bedrock Anthropic Claude Sonnet 3.7 to set it as the Primary Model.

  1. Click Save prompt run to save your experiment with comments.

  1. Save the prompt.

  1. Publish the prompt. Once published, it's assigned a version number. Only published prompts are visible in the recipe.

Refer to the following video to create and test the agent prompt.

Step 3: Create a Workflow Recipe

3.1 Create the recipe

  1. Navigate to Recipe in the vertical menu bar.

  2. Click Add new in the top corner.

  1. Configure the recipe:

Field
Value

Name

Portfolio Advisor

Description

Intelligent assistant for portfolio advisor

Type

Workflow

Runtime

Karini

3.2 Add and connect the nodes

Drag each element onto the recipe canvas, then click it to configure it.

#
Element
Settings

1

Chat

Conversation history 2 messages. Generate follow-up questions on. Citation on

2

Start

None

3

Agent

Prompt = the agent prompt you created in Step 2. Messages = All Messages

4

End

None

Connect them in a straight line: Chat → Start → Agent → End.

3.3 Recipe settings, publish, and test

  1. On the right side, set Number of state updates to a higher value, such as 75.

  2. Click an empty space on the canvas, then click Save.

  3. Select your recipe from the recipe table and click Publish.

  1. Add tags to categorize and identify the recipe version before publishing.

  1. By default, the V1 version is deployed once it is published. For later versions, click Actions and select Deploy.

  2. Click Test on the right side.

  1. A chat widget opens for your questions.

  1. Chat widget will be displayed to enter the questions.

  2. Try these questions:

Question
What it exercises

How many clients have completed their KYC verification?

Catalog and Teradata MCP

Which portfolios have any single stock position over 30%? Check against FINRA concentration limits.

Teradata MCP plus the compliance knowledge base

Response times vary with the complexity of the question and data availability. Once the answer appears, you'll see:

Element
What it does

Response

The generated answer

Prompt Lens

The prompt details and response breakdown

Trace

The tools invoked, with their inputs and outputs

Statistics

Response time, token usage, and timestamps

  1. Test with sample questions:

    1. How many clients have completed their KYC verification?

    2. Which portfolios have any single stock position over 30%? Check against FINRA concentration limits.

  2. Wait for a few moments while the system processes the query. Response times may vary depending on the complexity of the question and data availability.

    Once the answer is displayed, the following options and details will be available:

    • Response :the generated response to your query.

    • Prompt Lens :view the prompt details and response breakdown.

    • Trace: inspect the tools invoked along with their input and output.

    • Statics : review metadata such as response time, token usage, and timestamps.

Refer to the following video to create and test the recipe.

Step 4: Create Your Copilot

Make sure you have published the recipe before you start this step.

  1. Click the Action -> Create copilot button located at the top-right corner of your recipe.

  1. On the Copilots page, click Add new.

  1. Fill in the copilot details:

Field
Value

Copilot name

Portfolio Advisor Assistant

Welcome message

As preferred

Description

The Portfolio Advisor Assistant is designed to help you analyze and understand clients portfolio

Seed questions

See the list below

Error message

Apologies for the error, please try again

Feedback

Thumbs up and thumbs down on. Optionally, custom feedback

Show traces

On

Seed questions:

  • How should investment advisers document “best interest” determinations under the SEC’s proposed Regulation Best Execution compared with FINRA Rule 5310?

  • How many clients have completed their KYC verification?

  • Which portfolios have any single stock position over 30%? Check against FINRA concentration limits.

  • Are there any accounts with a single ticker representing over 20% of portfolio value? Validate concentration rules.

  1. Click Save.

Open the copilot in one of two ways:

  • From the saved copilot: click the < icon on the right panel, then click Visit Copilot

  • From the left menu : open Copilots in the vertical menu

The copilot opens:

Step 5: Test Your Portfolio Advisor Assistant

  1. Click one of the seed questions.

  2. Wait a few moments while the system processes the query. Response times vary with the complexity of the question.

  3. Once the response is generated, you'll see:

Element
What it does

Answer

The system's response, as text or a table

Citations

The compliance sources referenced, so you can open the original documents

Follow-up questions

Suggested related questions to keep exploring

Trace

The tools invoked, with their inputs and outputs

Prompt Lens

The underlying prompt and response details

Copy

Copies the answer for reuse

Feedback

Thumbs up or thumbs down on the response

Try each of the four seed questions. The KYC question draws on the portfolio database, the regulation question on the compliance documents, and the two concentration questions on both.

Refer to the following video for copilot functionality.

Congratulations, Now you are certified in Karini AI Generative AI Platform and Teradata, World's leading Analytics Platform

Last updated