run-llama / llama_index

LlamaIndex is a data framework for your LLM applications
https://docs.llamaindex.ai
MIT License
36.74k stars 5.27k forks source link

[Feature Request]: Allow Weaviate specific query parameters #16953

Closed torbenw closed 1 day ago

torbenw commented 1 day ago

Feature Description

The Weaviate client has some parameters for the hybrid search which cannot be used with LlamaIndex, e.g. "max_vector_distance" and "fusion_type". It should be possible to define those Weaviate specific parameters with the existing "vector_store_kwargs".

retriever = vector_store_index.as_retriever(
    similarity_top_k=3,
    alpha=0.5,
    vector_store_query_mode="hybrid",
    vector_store_kwargs={
        # Only works for Weaviate
        "max_vector_distance": 0.2,  # Default: 1.0
        "fusion_type": HybridFusion.RANKED  # Default: HybridFusion.RELATIVE_SCORE
    }
)

This is already done for other vector stores like Pinecone.

Reason

Currently "vector_store_kwargs" is not passed to the Weaviate client search query like it is already done for the Pinecone client.

Value of Feature

This feature allows to use features of the Weaviate hybrid search which have not been explicitly added to LlamaIndex.