Hi, I need to create a mongodb vector store through AWS Bedrock’s default chunking. I am successful in creating that, yet when I am using metadata filters throught the API’s “Retrieve_and_generate” function, it’s not working. For comparisons, I created a comparable opensearch vector store which is working fine. Here are the two indexes for comparison:
MongoDB Vector Index { “fields”: [ { “numDimensions”: 1536, “path”: “embedding”, “similarity”: “cosine”, “type”: “vector” }, { “path”: “metadata”, “type”: “vector” }, { “path”: “text_chunk”, “type”: “filter” }, { “path”: “sitename”, “type”: “filter” }, { “path”: “source”, “type”: “filter” } ] }
Now, the problem is, that in the opensearch vector index, the metadata filter encompasses other fields, so we are able to filter using retrieve_and_generate
but in the vector index of mongodb, as the schema indicates, the fields like sitename etc aren’t under metadata.
for reference, here is how the db looks in mongodb
The retrieve_and_generate works fine without filtering when using the mongodb but not with filters. With Open search vector db, it works with and without filtering both.