Skip to content

Implement defined queries #1144

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

Open
wants to merge 2 commits into
base: gated
Choose a base branch
from
Open

Implement defined queries #1144

wants to merge 2 commits into from

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Apr 1, 2025

This PR implements two new features with predefined SQL queries:

  1. A defined_queries parameter for storing predefined SQL queries that users can trigger individually or all together with a click of a button
  2. A QueryLookup tool that embeds these queries and suggests relevant ones based on user questions

These defined queries are defined in the Coordinator class which are displayed as clickable buttons under suggestions

The QueryLookup class extends VectorLookupTool for embedding of SQL queries and their descriptions. Not sure if I should just use DocumentLookup...?

If defined queries exist, the SQLAgent could use QueryLookup, but also still debating whether it's a Coordinator/Planner or SQLAgent thing.

Also implements a fast track method to immediately call QueryLookup -> SQLAgent -> VegaLiteAgent

@ahuang11 ahuang11 requested a review from philippjfr April 1, 2025 01:57
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 8.60927% with 138 lines in your changes missing coverage. Please review.

Project coverage is 54.83%. Comparing base (4986773) to head (5d91065).

Files with missing lines Patch % Lines
lumen/ai/coordinator.py 3.84% 100 Missing ⚠️
lumen/ai/tools.py 17.39% 38 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            gated    #1144      +/-   ##
==========================================
- Coverage   55.26%   54.83%   -0.44%     
==========================================
  Files         112      112              
  Lines       15993    16143     +150     
==========================================
+ Hits         8839     8852      +13     
- Misses       7154     7291     +137     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from gated to main April 3, 2025 10:51
@ahuang11 ahuang11 changed the base branch from main to refactor_lookup April 7, 2025 15:21
@ahuang11 ahuang11 changed the base branch from refactor_lookup to gated April 7, 2025 15:22
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.

1 participant