Topics are a foundational part of SHIFT AI’s SQL Generation and Search features. They segment your data into manageable, focused sets that large language models (LLMs) can efficiently understand and query.
What are Topics?
Topics define which tables and columns SHIFT AI can use when answering natural language questions and generating SQL. A well-structured topic helps the LLM stay focused, generate accurate queries, and avoid confusion.
Add a Topic
Note: Before you begin, make sure SQL Generation with SHIFT AI is turned on in your SHIFT AI Preferences (found in the Settings menu).
Go to the Topics page in the Search Experiences section and click the New Topic button.
Step 1: Name and Describe the Topic
Give your topic a clear, descriptive name and description. This information helps SHIFT AI:
Understand the purpose of the topic
Choose the most relevant topic when a user asks a question
TIP: Be specific—“Customer Support Ticket Trends” is better than “Support.
Step 2: Data
Select Tables and Columns
Choose only the tables and columns necessary to answer questions within the topic. These are the only fields the LLM will use when generating SQL for this topic. Tables and columns can be included in multiple topics.
Best Practices:
Include all columns required to answer relevant questions
Avoid including unrelated or redundant columns
Don’t overload a topic with too much data—this can exceed prompt limits or confuse the model
TIP: Create multiple focused topics instead of one broad one.
Add Descriptions for Ambiguous Fields
If any tables or columns have:
Ambiguous names (e.g.,
cnt,dt)Organization-specific terminology
...add descriptions to explain what they represent and how they should be used.
You don’t need to describe every column—just the ones that might confuse someone unfamiliar with your data.
Descriptions are global and used for all topics.
Step 3: Create Parameters from the Topic
Parameters support:
Verified Questions
Entity detection in Search
Narrative templates used in nightly Insight generation
SHIFT AI allows you to create parameters in bulk from a topic:
SHIFT AI will suggest parameters based on the topic’s columns
It will generate and test SQL for each suggestion to ensure validity
Review and Confirm:
Check each parameter’s ID column, display column, and example values
Edit if needed—adjust labels, add search terms, or format display
Select the parameters you want to create and click “Create Parameters”
Parameters will be put in a queue and added to the Parameters page as they’re created.
Step 4: Train the LLM with Sample Questions
Sample questions help SHIFT AI understand the types of queries a topic is meant to answer. These examples are saved and used to fine-tune how the model interprets user intent for that specific topic.
To train the LLM:
Review the automatically suggested questions.
Deselect any that are not relevant to the topic's purpose.
Add custom questions using the “Add Example” button for better coverage of your use cases.
Click “Save Examples” when you're done.
Tip: Use a mix of basic and complex question examples that reflect the real queries users might ask.
What's Next?
To further train SHIFT AI and improve accuracy, continue interacting with the topic using real-world questions. This helps SHIFT AI learn your business logic, terminology, and preferred calculations.
Ask several questions within the topic—especially those that highlight:
Custom business terms
Common calculations or metrics
Columns that should appear in result sets
If SHIFT AI doesn’t get it right the first time:
Adjust the SQL, and save it as a template so SHIFT AI can reference it for similar questions in the future.
Add missing tables or columns to the topic if additional data is needed.
Add clear definitions and usage instructions to topic columns to guide the model on ambiguous fields or how data should be used.
Learn more in Train SHIFT AI to Understand Your Data.