FalkorDB
FalkorDB 是一個開源圖形資料庫管理系統,以其高效管理高度關聯資料而聞名。與將資料儲存在表格中的傳統資料庫不同,FalkorDB 使用包含節點、邊緣和屬性的圖形結構來表示和儲存資料。這種設計允許對複雜資料關係進行高效能查詢。
本筆記本說明如何使用 FalkorDB
儲存聊天訊息歷史記錄
注意:您可以在本地使用 FalkorDB 或使用 FalkorDB Cloud。請參閱安裝說明
# For this example notebook we will be using FalkorDB locally
host = "localhost"
port = 6379
from langchain_falkordb.message_history import (
FalkorDBChatMessageHistory,
)
history = FalkorDBChatMessageHistory(host=host, port=port, session_id="session_id_1")
history.add_user_message("hi!")
history.add_ai_message("whats up?")
history.messages
[HumanMessage(content='hi!', additional_kwargs={}, response_metadata={}),
AIMessage(content='whats up?', additional_kwargs={}, response_metadata={})]