IterativeTableLookup#
- class lumen.ai.tools.IterativeTableLookup(*, max_selection_iterations, table_similarity_threshold, _ready, enable_select_columns, enable_table_validation, include_columns, include_metadata, include_misc, max_concurrent, sync_sources, enable_query_refinement, max_refinement_iterations, min_refinement_improvement, min_similarity, n, refinement_similarity_threshold, vector_store, always_use, interface, llm, memory, prompts, template_overrides, purpose, name)#
Extended version of TableLookup that performs an iterative table selection process. This tool uses an LLM to select tables in multiple passes, examining schemas in detail.
Parameters#
type: bool
default: True
Whether to enable query refinement for improving search results.
type: bool
default: True
Whether to enable column subsetting to filter out irrelevant columns.
type: bool
default: True
Whether to enable validation of tables between queries to determineif the full TableLookup process needs to be rerun.
type: bool
default: True
Whether to include column names and descriptions in the embeddings.
type: bool
default: True
Whether to include table descriptions in the embeddings and responses.
type: bool
default: False
Whether to include miscellaneous metadata in the embeddings,besides table and column descriptions.
type: int
default: 1
bounds: None
Maximum number of concurrent metadata fetch operations.
type: int
default: 3
bounds: (1, 10)
Maximum number of refinement iterations to perform.
type: int
default: 3
bounds: None
Maximum number of iterations for the iterative table selection process.
type: Number
default: 0.05
bounds: (0, 1)
Minimum improvement in similarity score required to keep refining.
type: Number
default: 0.05
bounds: None
The minimum similarity to include a document.
type: int
default: 10
bounds: (1, None)
The number of document results to return.
type: Number
default: 0.3
bounds: (0, 1)
Similarity threshold below which query refinement is triggered.
type: bool
default: True
Whether to automatically sync newly added data sources to the vector store.
type: Number
default: 0.5
bounds: None
If any tables have a similarity score above this threshold,those tables will be automatically selected and there will not be aniterative table selection process.
type: lumen.ai.vector_store.VectorStore
default: None
Vector store object which is queried to provide additional contextbefore responding.
Methods#
- async IterativeTableLookup.requirements(messages: list[Message]) list[str] #
- async IterativeTableLookup.respond(messages: list[Message], **kwargs: dict[str, Any]) str #
Fetches tables based on the user query, selects relevant columns, and returns formatted context.