genai-stack
genai-stack copied to clipboard
Is it possible to parameters to the vector retrieval query ?
Hi,
I was wondering if it is possible to pass some parameters to the vector index retrieval query (similar to the one in chains.py:142). The value of these parameters depends on user input. I want to retrieve different sets of indexes depending on the user input.
In my query, I have the following match clause.
MATCH (question) -[:SITE]-> (s:Site {name: $site_name})
$site_name will depend on user input
At the moment, there is no clean way to pass parameters to the query. What you could do is to instantiate a Neo4jVector object for each site, and then use the appropriate based on the input parameter
Okay, For now, I implemented a chain factory and used string interpolation for the query, not ideal but it's working
But good idea to make it configurable and allow external parameters to be used in the query @tomasonjo esp. if we integrate it into the LangChain parameter passing between chains. Can you make a note of that or GH issue in LC?
Hi,
I created Neo4j Vector Store connector for Semantic Kernel; I make the retrieval query configurable by providing an overridable query factory and a Dynamic properties dictionary.
The user can update the values in the dictionary at runtime and override the query factory to consume the required keys from the dictionary