Skip to content

Redis

Redis stores documents in an index on your Redis server and searches it by meaning.

A vector database stores texts so they can be searched by meaning, not just by exact words. That way an agent can find the paragraph of a manual that answers a question even if it uses different words.

When to use it

  • Your company already uses Redis and you want to use it for search by meaning.
  • You need fast searches over a set of documents that changes often.

Configuration

The Operation field decides what the component does, and the fields and outputs change with your choice:

  • Add (default): stores in the database the documents it receives in Ingest Data.
  • Search: finds the documents closest to the text in Search Query.
  • Retriever: offers the database as a search engine for another component to use, for example an agent or a question-answering chain.

You need a Redis API credential with your Redis server connection address. See Credentials.

FieldWhat it does
Credential (required)The Redis API credential with the connection details.
OperationWhat the component does: Add, Search or Retriever.
Ingest Data (required)With Add. The documents to store, usually those coming out of a text splitter or a file loader.
Search QueryWith Search. The text to search for. If left empty, nothing is returned.
EmbeddingThe connector where you plug the component that turns texts into numbers to compare them by meaning, such as OpenAI Embeddings. Always use the same one to store and to search.
Redis IndexThe name of the index.
SchemaOptional. The index schema, so searches also return each document’s data fields. Empty, the index is still searched and each result carries its text and id.

Advanced options

FieldWhat it does
Number Of ResultsHow many documents each search returns. Default: 4.

Output

The outputs depend on Operation:

  • Results: with Add and Search. With Search, the list of documents found, which you can pass to a prompt or an agent.
  • Vector Store: with Add. The database, to connect it to components that work with a vector database.
  • Retriever: with Retriever. The search engine, to connect it to components that ask for one.

In tool mode, an agent can use the component to search by itself. See Tool Mode.

Example

An online shop keeps its product sheets in Redis.

  1. Connect the sheets to Ingest Data of Redis with Operation set to Add and the index name.
  2. Connect an embeddings component and run the flow.
  3. To search, use Operation set to Search with the same index.