Add Context

The Add Context step is an important part of setting up SenseQL. It allows you to provide the agent with detailed information about your business and data so that it can better understand both the structure and purpose of your database. 

This helps the agent generate more accurate and context-specific responses.

Context Types Overview

Adding context involves uploading business-related information, defining SQL question-answer pairs, and generating table definitions. Let’s walk through each step in detail:

1. Upload Business Context

In this step, you’ll upload a file that gives the agent more context about your business. By sharing the problem your business solves and how success is measured, the agent can tailor its responses to fit your business needs.

How to Use It:

  • Click Upload file to select a document that explains your business context.

  • If you don’t have a business context ready or prefer to skip this step, click Skip this step.

  • File types acceptable e.g, PDF/Docx


  • Add Sample Context File


  • Types of context provable:

    • Overview of your business

    • Metrics specific to your business i.e what does retention mean to you, profitability etc. 

Providing a clear business context ensures that the agent understands your specific objectives, helping it generate more relevant and accurate responses.

2. Add SQL Question-Answer Pair

What It Does: *Write in terms of a data analyst*
This step allows you to provide sample SQL question-answer pairs. Adding these pairs helps the agent understand the types of queries you are likely to ask and the corresponding SQL statements to answer them.

How to Use It:

  • Click Add pair to open a modal where you can enter your question and SQL statement.

  • In the Question field, type the type of question you might ask (e.g., “What is the total revenue?”).

  • In the SQL Statement field, enter the corresponding SQL query (e.g., SELECT SUM(revenue) FROM sales).

  • Click Add to save the pair.

    SQL question-answer pairs help train the agent to recognize how to query your database based on natural language inputs, improving its ability to provide meaningful responses to your questions.

3. View Table Definitions

Here, our agent generates and presents the structure of your database tables. By defining each table’s columns and their descriptions, this way the agent better understands how your data is organized and what it represents.

You can also review and edit the definitions generated by the Agent, making it more aligned with what you think suits better. 

How to Use It:

  • Click View Definitions to see a list of your database tables.

  • Select a table to review its columns and descriptions. For example, the employees table may contain columns like employee_id, first_name, and hire_date, each with a description explaining the data stored in that column.

  • If the table definitions look good, click Looks Good to confirm.

Providing clear table definitions ensures that the agent understands your data’s structure, which helps it query your database accurately and effectively.

Click Next to continue the setup process.

Congratulations on completing the Add Context step, you are equipping your SenseQL agent with the necessary information to generate highly accurate responses based on your business context, SQL queries, and data structure. This setup ensures that your agent is ready to assist you with your specific business needs.



Create a free website with Framer, the website builder loved by startups, designers and agencies.