Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor committed Jan 7, 2025
1 parent 6d2104c commit 1c9817a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs_website/docs/user_guide/ai_assistant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ This feature is disabled by default. You can enable it in the Editor tab of user

![](/img/user_guide/sql_complete.png)

## Search Table by Natural Language
## Search Tables and Queries by Natural Language

If [vector store](../integrations/add_ai_assistant.mdx#vector-store) of the AI assistant plugin is also enabled, you'll be able to search the tables by natual language as well as keyword based search.
If the [vector store](../integrations/add_ai_assistant.mdx#vector-store) of the AI assistant plugin is enabled, you'll be able to search both tables and queries using natural language in addition to traditional keyword-based search.

![](/img/user_guide/table_vector_search.png)
2 changes: 1 addition & 1 deletion querybook/server/const/ai_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AICommandType(Enum):
DEFAULT_VECTOR_STORE_FETCH_LIMIT = 30
# how many tables to return from vector table search eventually
DEFAULT_TABLE_SEARCH_LIMIT = 10
# how many tables to return from vector query search eventually
# how many queries to return from vector query search eventually
DEFAULT_QUERY_SEARCH_LIMIT = 10
# how many tables to select for text-to-sql
DEFAULT_TABLE_SELECT_LIMIT = 3
3 changes: 2 additions & 1 deletion querybook/server/lib/vector_store/base_vector_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Literal, Optional

from const.ai_assistant import (
DEFAULT_QUERY_SEARCH_LIMIT,
DEFAULT_TABLE_SEARCH_LIMIT,
DEFAULT_VECTOR_STORE_FETCH_LIMIT,
DEFAULT_SIMILARITY_SCORE_THRESHOLD,
Expand Down Expand Up @@ -113,7 +114,7 @@ def search_query(
self,
text: str,
threshold: float = DEFAULT_SIMILARITY_SCORE_THRESHOLD,
k=DEFAULT_TABLE_SEARCH_LIMIT,
k=DEFAULT_QUERY_SEARCH_LIMIT,
fetch_k=DEFAULT_VECTOR_STORE_FETCH_LIMIT,
) -> list[tuple[int, float]]:
"""
Expand Down

0 comments on commit 1c9817a

Please sign in to comment.