langchain.memory.chat_message_histories.neo4j.Neo4jChatMessageHistory

class langchain.memory.chat_message_histories.neo4j.Neo4jChatMessageHistory(session_id: Union[str, int], url: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None, database: str = 'neo4j', node_label: str = 'Session', window: int = 3)[source]

Chat message history stored in a Neo4j database.

Attributes

messages

Retrieve the messages from Neo4j

Methods

__init__(session_id[, url, username, ...])

add_ai_message(message)

Convenience method for adding an AI message string to the store.

add_message(message)

Append the message to the record in Neo4j

add_user_message(message)

Convenience method for adding a human message string to the store.

clear()

Clear session memory from Neo4j

__init__(session_id: Union[str, int], url: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None, database: str = 'neo4j', node_label: str = 'Session', window: int = 3)[source]
add_ai_message(message: str) None

Convenience method for adding an AI message string to the store.

Parameters

message – The string contents of an AI message.

add_message(message: BaseMessage) None[source]

Append the message to the record in Neo4j

add_user_message(message: str) None

Convenience method for adding a human message string to the store.

Parameters

message – The string contents of a human message.

clear() None[source]

Clear session memory from Neo4j