Uploaded image for project: 'Python Integrations'
  1. Python Integrations
  2. INTPYTHON-271

LangChain: Migrate Self querying retriever to Langchain-mongoDB package

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • langchain-mongodb-0.6
    • Affects Version/s: None
    • Component/s: AI/ML
    • None
    • None
    • Python Drivers
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context:
      A self-querying retriever is one that, as the name suggests, has the ability to query itself. Specifically, given any natural language query, the retriever uses a query-constructing LLM chain to write a structured query and then applies that structured query to its underlying VectorStore. This allows the retriever to not only use the user-input query for semantic similarity comparison with the contents of stored documents but to also extract filters from the user query on the metadata of stored documents and to execute those filters.

       

      DOD:
      There is an existing implementation for MongoDB in the langchain-community package, which can be migrated over to LangChain-MongoDB package.

      MongoDB Atlas has basic implicit support for self-querying as demonstrated in this notebook. Enhance the features like support for filters, etc 

      https://python.langchain.com/docs/integrations/retrievers/self_query/mongodb_atlas/

       

      The query constructor is defined here :https://github.com/langchain-ai/langchain/blob/master/libs/community/langchain_community/query_constructors/mongodb_atlas.py

      The API reference for the SelfQuery retriever is defined here https://python.langchain.com/api_reference/langchain/retrievers/langchain.retrievers.self_query.base.SelfQueryRetriever.html

            Assignee:
            casey.clements@mongodb.com Casey Clements
            Reporter:
            prakul.agarwal@mongodb.com Prakul Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: