[LangGraph] Add Optional Sharding Support

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: AI/ML, LangGraph
    • None
    • None
    • Python Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      As requested in https://github.com/langchain-ai/langchain-mongodb/issues/117, we can enable sharding support by having an optional shard_key parameter in our checkpointer, which has the effect of running shardCollection on each of the collections used by the checkpointer.

      Sample code:

      # Enable sharding on the database  
      database_name = 'your_database'  
      client.admin.command('enableSharding', database_name)  
        
      # Shard the collection  
      collection_name = 'your_collection'  
      shard_key = {'your_shard_key': 1}  # Specify your shard key  
      client.admin.command('shardCollection', f'{database_name}.{collection_name}', key=shard_key)  
       

      Definition of done

      Enable the feature and test with local and remote Atlas.

      Pitfalls

      None

            Assignee:
            Steve Silvester
            Reporter:
            Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: