|
| 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 | +``` |
0 commit comments