DocumentLookup#

class lumen.ai.tools.DocumentLookup(*, 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)#

The DocumentLookup tool creates a vector store of all available documents and responds with a list of the most relevant documents given the user query. Always use this for more context.


Parameters#

enable_query_refinement

type: bool
default: True
Whether to enable query refinement for improving search results.

max_refinement_iterations

type: int
default: 3
bounds: (1, 10)
Maximum number of refinement iterations to perform.

min_refinement_improvement

type: Number
default: 0.05
bounds: (0, 1)
Minimum improvement in similarity score required to keep refining.

min_similarity

type: Number
default: 0.05
bounds: None
The minimum similarity to include a document.

n

type: int
default: 10
bounds: (1, None)
The number of document results to return.

refinement_similarity_threshold

type: Number
default: 0.3
bounds: (0, 1)
Similarity threshold below which query refinement is triggered.

sync_sources

type: bool
default: True
Whether to automatically sync newly added document sources to the vector store.

vector_store

type: lumen.ai.vector_store.VectorStore
default: None
Vector store object which is queried to provide additional contextbefore responding.


Methods#

async DocumentLookup.requirements(messages: list[Message]) list[str]#
async DocumentLookup.respond(messages: list[Message], **kwargs: Any) str#

Responds to the provided messages.