mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-26 16:43:35 +00:00
docs: Add FalkorDB Chat Message History and Update Package Registry (#28914)
This commit updates the documentation and package registry for the FalkorDB Chat Message History integration. **Changes:** - Added a comprehensive example notebook falkordb_chat_message_history.ipynb demonstrating how to use FalkorDB for session-based chat message storage. - Added a provider notebook for FalkorDB - Updated libs/packages.yml to register FalkorDB as an integration package, following LangChain's new guidelines for community integrations. **Notes:** - This update aligns with LangChain's process for registering new integrations via documentation updates and package registry modifications. - No functional or core package changes were made in this commit. --------- Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
parent
39b35b3606
commit
ba9dfd9252
@ -0,0 +1,73 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# FalkorDB\n",
|
||||||
|
"\n",
|
||||||
|
"<a href='https://docs.falkordb.com/' target='_blank'>FalkorDB</a> is an open-source graph database management system, renowned for its efficient management of highly connected data. Unlike traditional databases that store data in tables, FalkorDB uses a graph structure with nodes, edges, and properties to represent and store data. This design allows for high-performance queries on complex data relationships.\n",
|
||||||
|
"\n",
|
||||||
|
"This notebook goes over how to use `FalkorDB` to store chat message history\n",
|
||||||
|
"\n",
|
||||||
|
"**NOTE**: You can use FalkorDB locally or use FalkorDB Cloud. <a href='https://docs.falkordb.com/' target='blank'>See installation instructions</a>"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 6,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"# For this example notebook we will be using FalkorDB locally\n",
|
||||||
|
"host = \"localhost\"\n",
|
||||||
|
"port = 6379"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 8,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from langchain_falkordb.message_history import (\n",
|
||||||
|
" FalkorDBChatMessageHistory,\n",
|
||||||
|
")\n",
|
||||||
|
"\n",
|
||||||
|
"history = FalkorDBChatMessageHistory(host=host, port=port, session_id=\"session_id_1\")\n",
|
||||||
|
"\n",
|
||||||
|
"history.add_user_message(\"hi!\")\n",
|
||||||
|
"\n",
|
||||||
|
"history.add_ai_message(\"whats up?\")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 9,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": [
|
||||||
|
"[HumanMessage(content='hi!', additional_kwargs={}, response_metadata={}),\n",
|
||||||
|
" AIMessage(content='whats up?', additional_kwargs={}, response_metadata={})]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 9,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"history.messages"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"language_info": {
|
||||||
|
"name": "python"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 2
|
||||||
|
}
|
72
docs/docs/integrations/providers/falkordb.ipynb
Normal file
72
docs/docs/integrations/providers/falkordb.ipynb
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# FalkorDB\n",
|
||||||
|
"\n",
|
||||||
|
">What is `FalkorDB`?\n",
|
||||||
|
"\n",
|
||||||
|
">- FalkorDB is an `open-source database management system` that specializes in graph database technology.\n",
|
||||||
|
">- FalkorDB allows you to represent and store data in nodes and edges, making it ideal for handling connected data and relationships.\n",
|
||||||
|
">- FalkorDB Supports OpenCypher query language with proprietary extensions, making it easy to interact with and query your graph data.\n",
|
||||||
|
">- With FalkorDB, you can achieve high-performance `graph traversals and queries`, suitable for production-level systems.\n",
|
||||||
|
"\n",
|
||||||
|
">Get started with FalkorDB by visiting [their website](https://docs.falkordb.com/)."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Installation and Setup\n",
|
||||||
|
"\n",
|
||||||
|
"- Install the Python SDK with `pip install falkordb langchain-falkordb`"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## VectorStore\n",
|
||||||
|
"\n",
|
||||||
|
"The FalkorDB vector index is used as a vectorstore,\n",
|
||||||
|
"whether for semantic search or example selection.\n",
|
||||||
|
"\n",
|
||||||
|
"```python\n",
|
||||||
|
"from langchain_community.vectorstores.falkordb_vector import FalkorDBVector\n",
|
||||||
|
"```\n",
|
||||||
|
"or \n",
|
||||||
|
"\n",
|
||||||
|
"```python\n",
|
||||||
|
"from langchain_falkordb.vectorstore import FalkorDBVector\n",
|
||||||
|
"```\n",
|
||||||
|
"\n",
|
||||||
|
"See a [usage example](/docs/integrations/vectorstores/falkordbvector.ipynb)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Memory\n",
|
||||||
|
"\n",
|
||||||
|
"See a [usage example](/docs/integrations/memory/falkordb_chat_message_history.ipynb).\n",
|
||||||
|
"\n",
|
||||||
|
"```python\n",
|
||||||
|
"from langchain_falkordb.message_history import (\n",
|
||||||
|
" FalkorDBChatMessageHistory,\n",
|
||||||
|
")\n",
|
||||||
|
"```"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"language_info": {
|
||||||
|
"name": "python"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 2
|
||||||
|
}
|
@ -312,3 +312,8 @@ packages:
|
|||||||
path: .
|
path: .
|
||||||
repo: modelscope/langchain-modelscope
|
repo: modelscope/langchain-modelscope
|
||||||
downloads: 0
|
downloads: 0
|
||||||
|
- name: langchain-falkordb
|
||||||
|
path: .
|
||||||
|
repo: kingtroga/langchain-falkordb
|
||||||
|
downloads: 610
|
||||||
|
downloads_updated_at: '2025-01-02T20:23:02.544257+00:00'
|
||||||
|
Loading…
Reference in New Issue
Block a user