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:
Find the relevant tables and columns in the portfolio database through a catalog
Run the query in Teradata through an MCP server, so the work happens where the data lives
Search SEC and FINRA compliance documents for the rules that apply
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.
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
Navigate to Catalog Schema using the vertical menu bar.
Click Add new.

Configure the catalog:
Name
Portfolio Catalog
Connector type
Teradata
Credentials
The credentials provided separately. Make sure to fill in the Database field
Save the catalog, then open it.
1.2 Import the tables
Click Browse schema.

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

Select these three tables:
transaction_history
client_profiles
portfolio_holdings
Click Import selected schemas on the right side of the screen.

1.3 Generate metadata and publish
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.

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
Navigate to Prompt Playground using the vertical menu bar.
Click Add new.

Click Prompt templates.

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

Click Use template.

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

Scroll down to the Agent input box and add this test query:
Scroll up and rename your prompt with your initials.
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
Click Add new and fill in:
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
Save the tool.
2.3 Add tool 2: Teradata MCP
Click Add new and fill in:
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
Save the tool.
2.4 Add tool 3: Compliance Reports
Click Add New and fill in:
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
Save the tool. Your Tools tab now shows all three tools, and you're ready to test.

2.5 Test & Compare
Open the Test & Compare tab.
Select different models. Compare Bedrock Anthropic Claude Sonnet 3.7, Bedrock Anthropic Claude Sonnet 4.0, and Claude 3.5 Sonnet V2.
Click Test.
Wait for all three responses. While they run, the status shows Generating...

When the responses are ready, each model shows three icons:
Copy
Copies the response
Prompt Lens
Inspects the prompt and response
Trace
Shows each tool's inputs and outputs

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

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

Compare the outputs of the models. Look at response times, input and output tokens, and the traces.
Click Select as Best Answer on Bedrock Anthropic Claude Sonnet 3.7 to set it as the Primary Model.


Click Save prompt run to save your experiment with comments.


Save the prompt.

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
Navigate to Recipe in the vertical menu bar.
Click Add new in the top corner.

Configure the recipe:
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.
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
On the right side, set Number of state updates to a higher value, such as 75.
Click an empty space on the canvas, then click Save.
Select your recipe from the recipe table and click Publish.

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

By default, the V1 version is deployed once it is published. For later versions, click Actions and select Deploy.
Click Test on the right side.

A chat widget opens for your questions.


Chat widget will be displayed to enter the questions.
Try these questions:
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:
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

Test with sample questions:
How many clients have completed their KYC verification?
Which portfolios have any single stock position over 30%? Check against FINRA concentration limits.
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.
Click the Action -> Create copilot button located at the top-right corner of your recipe.

On the Copilots page, click Add new.

Fill in the copilot details:
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.
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
Click one of the seed questions.
Wait a few moments while the system processes the query. Response times vary with the complexity of the question.
Once the response is generated, you'll see:
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
