Find answers from the community

Updated 3 months ago

Hey I could use some help trying to

Hey I could use some help trying to understand the following:
  • I want to use hybrid search with a weaviate db in a chat engine
  • I see how I can do that with a query engine with `index.as_query_engine(vector_store_query_mode="hybrid"), but I want to use a chat engine
  • I'm using the CONDENSE_PLUS_CONTEXT type and I see in the source that it does:
Plain Text
return CondensePlusContextChatEngine.from_defaults(
                retriever=self.as_retriever(**kwargs),
                llm=llm,
                **kwargs,
            )


Would the following work?
`index.as_chat_engine(vector_store_query_mode="hybrid")?

What if I want to do something more complicated like implement this as the retreiver? https://docs.llamaindex.ai/en/stable/examples/retrievers/auto_merging_retriever.html
L
A
5 comments
yea that would work, since its passing in the kwargs
Thanks!

How would it work if I wanted to do the auto merging retriever?

Are these the steps?
  1. parse my nodes with the hierarchical parser
  2. load into my weaviatevectorstore (WVS)
  3. create a storagecontext (SC) from the WVS
  4. get the leaf nodes from my nodes
  5. put the leaf nodes in a separate WVS (WVS_leaf)
  6. create a retriever from WVS_leaf: RT_leaf=retriever( vector_store_query_mode="hybrid")
  7. create a retriever with RT = AutoMergingRetriever(RT_leaf, SC, vector_store_query_mode="hybrid")
  8. create a chat_engine from WVS index via: index.as_chat_engine(RT, vector_store_query_mode="hybrid")
I appreciate the help!
If you are using an auto merging retriever, you'll need to initialize the chat engine from the class, not the helper function

Plain Text
CondensePlusContextChatEngine.from_defaults(RT, ...)
Got it - so my first set of steps are good, but I just need to pass in retreiver=RT when I make the chat engine?
If you have the retriever, you cant do index.as_chat_engine(), you have to do something similar to the above
Add a reply
Sign up and join the conversation on Discord