Find answers from the community

Updated 3 months ago

Milvus

Struggling a lot with my basic pipeline. I have a milvus db that I already stored embeddings in. I checked using the milvus client that it does in fact have data in there. I can't for the life of me however figure out how to do basic rag using llamaindex, the concept sprawl and version fragility isn't as bad as langchain but it's slowly getting there. Can't find one basic end to end example of this anywhere. Can anyone explain why this is returning an empty response?
Attachment
rn_image_picker_lib_temp_e616a33b-4fff-4bcd-90bf-d5c1c66a69f3.jpg
L
D
14 comments
Not man vector stores work out of the box with existing data -- you'll need to either set a few variables, subclass the query method, or just write your own vector store tbh

That being said, lemme check the code
Ah. Milvus supports this nicely
Just set text_key="field" in the constructor to match the field that has your node text
And for other metadata, if stored, set the output_fields argument in the constructor to a list of field names
I see text_key mentioned in the api docs, but not output fields -- need to add output fields to the docstring
https://docs.llamaindex.ai/en/stable/api_reference/storage/vector_store/milvus/#llama_index.vector_stores.milvus.MilvusVectorStore
Still no luck :/ sorry to bother you about this but any idea? Is this just going to be not possible?
Attachment
rn_image_picker_lib_temp_73cd535d-95d8-48d2-9ec8-02874abe8dec.jpg
Oh, maybe a typo -- it should be text_key instead of text_field
Same thing :/ I added embedding field and doc id field too
Oh wait, changing to uri changed the error! Now internal server error! Okay different error
In case anyone finds this useful. Once I get this actually working I'll do a write up and throw it in medium
Attachment
rn_image_picker_lib_temp_3e8ad68b-65d3-4eb3-873b-1e9ba93bb772.jpg
Hey dude I got it working thanks for the help! One thing that might not be super helpful because my view of this is quite myopic, is that with the text_field vs text_key problem and the other problem I had was it was accepting system_prompt as an argument where it really wasn't a valid one, I think the ability to add kwargs arbitrarily is going to cause a lot of potential confusion. I wonder if instead of the interface was stricter and then additional arguments had to be strictly passed in via a dict etc. But anyways just happy rambling. Thanks for your help again
Yea it could be stricter -- although it can be a combination of stuff
  • pydantic classes allow arbitrary kwargs, which is annoying for pydantic models
  • many models actually use kwargs in some way (llm arguments, vector store constructor arguments, etc. -- it can be hard to type out every possible option sometimes)
Glad you got it working!
Add a reply
Sign up and join the conversation on Discord