{self.primary_key_name: self.session_id}Composite Keys‚ÄãWhen using an existing DynamoDB table, you may need to modify the key structure from the default of to something including a Sort Key. To do this you may use the key parameter.Passing a value for key will override the primary_key parameter, and the resulting key structure will be the passed value.from langchain.memory.chat_message_histories import DynamoDBChatMessageHistorycomposite_table = dynamodb.create_table(    TableName="CompositeTable",    KeySchema=[{"AttributeName": "PK", "KeyType": "HASH"}, {"AttributeName": "SK", "KeyType": "RANGE"}],    AttributeDefinitions=[{"AttributeName": "PK", "AttributeType": "S"}, {"AttributeName": "SK", "AttributeType": "S"}],    BillingMode="PAY_PER_REQUEST",)# Wait until the table exists.composite_table.meta.client.get_waiter("table_exists").wait(TableName="CompositeTable")# Print out some data about the table.print(composite_table.item_count)my_key = {    "PK": "session_id::0",    "SK":  "langchain_history",}composite_key_history = DynamoDBChatMessageHistory(    table_name="CompositeTable",    session_id="0",    endpoint_url="http://localhost.localstack.cloud:4566",    key=my_key,)composite_key_history.add_user_message("hello, composite dynamodb table!")composite_key_history.messages    0    [HumanMessage(content='hello, composite dynamodb table!', additional_kwargs={}, example=False)]Agent with DynamoDB Memory‚Äãfrom langchain.agents import Toolfrom langchain.memory import ConversationBufferMemoryfrom langchain.chat_models import ChatOpenAIfrom langchain.agents import initialize_agentfrom langchain.agents import AgentTypefrom langchain.utilities import PythonREPLfrom getpass import getpassmessage_history = DynamoDBChatMessageHistory(table_name="SessionTable", session_id="1")memory = ConversationBufferMemory(    memory_key="chat_history", chat_memory=message_history, return_messages=True)python_repl = PythonREPL()# You can create the tool to pass to an agenttools = [
Amazon AWS DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability.
Amazon AWS DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. ->: {self.primary_key_name: self.session_id}Composite Keys‚ÄãWhen using an existing DynamoDB table, you may need to modify the key structure from the default of to something including a Sort Key. To do this you may use the key parameter.Passing a value for key will override the primary_key parameter, and the resulting key structure will be the passed value.from langchain.memory.chat_message_histories import DynamoDBChatMessageHistorycomposite_table = dynamodb.create_table(    TableName="CompositeTable",    KeySchema=[{"AttributeName": "PK", "KeyType": "HASH"}, {"AttributeName": "SK", "KeyType": "RANGE"}],    AttributeDefinitions=[{"AttributeName": "PK", "AttributeType": "S"}, {"AttributeName": "SK", "AttributeType": "S"}],    BillingMode="PAY_PER_REQUEST",)# Wait until the table exists.composite_table.meta.client.get_waiter("table_exists").wait(TableName="CompositeTable")# Print out some data about the table.print(composite_table.item_count)my_key = {    "PK": "session_id::0",    "SK":  "langchain_history",}composite_key_history = DynamoDBChatMessageHistory(    table_name="CompositeTable",    session_id="0",    endpoint_url="http://localhost.localstack.cloud:4566",    key=my_key,)composite_key_history.add_user_message("hello, composite dynamodb table!")composite_key_history.messages    0    [HumanMessage(content='hello, composite dynamodb table!', additional_kwargs={}, example=False)]Agent with DynamoDB Memory‚Äãfrom langchain.agents import Toolfrom langchain.memory import ConversationBufferMemoryfrom langchain.chat_models import ChatOpenAIfrom langchain.agents import initialize_agentfrom langchain.agents import AgentTypefrom langchain.utilities import PythonREPLfrom getpass import getpassmessage_history = DynamoDBChatMessageHistory(table_name="SessionTable", session_id="1")memory = ConversationBufferMemory(    memory_key="chat_history", chat_memory=message_history, return_messages=True)python_repl = PythonREPL()# You can create the tool to pass to an agenttools = [