index=db,    embeddings=embeddings,    search_field="description_embedding",    content_field="description",)# find the relevant documentdoc = retriever.get_relevant_documents("movie about dreams")print(doc)    [Document(page_content='A thief who steals corporate secrets through the use of dream-sharing technology is given the task of planting an idea into the mind of a CEO.', metadata={'id': 'f1649d5b6776db04fec9a116bbb6bbe5', 'title': 'Inception', 'rating': 8.8, 'director': 'Christopher Nolan'})]Retriever with Filters‚Äãfrom langchain.retrievers import DocArrayRetriever# create a retrieverretriever = DocArrayRetriever(    index=db,    embeddings=embeddings,    search_field="description_embedding",    content_field="description",    filters={"director": {"$eq": "Christopher Nolan"}},    top_k=2,)# find relevant documentsdocs = retriever.get_relevant_documents("space travel")print(docs)    [Document(page_content='Interstellar explores the boundaries of human exploration as a group of astronauts venture through a wormhole in space. In their quest to ensure the survival of humanity, they confront the vastness of space-time and grapple with love and sacrifice.', metadata={'id': 'ab704cc7ae8573dc617f9a5e25df022a', 'title': 'Interstellar', 'rating': 8.6, 'director': 'Christopher Nolan'}), Document(page_content='A thief who steals corporate secrets through the use of dream-sharing technology is given the task of planting an idea into the mind of a CEO.', metadata={'id': 'f1649d5b6776db04fec9a116bbb6bbe5', 'title': 'Inception', 'rating': 8.8, 'director': 'Christopher Nolan'})]Retriever with MMR search‚Äãfrom langchain.retrievers import DocArrayRetriever# create a retrieverretriever = DocArrayRetriever(    index=db,    embeddings=embeddings,    search_field="description_embedding",    content_field="description",    filters={"rating": {"$gte": 8.7}},    search_type="mmr",    top_k=3,)# find relevant documentsdocs = retriever.get_relevant_documents("action
DocArray is a versatile, open-source tool for managing your multi-modal data. It lets you shape your data however you want, and offers the flexibility to store and search it using various document index backends. Plus, it gets even better - you can utilize your DocArray document index to create a DocArrayRetriever, and build awesome Langchain apps!
DocArray is a versatile, open-source tool for managing your multi-modal data. It lets you shape your data however you want, and offers the flexibility to store and search it using various document index backends. Plus, it gets even better - you can utilize your DocArray document index to create a DocArrayRetriever, and build awesome Langchain apps! ->: index=db,    embeddings=embeddings,    search_field="description_embedding",    content_field="description",)# find the relevant documentdoc = retriever.get_relevant_documents("movie about dreams")print(doc)    [Document(page_content='A thief who steals corporate secrets through the use of dream-sharing technology is given the task of planting an idea into the mind of a CEO.', metadata={'id': 'f1649d5b6776db04fec9a116bbb6bbe5', 'title': 'Inception', 'rating': 8.8, 'director': 'Christopher Nolan'})]Retriever with Filters‚Äãfrom langchain.retrievers import DocArrayRetriever# create a retrieverretriever = DocArrayRetriever(    index=db,    embeddings=embeddings,    search_field="description_embedding",    content_field="description",    filters={"director": {"$eq": "Christopher Nolan"}},    top_k=2,)# find relevant documentsdocs = retriever.get_relevant_documents("space travel")print(docs)    [Document(page_content='Interstellar explores the boundaries of human exploration as a group of astronauts venture through a wormhole in space. In their quest to ensure the survival of humanity, they confront the vastness of space-time and grapple with love and sacrifice.', metadata={'id': 'ab704cc7ae8573dc617f9a5e25df022a', 'title': 'Interstellar', 'rating': 8.6, 'director': 'Christopher Nolan'}), Document(page_content='A thief who steals corporate secrets through the use of dream-sharing technology is given the task of planting an idea into the mind of a CEO.', metadata={'id': 'f1649d5b6776db04fec9a116bbb6bbe5', 'title': 'Inception', 'rating': 8.8, 'director': 'Christopher Nolan'})]Retriever with MMR search‚Äãfrom langchain.retrievers import DocArrayRetriever# create a retrieverretriever = DocArrayRetriever(    index=db,    embeddings=embeddings,    search_field="description_embedding",    content_field="description",    filters={"rating": {"$gte": 8.7}},    search_type="mmr",    top_k=3,)# find relevant documentsdocs = retriever.get_relevant_documents("action