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

Add Retries & Fallback to SQL Retriever #10341

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Add Retries & Fallback to SQL Retriever #10341

merged 1 commit into from
Jan 9, 2025

Conversation

tmichaeldb
Copy link
Contributor

Description

LLMs will not always generate correct SQL queries to be used with pgvector for hybrid search. In this case, we should try to correct the query n times, and then fallback to our default retriever if executing the corrected queries still return errors.

This way, worst case, we just use our default retriever without metadata instead of returning an error.

Related to ML-240

Type of change

  • ⚡ New feature (non-breaking change which adds functionality)

Verification Process

To ensure the changes are working as expected:

  • Test Location: ./tests/unit/test_sql_retriever.py
  • Verification Steps: Outline the steps or queries needed to validate the change. Include any data, configurations, or actions required to reproduce or see the new functionality.

Additional Media:

  • I have attached a brief loom video or screenshots showcasing the new functionality or change.

Checklist:

  • My code follows the style guidelines(PEP 8) of MindsDB.
  • I have appropriately commented on my code, especially in complex areas.
  • [] Necessary documentation updates are either made or tracked in issues.
  • Relevant unit and integration tests are updated or added.

Copy link
Contributor

@dusvyat dusvyat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one, lgtm

@QuantumPlumber QuantumPlumber self-requested a review January 9, 2025 18:28
Copy link
Contributor

@QuantumPlumber QuantumPlumber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a look, LGTM

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

Successfully merging this pull request may close these issues.

3 participants