add_message(message: langchain.schema.BaseMessage) → None[source]#
Append the message to the record in DynamoDB
clear() → None[source]#
Clear session memory from DynamoDB
property messages: List[langchain.schema.BaseMessage]#
Retrieve the messages from DynamoDB
class langchain.memory.FileChatMessageHistory(file_path: str)[source]#
Chat message history that stores history in a local file.
Parameters
file_path – path of the local file to store the messages.
add_message(message: langchain.schema.BaseMessage) → None[source]#
Append the message to the record in the local file
clear() → None[source]#
Clear session memory from the local file
property messages: List[langchain.schema.BaseMessage]#
Retrieve the messages from the local file
pydantic model langchain.memory.InMemoryEntityStore[source]#
Basic in-memory entity store.
field store: Dict[str, Optional[str]] = {}#
clear() → None[source]#
Delete all entities from store.
delete(key: str) → None[source]#
Delete entity value from store.
exists(key: str) → bool[source]#
Check if entity exists in store.
get(key: str, default: Optional[str] = None) → Optional[str][source]#
Get entity value from store.
set(key: str, value: Optional[str]) → None[source]#
Set entity value in store.
class langchain.memory.MomentoChatMessageHistory(session_id: str, cache_client: momento.CacheClient, cache_name: str, *, key_prefix: str = 'message_store:', ttl: Optional[timedelta] = None, ensure_cache_exists: bool = True)[source]#
Chat message history cache that uses Momento as a backend.
See https://gomomento.com/
rtdocs_stable/api.python.langchain.com/en/stable/reference/modules/memory.html