LangGraph: Update MongoDBStore interface

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: LangGraph
    • 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

      The Interface for initializing Langgraph docstore is too cumbersome from developer experience perspective. It requires the user to init a connection and pass that to the initializer. Also to pass database and collection is slightly unituitive

      Given we haven't released it publicly, let's simplify it. 

       

      Current:

       

      mongo_conn_str = "mongodb+srv://***@xx-xx-dev.uruhxxx.mongodb.net/?retryWrites=true&w=majority"
      mongo_client = MongoClient(mongo_conn_str){}
      
      # init requires pymongo object imports
      store = MongoDBStore(
          collection=Collection(
              database=Database(name="test-database", client=mongo_client), name="test-coll"
          )
      )
      
       

      DOD

      The IDEAL Interface would be this:

       

      store = MongoDBStore(conn_str = , database_name = , collection_name = , index_config = {},....)
      ex:
      store = MongoDBStore(
          collection='test-coll',
          database='test-database',
          mongo_client=mongo_client,  # or even just a connection string here
          index_config={
              "embed": embedding_model,
              "dims": 1536,  # Embedding dimensions
              "fields": ["food_preference"],  # Fields to embed
              "filters": None
           }
      
       )

       

              Assignee:
              Prakul Agarwal
              Reporter:
              Prakul Agarwal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: