How to connect vector search pipeline to RAG stack (with langchain)?

Hi @Akbar_Bakhshi2 - the code snippet that you shared specifies:

vectorStore = MongoDBAtlasVectorSearch(   
     wods_collection, 
     OpenAIEmbeddings(openai_api_key=OPENAI_API_KEY),      
     index_name='wod_vector_index_openai'
)

As I indicated in the earlier response, if the name of the vector-embeddings field in your collection is something other than “embedding” (in your collection, it’s named “wod_embedding_openai”) , then you would need to specify that field name explicitly in the code while instantiating MongoDBAtlasVectorSearch vector store, with an embedding key param. So, you would need to specify the “embedding_key = ‘wod_embedding_openai’”, like this:

vectorStore = MongoDBAtlasVectorSearch(   
     wods_collection, 
     OpenAIEmbeddings(openai_api_key=OPENAI_API_KEY),      
     index_name='wod_vector_index_openai',
     embedding_key = 'wod_embedding_openai'
)
1 Like