.rst
.pdf
Memory
Memory#
class langchain.memory.CassandraChatMessageHistory(contact_points: List[str], session_id: str, port: int = 9042, username: str = 'cassandra', password: str = 'cassandra', keyspace_name: str = 'chat_history', table_name: str = 'message_store')[source]#
Chat message history that stores history in Cassandra.
Parameters
contact_points – list of ips to connect to Cassandra cluster
session_id – arbitrary key that is used to store the messages
of a single chat session.
port – port to connect to Cassandra cluster
username – username to connect to Cassandra cluster
password – password to connect to Cassandra cluster
keyspace_name – name of the keyspace to use
table_name – name of the table to use
add_message(message: langchain.schema.BaseMessage) → None[source]#
Append the message to the record in Cassandra
clear() → None[source]#
Clear session memory from Cassandra
property messages: List[langchain.schema.BaseMessage]#
Retrieve the messages from Cassandra
pydantic model langchain.memory.ChatMessageHistory[source]#
field messages: List[langchain.schema.BaseMessage] = []#
add_message(message: langchain.schema.BaseMessage) → None[source]#
Add a self-created message to the store
clear() → None[source]#
Remove all messages from the store
pydantic model langchain.memory.CombinedMemory[source]#
Class for combining multiple memories’ data together.
Validators
check_input_key » memories
check_repeated_memory_variable » memories
field memories: List[langchain.schema.BaseMemory] [Required]#
For tracking all the memories that should be accessed.
clear() → None[source]#
Clear context from this session for every memory.
rtdocs_stable/api.python.langchain.com/en/stable/reference/modules/memory.html