Skip to content

Commit ba9dfd9

Browse files
kingtrogaccurme
andauthored
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 <[email protected]>
1 parent 39b35b3 commit ba9dfd9

File tree

3 files changed

+151
-1
lines changed

3 files changed

+151
-1
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# FalkorDB\n",
8+
"\n",
9+
"<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",
10+
"\n",
11+
"This notebook goes over how to use `FalkorDB` to store chat message history\n",
12+
"\n",
13+
"**NOTE**: You can use FalkorDB locally or use FalkorDB Cloud. <a href='https://docs.falkordb.com/' target='blank'>See installation instructions</a>"
14+
]
15+
},
16+
{
17+
"cell_type": "code",
18+
"execution_count": 6,
19+
"metadata": {},
20+
"outputs": [],
21+
"source": [
22+
"# For this example notebook we will be using FalkorDB locally\n",
23+
"host = \"localhost\"\n",
24+
"port = 6379"
25+
]
26+
},
27+
{
28+
"cell_type": "code",
29+
"execution_count": 8,
30+
"metadata": {},
31+
"outputs": [],
32+
"source": [
33+
"from langchain_falkordb.message_history import (\n",
34+
" FalkorDBChatMessageHistory,\n",
35+
")\n",
36+
"\n",
37+
"history = FalkorDBChatMessageHistory(host=host, port=port, session_id=\"session_id_1\")\n",
38+
"\n",
39+
"history.add_user_message(\"hi!\")\n",
40+
"\n",
41+
"history.add_ai_message(\"whats up?\")"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 9,
47+
"metadata": {},
48+
"outputs": [
49+
{
50+
"data": {
51+
"text/plain": [
52+
"[HumanMessage(content='hi!', additional_kwargs={}, response_metadata={}),\n",
53+
" AIMessage(content='whats up?', additional_kwargs={}, response_metadata={})]"
54+
]
55+
},
56+
"execution_count": 9,
57+
"metadata": {},
58+
"output_type": "execute_result"
59+
}
60+
],
61+
"source": [
62+
"history.messages"
63+
]
64+
}
65+
],
66+
"metadata": {
67+
"language_info": {
68+
"name": "python"
69+
}
70+
},
71+
"nbformat": 4,
72+
"nbformat_minor": 2
73+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# FalkorDB\n",
8+
"\n",
9+
">What is `FalkorDB`?\n",
10+
"\n",
11+
">- FalkorDB is an `open-source database management system` that specializes in graph database technology.\n",
12+
">- FalkorDB allows you to represent and store data in nodes and edges, making it ideal for handling connected data and relationships.\n",
13+
">- FalkorDB Supports OpenCypher query language with proprietary extensions, making it easy to interact with and query your graph data.\n",
14+
">- With FalkorDB, you can achieve high-performance `graph traversals and queries`, suitable for production-level systems.\n",
15+
"\n",
16+
">Get started with FalkorDB by visiting [their website](https://docs.falkordb.com/)."
17+
]
18+
},
19+
{
20+
"cell_type": "markdown",
21+
"metadata": {},
22+
"source": [
23+
"## Installation and Setup\n",
24+
"\n",
25+
"- Install the Python SDK with `pip install falkordb langchain-falkordb`"
26+
]
27+
},
28+
{
29+
"cell_type": "markdown",
30+
"metadata": {},
31+
"source": [
32+
"## VectorStore\n",
33+
"\n",
34+
"The FalkorDB vector index is used as a vectorstore,\n",
35+
"whether for semantic search or example selection.\n",
36+
"\n",
37+
"```python\n",
38+
"from langchain_community.vectorstores.falkordb_vector import FalkorDBVector\n",
39+
"```\n",
40+
"or \n",
41+
"\n",
42+
"```python\n",
43+
"from langchain_falkordb.vectorstore import FalkorDBVector\n",
44+
"```\n",
45+
"\n",
46+
"See a [usage example](/docs/integrations/vectorstores/falkordbvector.ipynb)"
47+
]
48+
},
49+
{
50+
"cell_type": "markdown",
51+
"metadata": {},
52+
"source": [
53+
"## Memory\n",
54+
"\n",
55+
"See a [usage example](/docs/integrations/memory/falkordb_chat_message_history.ipynb).\n",
56+
"\n",
57+
"```python\n",
58+
"from langchain_falkordb.message_history import (\n",
59+
" FalkorDBChatMessageHistory,\n",
60+
")\n",
61+
"```"
62+
]
63+
}
64+
],
65+
"metadata": {
66+
"language_info": {
67+
"name": "python"
68+
}
69+
},
70+
"nbformat": 4,
71+
"nbformat_minor": 2
72+
}

libs/packages.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,4 +311,9 @@ packages:
311311
- name: langchain-modelscope
312312
path: .
313313
repo: modelscope/langchain-modelscope
314-
downloads: 0
314+
downloads: 0
315+
- name: langchain-falkordb
316+
path: .
317+
repo: kingtroga/langchain-falkordb
318+
downloads: 610
319+
downloads_updated_at: '2025-01-02T20:23:02.544257+00:00'

0 commit comments

Comments
 (0)