Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assistant improvements: Table annotations, and few-shot examples #664

Merged
merged 4 commits into from
Aug 29, 2024

Conversation

chrisclark
Copy link
Collaborator

@chrisclark chrisclark commented Aug 19, 2024

Improvements to the AI SQL Assistant:

  • Table Annotations: Write persistent table annotations with descriptive information that will get injected into the prompt for the assistant. For example, if a table is commonly joined to another table through a non-obvious foreign key, you can tell the assistant about it in plain english, as an annotation to that table. Every time that table is deemed 'relevant' to an assistant request, that annotation will be included alongside the schema and sample data.
  • Few-Shot Examples: Using the small checkbox on the bottom-right of any saved queries, you can designate certain queries as 'few shot examples". When making an assistant request, any designated few-shot examples that reference the same tables as your assistant request will get included as 'reference sql' in the prompt for the LLM.
  • Autocomplete / multiselect when selecting tables info to send to the SQL Assistant. Much easier and more keyboard focused.
  • Relevant tables are added client-side visually, in real time, based on what's in the SQL editor. The dependency on sql_metadata is therefore removed, as server-side SQL parsing is no longer necessary
  • Improved system prompt that emphasizes the particular SQL dialect being used.
  • Ability to view the history of your assistant requests (filtered by connection)

UX Improvements:

  • Cmd+shift+F shortcut for formatting the SQL in the editor

Checkbox for few shot examples

image

Better UI for selecting relevant tables

image

Table annotations

image

Assistant History

image

@chrisclark chrisclark force-pushed the assistant-3 branch 4 times, most recently from c2a1aa0 to 3d72f48 Compare August 22, 2024 01:25
@chrisclark chrisclark changed the title WIP: Assistant 3 UX & Assistant improvements Aug 25, 2024
@chrisclark chrisclark changed the title UX & Assistant improvements Assistant improvements: Table annotations, and few-shot examples Aug 25, 2024
explorer/src/js/explorer.js Dismissed Show dismissed Hide dismissed
explorer/src/js/tableDescription.js Dismissed Show dismissed Hide dismissed
@chrisclark chrisclark merged commit 2d7736d into master Aug 29, 2024
11 checks passed
@chrisclark chrisclark deleted the assistant-3 branch August 29, 2024 14:03
@cuspymd
Copy link

cuspymd commented Nov 12, 2024

@chrisclark I have a question about your modification. You're converting table names to lowercase for processing. Is there any particular reason for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants