Get started with Kontext Copilot

event 2024-09-08 visibility 69 comment 0 insights
more_vert
insights Stats

Follow this guide to get started with Kontext Copilot.

Roadmap

The following diagram shows the roadmap and progress of Kontext Copilot. 

Kontext Copilot roadmap

Prerequisites

Make sure Kontext Copilot runs successfully on your computer. Follow Kontext Copilot Installation to setup the tool if you have not done that.

Features

Navigate to your local Kontext Copilot website: http://localhost:8100/ui.

Create a chat

On home page, click Start button to start a new chat.

home-page-kontext-copilot

There are two types of chats available: 

2024090841622-image.png

Create General Chat session

Click New chat button under General Chat block.

It will open an window to allow you ask any questions to your Large Language Models (LLMs). 

Type a question like the following:

Who created llama models?

The model will response something like the following screenshot:

2024090842147-localhost_8100_ui_ (2).png


Depends on the model and selected parameters, you may get different response. You can ask follow up questions too.

The Streaming toggle decides how the service provides response. When it is on, the response from LLMs will be shown in an streaming manner. If you turn it off, the answer will be shown after it is completed all at once.

Create Chat to Data session

For creating Chat to Data window, please click New chat button under Chat to Data section. You can click the New chat button on the secondary navigation bar if you already started a conversation.

To use Chat to Data feature, at least one data source is required. To help you evaluate the tool, a built-int database name Chinook is added. It is an SQLite sample database. For more details about this database, you can find it here: https://github.com/lerocha/chinook-database.

Upon the very first release, only SQL Server, SQLite, Duck DB, PostgreSQL databases and CSV and parquet files are supported with more added in the following days.

The chat window looks like the following screenshot:

2024090843152-localhost_8100_ui_ (3).png

Data source schema explorer

On the right side of the window, your selected data source schema are presented. It provides you information about your data sources.

Click on the vertical dots menu icon, more options will show up:

2024090843505-image.png


Click Sample data menu item, you will be able to view the data in the table directly as the following screenshot shows:

2024090843602-image.png

Click on "SQL: CREATE TABLE" or "SQL: SELECT", you can get the SQL scripts for the table:

2024090843751-image.png

Click on "Copy" button, the content will be copied into your clipboard.

Query your data source

Click on the Query tab of the main chat window, you can run SQL queries against your selected data source. The result will be returned as a table:


2024090844114-localhost_8100_ui_ (5).png

Ask a data question

Now switch back to main chat tab. Type the following question:

Show invoices amount by year

The model returns an answer with a SQL block. 

2024090844413-image.png

Run SQL

When there is a SQL block present in the response, a Run SQL button will show up as the above screenshot does. Click on the action button:

2024090844802-image.png

Click Run button and copilot will run the SQL against your selected data source and return the results. You can also change the SQL before it runs.

Once the query is executed successfully, the result will be returned:

2024090845015-image.png

Sometimes the generate query might not be accurate, you can click Fix SQL Errors action button to ask LLMs to fix it. This is the core part of the tool that is still under development.

Chart visualizations

For the Run SQL action, Copilot also analyze whether there are appropriate charts to recommend. If any presents, it will show directly after the result message card:

2024090845641-image.png

More advanced charting options and save Charts are in the road-maps as mentioned earlier.

You can select different chart options if available:

2024090845822-image.png

Data sources config

Go to Data sources item on the left side navigation panel.  You can add new data sources here:

2024090850010-localhost_8100_ui_ (6).png


Click on Add data source button to add new source.

Support for more database types and flat files like parquet, CSV, etc. are coming.

Tools

Two GenAI development tools are provided for people who want to try prompt engineering and embedding of different models.

2024090850255-localhost_8100_ui_ (7).png

Prompt engineering tool

You can try prompt engineering with any supported models. There are several built-in prompt templates are provided or you can input your own prompts. Please try the Streaming and JSON format toggles to find out the differences.

2024090850413-localhost_8100_ui_ (9).png

Settings

The Settings allow you to customize your Copilot.

2024090850820-localhost_8100_ui_ (10).png

For Chat to Data, please use the default LLMs settings; for General Chat, feel free to adjust the settings.

Report bugs

Issues ยท kontext-tech/kontext-copilot (github.com)

Provide your feedback

To provide your feedback, please register here. Once registered, your will get email notifications about a survey form to provide specific feedback. To ensure you don't miss any of the updates, please make sure to whitelist no-reply@kontext.tech in your email account.

You can raise feedback in the Discussions of the repo.

Feel free to add your comments in this article too.

More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts