Create a LangCache service

Redis Cloud

Redis LangCache provides vector search capabilities and efficient caching for AI-powered applications. This guide walks you through creating and configuring a LangCache service in Redis Cloud.

Prerequisites

To create a LangCache service, you will need:

Create a LangCache service

From the Redis Cloud console, select LangCache from the left-hand menu.

When you access the LangCache page for the first time, you will see a page with an introduction to LangCache. Select Let's create a service to create your first service.

The Let's create a service button.

If you have already created a LangCache service, select New service to create another one.

The New service button.

This takes you to the Create LangCache service page. The page is divided into the following sections:

  1. The General settings section defines basic properties of your service.
  2. The Embedding settings section defines the embedding model used by your service.
  3. The Attributes settings section allows you to define attributes for your service.

General settings

The General settings section defines basic properties of your service.

The General settings section.
Setting name Description
Service name Enter a name for your LangCache service. We recommend you use a name that describes your service's purpose.
Select database Select the Redis Cloud database to use for this service from the list.
TTL The time to live (TTL) for cache entries, in milliseconds. Default: No expiration - items in the cache will remain until manually removed.
User The database access user to use for this service. LangCache only supports the default user during public preview.

Embedding settings

The Embedding settings section defines the embedding model used by your service.

The Embedding settings section.
Setting name Description
Supported Embedding Provider The embedding provider to use for your service. LangCache only supports OpenAI during public preview.
Embedding provider API key Enter your embedding provider's API key.
Model Select the embedding model to use for your service.
Similarity threshold Set the minimum similarity score required to consider a cached response a match. Range: 0.5 to 1.0. Default: 0.9

A higher value means more precise matches, but if it's too high, you will compromise on the number of matches and may lose relevant matches. A lower value means more matches, but may include less relevant matches. We recommend starting between 0.8 and 0.9 and then fine-tuning based on your results.

Attributes settings

Attributes provide powerful scoping capabilities for your LangCache operations. Think of them as tags or labels that help you organize and manage your cached data with precision.

The Attributes settings section allows you to define attributes for your service. It is collapsed by default.

The Attributes settings section, expanded.

LangCache allows you to define up to 5 custom attributes that align with your specific use case. To add a new attribute:

  1. Select Add attribute.

    The Add attribute button.
  2. Give your custom attribute a descriptive name and select the check mark button to save it.

    The custom attributes section. Select the Confirm add attribute button to save your attribute.

After you save your custom attribute, it will appear in the list of custom attributes. Use the Delete button to remove it.

Select the Delete button to delete the selected attribute.

You can also select Add attribute again to add an additional attribute.

The Add attribute button.

Create service

When you are done setting the details of your LangCache service, select Create to create it.

Use the Create button to create a LangCache service.

A window containing your LangCache service key will appear. Select Copy to copy the key to your clipboard.

The LangCache service key window. Use the Copy button to save the service key to the clipboard.
Warning:

This is the only time the value of the user key is available. Save it to a secure location before closing the dialog box.

If you lose the service key value, you will need to replace the service key to be able to use the LangCache API.

You'll be taken to your LangCache service's Configuration page. You'll also be able to see your LangCache service in the LangCache service list.

The LangCache service in the LangCache service list.

If an error occurs, verify that:

  • Your database is active.
  • You have provided a valid OpenAI API key.
  • You have provided valid values for all the required fields.

For help, contact support.

Next steps

After your cache is created, you can use the LangCache API from your client app.

You can also view and edit the cache and monitor the cache's performance.

RATE THIS PAGE
Back to top ↑