Skip to content

Commit 1f6950d

Browse files
feat: valkey component
1 parent 5bf7371 commit 1f6950d

27 files changed

Lines changed: 3415 additions & 1721 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,7 @@ tmp_toolguard/
296296

297297
#whitesource
298298
whitesource/
299+
300+
301+
#AI
302+
.kiro
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: Valkey
3+
slug: /bundles-valkey
4+
---
5+
6+
import Icon from "@site/src/components/icon";
7+
import PartialParams from '@site/docs/_partial-hidden-params.mdx';
8+
9+
<Icon name="Blocks" aria-hidden="true" /> [**Bundles**](/components-bundle-components) contain custom components that support specific third-party integrations with Langflow.
10+
11+
This page describes the components that are available in the **Valkey** bundle.
12+
13+
[Valkey](https://valkey.io/) is an open source, high-performance key/value datastore forked from Redis.
14+
It supports workloads such as caching, message queues, and can act as a primary database.
15+
Valkey is wire-compatible with Redis, so existing Redis clients and tools work with it out of the box.
16+
17+
### Server requirements
18+
19+
- **Chat Memory** works with any Valkey server (no modules required).
20+
- **Vector Store** requires the [valkey-search](https://github.com/valkey-io/valkey-search) module for `FT.CREATE` and `FT.SEARCH` commands. The standard `valkey/valkey` Docker image does **not** include this module. Use the `valkey/valkey-bundle` image instead, which ships with search enabled by default.
21+
22+
You can run a Valkey server with search support locally using Docker:
23+
24+
```bash
25+
docker run -d --name valkey -p 6379:6379 valkey/valkey-bundle:8.1
26+
```
27+
28+
For chat memory only (no vector store), the standard image is sufficient:
29+
30+
```bash
31+
docker run -d --name valkey -p 6379:6379 valkey/valkey:8
32+
```
33+
34+
## Valkey Chat Memory
35+
36+
The **Valkey Chat Memory** component retrieves and stores chat messages using a Valkey server.
37+
38+
Chat memories are passed between memory storage components as the [`Memory`](/data-types#memory) data type.
39+
40+
For more information about using external chat memory in flows, see the [**Message History** component](/message-history).
41+
42+
:::note
43+
This component uses the `RedisChatMessageHistory` class from `langchain-community` under the hood, since Valkey is wire-compatible with Redis.
44+
The connection URL uses the `redis://` scheme, which works transparently with Valkey servers.
45+
:::
46+
47+
### Valkey Chat Memory parameters
48+
49+
<PartialParams />
50+
51+
| Name | Display Name | Info |
52+
|------|--------------|------|
53+
| host | hostname | Input parameter. The IP address or hostname of the Valkey server. Default: `localhost`. |
54+
| port | port | Input parameter. The Valkey port number. Default: `6379`. |
55+
| database | database | Input parameter. The Valkey database number. Default: `0`. |
56+
| username | Username | Input parameter. The Valkey username (optional). |
57+
| password | Valkey Password | Input parameter. The password for authentication (optional). |
58+
| key_prefix | Key prefix | Input parameter. A prefix for message keys in Valkey (optional). |
59+
| session_id | Session ID | Input parameter. The unique session identifier for the chat messages. |
60+
61+
## Valkey vector store
62+
63+
The **Valkey** vector store component reads and writes to Valkey vector stores using the [`ValkeyVectorStore`](https://docs.langchain.com/oss/python/integrations/vectorstores/valkey) class from `langchain-aws`.
64+
65+
This component uses the `valkey-glide` client library to communicate with the Valkey server and supports the `FT.CREATE` and `FT.SEARCH` commands for vector indexing and similarity search.
66+
67+
<details>
68+
<summary>About vector store instances</summary>
69+
70+
import PartialVectorStoreInstance from '@site/docs/_partial-vector-store-instance.mdx';
71+
72+
<PartialVectorStoreInstance />
73+
74+
</details>
75+
76+
import PartialVectorSearchResults from '@site/docs/_partial-vector-search-results.mdx';
77+
78+
<PartialVectorSearchResults />
79+
80+
:::tip
81+
For a tutorial using a vector database in a flow, see [Create a vector RAG chatbot](/chat-with-rag).
82+
:::
83+
84+
### Valkey vector store parameters
85+
86+
You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it.
87+
88+
<PartialParams />
89+
90+
import PartialConditionalParams from '@site/docs/_partial-conditional-params.mdx';
91+
92+
<PartialConditionalParams />
93+
94+
For information about accepted values and functionality, see the [Valkey documentation](https://valkey.io/docs/) or inspect [component code](/concepts-components#component-code).
95+
96+
| Name | Type | Description |
97+
| ----------------- | ------------ | ----------------------------------------- |
98+
| valkey_server_url | SecretString | Input parameter. The Valkey server connection string (for example, `valkey://localhost:6379`). |
99+
| valkey_index_name | String | Input parameter. The name of the Valkey vector index. Required when no documents are provided. |
100+
| ingest_data | Data | Input parameter. The data to be ingested into the vector store. |
101+
| search_query | String | Input parameter. The query for similarity search. |
102+
| embedding | Embeddings | Input parameter. The embedding function to use. |
103+
| number_of_results | Integer | Input parameter. The number of results to return in search. Default: `4`. |
104+
105+
### Dependencies
106+
107+
The Valkey vector store component requires the `langchain-aws[valkey]` package, which includes:
108+
109+
- `langchain-aws` — provides the `ValkeyVectorStore` class
110+
- `valkey-glide-sync` — the Valkey client library
111+
112+
Install with:
113+
114+
```bash
115+
pip install "langchain-aws[valkey]"
116+
```

pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,22 @@ override-dependencies = [
147147
"pillow>=12.1.1", # Force Pillow 12.1.1+ to prevent CVE-vulnerable versions
148148
"playwright>=1.58.0", # Latest available on PyPI; ensures updated Chromium with CVE fixes
149149
]
150+
# valkey-glide requires protobuf>=6 which conflicts with google-generativeai's
151+
# protobuf<6 constraint. These extras cannot be installed together.
152+
conflicts = [
153+
[
154+
{ package = "langflow-base", extra = "valkey" },
155+
{ package = "langflow-base", extra = "google" },
156+
],
157+
[
158+
{ package = "langflow-base", extra = "valkey" },
159+
{ package = "langflow-base", extra = "complete" },
160+
],
161+
[
162+
{ package = "langflow-base", extra = "valkey" },
163+
{ package = "langflow-base", extra = "all" },
164+
],
165+
]
150166

151167
[project.scripts]
152168
langflow = "langflow.langflow_launcher:main"

src/backend/base/langflow/core/celeryconfig.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# celeryconfig.py
22
import os
33

4+
langflow_valkey_host = os.environ.get("LANGFLOW_VALKEY_HOST")
5+
langflow_valkey_port = os.environ.get("LANGFLOW_VALKEY_PORT")
46
langflow_redis_host = os.environ.get("LANGFLOW_REDIS_HOST")
57
langflow_redis_port = os.environ.get("LANGFLOW_REDIS_PORT")
68
# broker default user
79

8-
if langflow_redis_host and langflow_redis_port:
10+
if langflow_valkey_host and langflow_valkey_port:
11+
# Valkey is wire-compatible with Redis; use redis:// scheme because
12+
# Celery/kombu does not register a valkey:// transport.
13+
broker_url = f"redis://{langflow_valkey_host}:{langflow_valkey_port}/0"
14+
result_backend = f"redis://{langflow_valkey_host}:{langflow_valkey_port}/0"
15+
elif langflow_redis_host and langflow_redis_port:
916
broker_url = f"redis://{langflow_redis_host}:{langflow_redis_port}/0"
1017
result_backend = f"redis://{langflow_redis_host}:{langflow_redis_port}/0"
1118
else:

src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@
18011801
},
18021802
{
18031803
"name": "boto3",
1804-
"version": "1.40.61"
1804+
"version": "1.42.95"
18051805
},
18061806
{
18071807
"name": "googleapiclient",

src/backend/base/langflow/initial_setup/starter_projects/Search agent.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
},
116116
{
117117
"name": "scrapegraph_py",
118-
"version": "2.1.0"
118+
"version": "1.47.0"
119119
}
120120
],
121121
"total_dependencies": 2

src/backend/base/langflow/locales/en.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6216,6 +6216,38 @@
62166216
"components.urlcomponent.inputs.use_async.info.5d52d50c": "If enabled, uses asynchronous loading which can be significantly faster but might use more system resources.",
62176217
"components.urlcomponent.outputs.page_results.display_name.02d3e1ea": "Extracted Pages",
62186218
"components.urlcomponent.outputs.raw_results.display_name.960c8537": "Raw Content",
6219+
"components.valkey.description.b20bd825": "Implementation of Vector Store using Valkey",
6220+
"components.valkey.display_name.2392ad6b": "Valkey",
6221+
"components.valkey.inputs.embedding.display_name.4c1a0852": "Embedding",
6222+
"components.valkey.inputs.ingest_data.display_name.b8c4a377": "Ingest Data",
6223+
"components.valkey.inputs.number_of_results.display_name.e8f2e1bb": "Number of Results",
6224+
"components.valkey.inputs.number_of_results.info.5232e01a": "Number of results to return.",
6225+
"components.valkey.inputs.search_query.display_name.3ad6e0f4": "Search Query",
6226+
"components.valkey.inputs.search_query.info.d9f2d336": "Enter a query to run a similarity search.",
6227+
"components.valkey.inputs.search_query.placeholder.2a5ab7eb": "Enter a query...",
6228+
"components.valkey.inputs.should_cache_vector_store.display_name.2291db58": "Cache Vector Store",
6229+
"components.valkey.inputs.should_cache_vector_store.info.371ea81a": "If True, the vector store will be cached for the current build of the component. This is useful for components that have multiple output methods and want to share the same vector store.",
6230+
"components.valkey.inputs.valkey_index_name.display_name.e9f53690": "Valkey Index",
6231+
"components.valkey.inputs.valkey_server_url.display_name.08153eab": "Valkey Server Connection String",
6232+
"components.valkey.outputs.dataframe.display_name.16d1c905": "Table",
6233+
"components.valkey.outputs.search_results.display_name.39414102": "Search Results",
6234+
"components.valkeychatmemory.description.561f6f53": "Retrieves and stores chat messages from Valkey.",
6235+
"components.valkeychatmemory.display_name.ecf133e7": "Valkey Chat Memory",
6236+
"components.valkeychatmemory.inputs.database.display_name.3549b002": "database",
6237+
"components.valkeychatmemory.inputs.database.info.83c1cbb2": "Valkey database.",
6238+
"components.valkeychatmemory.inputs.host.display_name.7063dece": "hostname",
6239+
"components.valkeychatmemory.inputs.host.info.e9e5c338": "IP address or hostname.",
6240+
"components.valkeychatmemory.inputs.key_prefix.display_name.ac467d48": "Key prefix",
6241+
"components.valkeychatmemory.inputs.key_prefix.info.0d48bfe7": "Key prefix.",
6242+
"components.valkeychatmemory.inputs.password.display_name.7ca8e190": "Valkey Password",
6243+
"components.valkeychatmemory.inputs.password.info.11256ab8": "The password for username.",
6244+
"components.valkeychatmemory.inputs.port.display_name.f8d397a3": "port",
6245+
"components.valkeychatmemory.inputs.port.info.b8b389d9": "Valkey Port Number.",
6246+
"components.valkeychatmemory.inputs.session_id.display_name.cb9ac5c5": "Session ID",
6247+
"components.valkeychatmemory.inputs.session_id.info.997ef643": "Session ID for the message.",
6248+
"components.valkeychatmemory.inputs.username.display_name.e3b89e9d": "Username",
6249+
"components.valkeychatmemory.inputs.username.info.024d2d8f": "The Valkey user name.",
6250+
"components.valkeychatmemory.outputs.memory.display_name.c3963aed": "Memory",
62196251
"components.vectara.description.7cbc0e3e": "Vectara Vector Store with search capabilities",
62206252
"components.vectara.display_name.80b2c20a": "Vectara",
62216253
"components.vectara.inputs.embedding.display_name.4c1a0852": "Embedding",

src/backend/base/pyproject.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ dev = [
130130
]
131131

132132

133+
[tool.hatch.metadata]
134+
allow-direct-references = true
135+
133136
[tool.hatch.build.targets.wheel]
134137
packages = ["langflow"]
135138

@@ -201,6 +204,9 @@ chroma = [
201204
upstash = ["upstash-vector==0.6.0"]
202205
pinecone = ["langchain-pinecone~=0.2.13"]
203206
milvus = ["langchain-milvus~=0.3.2"]
207+
valkey = [
208+
"langchain-aws[valkey]>=1.4.0,<2.0.0",
209+
]
204210
mongodb-vectors = ["langchain-mongodb==0.7.0"]
205211
astradb = ["langchain-astradb~=1.0.0"]
206212

@@ -266,7 +272,7 @@ huggingface = ["huggingface-hub[inference]>=1.0.0,<2.0.0"]
266272
metaphor = ["metaphor-python==0.1.23"]
267273
metal = ["metal_sdk==2.5.1"]
268274
markup = ["MarkupSafe==3.0.2"]
269-
aws = ["boto3>=1.34.162,<2.0.0", "langchain-aws~=1.1.0"]
275+
aws = ["boto3>=1.34.162,<2.0.0", "langchain-aws>=1.1.0,<2.0.0"]
270276
numexpr = ["numexpr==2.10.2"]
271277
qianfan = ["qianfan==0.3.5"]
272278
pgvector = ["pgvector>=0.4.2"]
@@ -346,7 +352,8 @@ mlx = [
346352
fastmcp = ["fastmcp>=3.2.0"]
347353

348354
# AWS extras
349-
aioboto3 = ["aioboto3>=15.2.0,<16.0.0"]
355+
# aioboto3 extra removed: all available versions pin boto3<1.40.62 via aiobotocore,
356+
# which conflicts with langchain-aws>=1.4.0 requiring boto3>=1.42.42
350357

351358
# Astra
352359
astrapy = ["astrapy>=2.1.0,<3.0.0"]
@@ -368,6 +375,7 @@ complete = [
368375
"langflow-base[mongodb]",
369376
"langflow-base[supabase]",
370377
"langflow-base[redis]",
378+
"langflow-base[valkey]",
371379
"langflow-base[elasticsearch]",
372380
"langflow-base[faiss]",
373381
"langflow-base[qdrant]",
@@ -467,7 +475,7 @@ complete = [
467475
# MCP
468476
"langflow-base[fastmcp]",
469477
# AWS extras
470-
"langflow-base[aioboto3]",
478+
# "langflow-base[aioboto3]", # excluded: aioboto3 pins boto3<1.40.62, conflicts with langchain-aws>=1.4.0
471479
# Astra
472480
"langflow-base[astrapy]",
473481
# Windows-specific

0 commit comments

Comments
 (0)