title: Redis video tutorial collection

summary: Watch video tutorials and demos showcasing Redis in AI applications, from vector search to RAG implementations.

title: Overview

text:
Explore our collection of video tutorials and demonstrations showcasing how Redis powers AI applications. From vector search fundamentals to advanced RAG implementations, these videos provide practical insights and hands-on examples.

| | | |
|---|---|---|
| [**Long-Term Memory with LangGraph**](https://www.youtube.com/watch?v=fsENEq4F55Q) | [**Short-Term Memory with LangGraph**](https://www.youtube.com/watch?v=k3FUWWEwgfc) | [**What is semantic search?**](https://www.youtube.com/watch?v=o3XN4dImESE) |
| Learn how to implement long-term memory capabilities in AI agents using LangGraph. This video shows you how to build AI systems that can retain and recall information across extended interactions. | Want your AI agents to remember what users tell them? Short-term memory is the key to natural conversations, and in this tutorial, you'll learn how to implement it with LangGraph. | Traditional search matches words — but what if your AI app could match meaning instead? This video explains how semantic search works and why it's essential for modern AI applications. |
| [**What is a semantic cache?**](https://www.youtube.com/watch?v=AtVTT_s8AGc) | [**Building a RAG Pipeline from Scratch with RedisVL**](https://www.youtube.com/watch?v=cCTKmmGO4CY) | [**What is a vector database?**](https://www.youtube.com/watch?v=Yhv19le0sBw) |
| What if you could skip redundant LLM calls and make your AI app faster, cheaper, and smarter? This video breaks down semantic caching and shows how it can transform your AI applications. | Unlock the Power of Retrieval-Augmented Generation (RAG) with RedisVL. This tutorial will show you how to build a complete RAG pipeline from scratch using Redis as your vector database. | Vector databases have been trending recently as they power modern search, recommendations, and AI-driven applications. Learn what vector databases are and how they work. |
| [**Building the future Architecting AI Agents with AWS, LlamaIndex and Redis**](https://www.youtube.com/watch?v=SFWroqAbBM4) | [**Building AI Apps using LangChain**](https://www.youtube.com/watch?v=YhxksXfgsp0) | [**Resources to Learn AI with Redis**](https://www.youtube.com/watch?v=M_WU_fN_lrs) |
| The ins and outs of AI agents: understand their role in breaking down tasks into manageable components for better performance. Learn how to architect AI agents using AWS, LlamaIndex, and Redis. | This series of videos dives into the integration between LangChain and Redis to power AI applications that need runtime speed, scalability, and intelligent data management. | This video shows which resources you can use to learn AI with Redis and build powerful AI applications. |
| [**What Is RAG? Retrieval-Augmented Generation Explained Simply**](https://www.youtube.com/watch?v=xPMQ2cVbUTI) | [**Chunking Strategies Explained**](https://www.youtube.com/watch?v=ZTOtxiWb2bE) | [**What is an embedding model?**](https://www.youtube.com/watch?v=0U1S0WSsPuE) |
| Retrieval-Augmented Generation (RAG) is one of the most powerful architectural patterns in GenAI today—combining the strengths of large language models (LLMs) with real-time, external context from your own data. In this session, learn why it matters and how each component—from query rewriting to dense retrieval to semantic chunking—works behind the scenes to power more accurate, grounded, and up-to-date responses. | Are you interested in building LLM applications that actually work? Your chunking strategy makes all the difference. In this video, get a  break down of the science of text chunking so your embeddings can start answering the right questions to your users. | Everyone’s talking about embedding models lately—but what do they actually do, and why does it matter? This video breaks it down in simple terms and shows how embeddings power search, recommendations, and AI features behind the scenes. |

title: Additional Resources

text:
| | | |
|---|---|---|
| [**LLM Session Management with Redis**](https://www.youtube.com/watch?v=2jHtSLVUu0w) | [**A Semantic Cache using LangChain**](https://www.youtube.com/watch?v=LRswXEc5chE) | [**Similarity Search using Vector Store**](https://www.youtube.com/watch?v=BtFJdSiFh00) |
| Developers building AI applications require a way to store the conversation history between an LLM and a user. This is important to provide context and maintain coherent conversations across sessions. | One common concern of developers building AI applications is how quickly answers from LLMs will be served to their end users, as well as how much it will cost. Learn how to implement semantic caching using LangChain and Redis. | Similarity search is one of the most popular use cases for developers building AI applications. It allows users to perform searches that can find semantically similar content using vector embeddings. |
| [**Create a New Database on Redis Cloud**](https://www.youtube.com/watch?v=jF89DiC5RqM) | [**Redis Insight: A Developer's Deep Dive**](https://www.youtube.com/watch?v=dINUz_XOZ0M) | [**Redis + Amazon SageMaker for real-time fraud detection demo**](https://www.youtube.com/watch?v=kQKfXi7NfWs) |
| Learn how to create a new database on Redis Cloud in this step-by-step tutorial. Perfect for developers getting started with Redis Cloud for their AI and data applications. | This video breaks down Redis Insight and shows developers how to use this powerful tool for database management and development. | See how Redis integrates with Amazon SageMaker to build real-time fraud detection systems. This demo shows practical applications of Redis in machine learning and AI-powered fraud prevention. |
| [**Redis + Amazon Bedrock in two minutes**](https://www.youtube.com/watch?v=1e2tM5kIJ5Y) | | |
| AWS has announced Redis Cloud as one of the few supported vector databases supported for Amazon Bedrock. Learn how to integrate Redis with Amazon Bedrock for your generative AI applications. | | |

title: Getting Started

role: setup

text:
Ready to start building AI applications with Redis? Check out our:

- [Quickstart guides]()
- [Vector search documentation]()
- [AI ecosystem integrations]()
- [Notebook collection]()
- [Vector set data type]()


title: Redis AI ecosystem integrations

summary: Explore key integrations between Redis and popular AI frameworks, platforms, and tools.

page_type: content

title: Overview

role: overview

text:
Redis integrates with a wide range of AI frameworks, platforms, and tools to enhance your AI applications. This page highlights key ecosystem integrations that can help you build more powerful, efficient, and scalable AI solutions with Redis.

| | | |
|---|---|---|
| [**Kong AI Gateway & Redis**](https://redis.io/blog/kong-ai-gateway-and-redis/) | [**Unstructured & Redis**](https://redis.io/blog/faster-ai-workflows-with-unstructured-redis/) | [**Mem0 & Redis**](https://redis.io/blog/smarter-memory-management-for-ai-agents-with-mem0-and-redis/) |
| Combine Kong's AI Gateway with Redis for efficient AI request routing, caching, and rate limiting to optimize your AI infrastructure. | Accelerate AI workflows by using Redis to cache document processing results from Unstructured, reducing processing time and costs. | Implement smarter memory management for AI agents with Mem0's integration with Redis, providing persistent, queryable memory for LLMs. |
| [**LiteLLM & Redis**](https://docs.litellm.ai/docs/caching/all_caches#initialize-cache---in-memory-redis-s3-bucket-redis-semantic-disk-cache-qdrant-semantic) | [**LangGraph & Redis**](https://redis.io/blog/langgraph-redis-build-smarter-ai-agents-with-memory-persistence/) | [**LangChain & Redis**](https://redis.io/blog/langchain-redis-partner-package/) |
| Optimize LLM performance with LiteLLM's Redis caching capabilities, supporting both traditional and semantic caching to reduce costs and latency. | Build smarter AI agents with LangGraph's Redis integration for memory persistence, state management, and multi-agent coordination. | Leverage LangChain's Redis integration for vector storage, memory, and caching to create more capable AI applications with improved performance. |
| [**LlamaIndex & Redis**](https://docs.llamaindex.ai/en/stable/examples/vector_stores/RedisIndexDemo/) | [**Amazon Bedrock & Redis**]() | [**NVIDIA NIM & Redis**](https://redis.io/blog/use-redis-with-nvidia-nim-to-deploy-genai-apps-faster/) |
| Use LlamaIndex with Redis as a vector store for efficient document indexing, retrieval, and querying in RAG applications. | Integrate Redis with Amazon Bedrock to enhance your generative AI applications with persistent memory and efficient vector search. | Deploy GenAI applications faster by combining NVIDIA NIM's inference optimization with Redis for vector search, caching, and data management. |

title: Additional integrations

role: content

text:
- [**Microsoft Semantic Kernel**](https://learn.microsoft.com/en-us/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/redis-connector?pivots=programming-language-csharp): Use Redis as a vector store connector with Microsoft's Semantic Kernel framework.
- [**DocArray**](https://docs.docarray.org/user_guide/storing/index_redis/): Leverage Redis as a document store and vector database with Jina AI's DocArray.
- [**Redis Cloud on Vercel**](https://redis.io/blog/redis-cloud-now-available-on-vercel-marketplace/): Deploy and manage Redis databases directly from your Vercel dashboard with the Redis Cloud integration. Refer to the [setup guide]() for more details.
- [**Spring AI & Redis**](https://redis.io/blog/building-a-rag-application-with-redis-and-spring-ai/): Build powerful RAG applications by combining Spring AI's framework with Redis for vector storage and retrieval.
- [**Kernel Memory & Redis**](https://redis.io/blog/building-llm-applications-with-kernel-memory-and-redis/): Create memory-enabled LLM applications using Microsoft's Kernel Memory with Redis for efficient storage and retrieval.

title: Getting started

text:
To learn more about using Redis with AI frameworks and tools, check out our:

* [AI notebooks collection]() - Interactive code examples and tutorials
* [AI video collection]() - Video tutorials and demonstrations
* [RAG quickstart guide]() - Get started with Retrieval-Augmented Generation


title: Datasets and transformations in Featureform

summary: Register datasets and define SQL or DataFrame transformations for Featureform features.

title: Overview

text:
Datasets and transformations are the bridge between your raw source data and your feature definitions.

- datasets point Featureform at existing tables or files
- transformations create reusable feature engineering logic on top of those datasets

title: Register datasets

text: Register the source objects that Featureform should treat as named inputs.

title: Warehouse tables

text:
[code example]

For Snowflake providers, the provider-level `database`, `schema`, and `catalog` configuration determines where Featureform resolves the table unless you override those values during registration.

title: Delta tables

text:
[code example]

Use `catalog.schema` in the `database` parameter when you are working with Unity Catalog.

title: Apache Iceberg tables

text:
If your provider is configured with an Iceberg-compatible catalog, register the table against that provider and then use it like any other dataset:

[code example]

You can then reference the Iceberg-backed dataset in transformations:

[code example]

title: File-based datasets

text:
[code example]

Spark providers also support JSON-backed primary sources:

[code example]

Flatten JSON-backed sources in a transformation before you use them for features or labels.

Choose dataset types that match your source-of-truth platform. The goal is to create stable named inputs that other definitions can depend on.

title: SQL transformations

text:
Use SQL transformations when your provider is SQL-native and the logic is easiest to express in SQL:

[code example]

For Snowflake providers configured with an Iceberg catalog, you can also create dynamic-table-backed transformations:

[code example]

title: DataFrame transformations

text:
Use DataFrame transformations when you need programmatic control or Spark-native operations:

[code example]

title: Chaining transformations

text:
You can build transformations on top of other transformations. This keeps feature engineering logic modular and easier to review:

[code example]

title: Accessing transformation data

text:
For development and validation, Featureform can retrieve the output of registered datasets or transformations as data frames:

[code example]

Use this sparingly in production workflows. Its main value is validation and iteration.

title: Apply registrations

text:
Once datasets and transformations are defined, register them with Featureform:

[code example]

This step records the metadata and dependency graph so later resources, such as features and training sets, can reference them.

title: Best practices

text:
- Register stable business-level datasets, not every transient table.
- Keep transformation names descriptive and reusable.
- Push provider-specific parsing, casting, and joins into transformations before defining features.
- Include timestamps where temporal correctness matters later in training or serving.

title: What to read next

text:
- [Define features and labels]()
- [Work with training sets and feature views]()

code:
transactions = snowflake.register_table(
    name="transactions",
    table="TRANSACTIONS",
    description="Raw transaction table",
)

section_id: warehouse-tables

code:
transactions = spark.register_delta_table(
    name="transactions",
    database="my_catalog.my_schema",
    table="transactions",
)

section_id: delta-tables

code:
orders = snowflake.register_table(
    name="orders_iceberg",
    table="ORDERS_ICEBERG",
    description="Apache Iceberg table registered through the configured catalog",
)

section_id: apache-iceberg-tables

code:
@snowflake.sql_transformation(inputs=[orders])
def recent_orders(orders):
    return """
    SELECT
        order_id,
        customer_id,
        order_total,
        order_timestamp
    FROM {{ orders }}
    WHERE order_timestamp >= DATEADD(day, -30, CURRENT_TIMESTAMP())
    """

code:
events = spark.register_file(
    name="events",
    file_path="s3://my-bucket/events/transactions.parquet",
    description="Event data stored in parquet",
)

section_id: file-based-datasets

code:
events = spark.register_json(
    name="raw_events",
    file_path="s3://my-bucket/events.jsonl",
)

code:
@snowflake.sql_transformation(inputs=[transactions])
def user_spend(transactions):
    return """
        SELECT
            user_id,
            AVG(amount) AS avg_transaction_amount,
            MAX(timestamp) AS latest_transaction
        FROM {{ transactions }}
        GROUP BY user_id
    """

section_id: sql-transformations

code:
from featureform import SnowflakeDynamicTableConfig, RefreshMode, Initialize

@snowflake.sql_transformation(
    inputs=[transactions],
    resource_snowflake_config=SnowflakeDynamicTableConfig(
        refresh_mode=RefreshMode.INCREMENTAL,
        initialize=Initialize.ON_CREATE,
        target_lag="30 minutes",
    )
)
def incremental_user_features(transactions):
    return """
    SELECT
        user_id,
        AVG(amount) AS avg_amount,
        COUNT(*) AS tx_count,
        MAX(timestamp) AS last_tx
    FROM {{ transactions }}
    GROUP BY user_id
    """

code:
@spark.df_transformation(inputs=[transactions])
def user_transaction_features(transactions_df):
    from pyspark.sql import functions as F

    return transactions_df.groupBy("user_id").agg(
        F.avg("amount").alias("avg_transaction_amount"),
        F.count("*").alias("transaction_count"),
        F.max("timestamp").alias("latest_transaction"),
    )

section_id: dataframe-transformations

code:
@spark.df_transformation(inputs=[user_transaction_features])
def high_value_users(features_df):
    return features_df.filter("avg_transaction_amount > 100")

section_id: chaining-transformations

section_id: accessing-transformation-data

section_id: apply-registrations


title: Features and labels in Featureform

summary: Define entities, features, labels, and aggregate windows in Featureform.

title: Overview

text: Features and labels are the core semantic objects in Featureform. They describe what you want to predict, how feature values are keyed, and how those values should be computed over time.

title: Entities

text:
An entity represents the business object that features belong to, such as a user, merchant, account, device, or product.

[code example]

Attach features and labels to the entity class so Featureform can reason about keys and lineage.

title: Define features

text:
Use the builder-style API to define features from registered datasets or transformations:

[code example]

title: Aggregate features

text:
Aggregate features create time-windowed feature values from event data:

[code example]

Access a specific window by indexing the feature with the matching `timedelta`:

[code example]

title: Define labels

text:
Labels represent the target you want to predict:

[code example]

title: Point-in-time correctness

text:
Timestamps are central to correct ML training and serving workflows. When you include the relevant event timestamp in your feature and label definitions, Featureform can align historical examples correctly instead of leaking future information into the training data.

Use timestamps consistently when:

- defining event-derived features
- defining labels with historical outcomes
- creating aggregate windows
- building training sets from time-varying data

title: Best practices

text:
- Model entities after real business keys that your applications already use.
- Prefer the builder-style feature API for new work.
- Add timestamps wherever feature values change over time.
- Keep feature names stable and descriptive so they can be reused across training sets and feature views.

title: What to read next

text:
- [Work with training sets and feature views]()
- [Streaming features]()

code:
@ff.entity
class User:
    pass

section_id: entities

code:
@ff.entity
class User:
    avg_transaction_amount = (
        ff.Feature()
        .from_dataset(
            user_transaction_features,
            entity="user_id",
            values="avg_transaction_amount",
            timestamp="latest_transaction",
        )
    )

section_id: define-features

code:
from datetime import timedelta

@ff.entity
class User:
    transaction_count = (
        ff.Feature()
        .from_dataset(
            transactions,
            entity="user_id",
            values="amount",
            timestamp="timestamp",
        )
        .aggregate(
            function=ff.AggregateFunction.COUNT,
            windows=[timedelta(days=7), timedelta(days=30)],
        )
    )

section_id: aggregate-features

code:
@ff.entity
class User:
    is_fraud = (
        ff.Label()
        .from_dataset(transactions)
        .value("is_fraud")
        .timestamp("timestamp")
        .entity("user", "user_id")
        .description("Binary fraud classification label")
    )

section_id: define-labels


title: Featureform

summary: Build feature engineering workflows with Featureform and Redis.

summary: Learn what Featureform is, who it is for, and how it fits into Redis-based ML workflows.

title: Featureform overview

summary: Register providers, define a feature, materialize it to Redis, and serve it.

title: Featureform quickstart

summary: Register offline providers and Redis online stores for Featureform workflows.

title: Connect providers in Featureform

title: Features and labels in Featureform

summary: Build training sets and materialize feature views to Redis with Featureform.

title: Training sets and feature views in Featureform

summary: Build stream-backed features with Kafka, streaming transformations, and Redis serving.

title: Streaming features in Featureform

title: Overview

text:
Featureform helps data teams define, materialize, and serve machine learning features by using a declarative Python SDK on top of existing data systems.

Featureform works with offline systems such as Snowflake, BigQuery, and Databricks or Spark, then uses Redis as the low-latency online store for feature serving.

title: Get started

text:
- [Overview]()
- [Quickstart]()
- [Connect providers]()
- [Define datasets and transformations]()
- [Define features and labels]()
- [Work with training sets and feature views]()

title: Next steps

text: - [Streaming features]()

title: What this section covers

text:
- The Python SDK workflow for registering providers, datasets, transformations, entities, features, labels, training sets, and feature views
- The distinction between metadata registration and materialization in the current API
- Point-in-time correct feature definitions for both batch and streaming workflows


title: Featureform overview

title: Overview

text:
Featureform is a feature engineering and feature serving workflow built for teams that want to define machine learning features in code while keeping their existing data platforms. It gives application teams a declarative Python SDK for working with providers, datasets, transformations, entities, features, labels, training sets, and online feature serving.

In a typical deployment, Featureform reads or computes feature data in an offline system such as Snowflake, BigQuery, or Databricks and materializes selected features to Redis for low-latency inference.

title: Core workflow

text:
The Featureform workflow follows a consistent progression:

1. Register providers for your offline systems and your Redis online store.
2. Register datasets that represent raw inputs or curated tables.
3. Define SQL or DataFrame transformations for feature engineering logic.
4. Define entities, features, and labels in the Python SDK.
5. Register metadata with `client.apply()`.
6. Materialize feature views to Redis for serving.
7. Retrieve online values at inference time or create training sets for model development.

title: Where Redis fits

text: Redis is the online inference store in the Featureform workflow. After you materialize a feature view, applications can retrieve feature values with low latency for prediction requests, personalization, fraud detection, recommendation systems, and similar ML use cases.

title: Main interfaces

text:
The main user-facing interface is the Python SDK:

- `ff.Client(...)` to connect to Featureform
- provider registration methods such as `register_snowflake`, `register_spark`, and `register_redis`
- decorators and builder APIs for transformations, features, and labels
- materialization and serving methods such as `materialize_feature_view(...)` and `serve_feature_view(...)`

Featureform also includes a dashboard for viewing registered resources and tasks, but the Python SDK is the primary authoring interface.

title: What to read next

text:
- [Quickstart]()
- [Connect providers]()


title: Connect providers in Featureform

title: Overview

text:
Use providers to connect Featureform to the systems where your data already lives.

In most deployments, you'll register:

- offline providers store or compute source data and transformed data
- online providers serve low-latency feature values to applications

Redis is the online provider in the Featureform workflow.

title: Before you begin

text:
Before you register providers, make sure you have:

- network access from Featureform to the systems you want to register
- credentials for each provider
- a clear decision about which system is authoritative for offline feature computation
- a Redis deployment for online serving

Featureform's current provider APIs rely heavily on catalog configuration. For Snowflake and Databricks, make sure you choose the catalog model before you register providers or datasets.

title: Offline providers

text:
Featureform supports several offline systems, including:

- Snowflake
- BigQuery
- Databricks or Spark

Register the offline provider that matches your existing analytics or feature engineering environment.

title: Online provider

text:
Register Redis as the inference store for low-latency serving:

[code example]

If your deployment requires TLS or ACL configuration, use the connection options supported by your current Featureform release and align them with your Redis security standards.

For secured Redis deployments, you can also configure ACL usernames and TLS settings explicitly:

[code example]

title: Snowflake

text:
Configure the catalog first, then register Snowflake with key-pair authentication. Key-pair authentication is the recommended method, and password authentication is being deprecated.

[code example]

Use Snowflake when your feature engineering workflow already centers on warehouse-native tables, Iceberg-backed tables, or dynamic table pipelines.

If you are migrating from password authentication, update your provider configuration to use `SnowflakeKeyPairConfig(...)`.

title: BigQuery

text:
[code example]

Use BigQuery when your source data and transformations already run in Google Cloud.

title: Databricks or Spark

text:
Use Databricks or Spark when you need DataFrame transformations, Delta tables, or lakehouse-oriented pipelines.

Register a catalog first, then register a filestore and Spark provider. For Databricks with Unity Catalog:

[code example]

The Databricks credentials surface also supports OAuth machine-to-machine authentication:

[code example]

If you want ephemeral Databricks job clusters instead of an always-on cluster, use `cluster_config` instead of `cluster_id`:

[code example]

Use either `cluster_id` or `cluster_config`, not both.

title: Catalog options

text:
Featureform supports several catalog models for offline data:

[code example]

Choose the catalog that matches the table format and governance model in your environment.

title: Retrieve previously registered providers

text:
Once providers are registered, you can retrieve them by name:

[code example]

title: Choose providers

text:
- Choose the offline provider that is already authoritative for your feature data.
- Configure the catalog model before you register Snowflake or Databricks providers.
- Choose Redis when you need low-latency online serving.
- Keep credentials and network access aligned with your platform security standards.
- Minimize the number of providers in early projects so registration and troubleshooting stay simple.

title: What to read next

text:
- [Define datasets and transformations]()
- [Define features and labels]()

code:
redis = client.register_redis(
    name="redis-prod",
    host="redis.example.com",
    port=6379,
    password="redis_password",
)

section_id: online-provider

code:
import featureform as ff

redis = client.register_redis(
    name="redis-cloud",
    host="redis.example.com",
    port=6379,
    username="default",
    password="super-secret",
    ssl_mode=True,
    tls=ff.RedisTLSConfig(
        ca_cert=redis_ca_pem,
        server_name="redis.example.com",
    ),
)

code:
import featureform as ff
from featureform import SnowflakeCatalog, SnowflakeDynamicTableConfig, RefreshMode, Initialize

catalog = SnowflakeCatalog(
    external_volume="my_external_volume",
    base_location="s3://my-bucket/iceberg/",
    catalog_table_config=SnowflakeDynamicTableConfig(
        refresh_mode=RefreshMode.FULL,
        initialize=Initialize.ON_CREATE,
        target_lag="1 hour",
    ),
)

snowflake = client.register_snowflake(
    name="snowflake-prod",
    account="your_account",
    organization="your_org",
    username="featureform_user",
    key_pair=ff.SnowflakeKeyPairConfig(
        private_key_path="/secrets/snowflake/private_key.pem",
    ),
    database="FEATURE_DB",
    schema="PUBLIC",
    warehouse="COMPUTE_WH",
    catalog=catalog,
)

section_id: snowflake

code:
bigquery = client.register_bigquery(
    name="bigquery-prod",
    project_id="your-gcp-project",
    dataset_id="feature_dataset",
    credentials_path="/path/to/service-account.json",
)

section_id: bigquery

code:
import featureform as ff
from featureform import UnityCatalog, TableFormat

unity = UnityCatalog(
    catalog="my_catalog",
    schema="my_schema",
    table_format=TableFormat.DELTA,
)

aws_creds = ff.AWSStaticCredentials(
    access_key="your_aws_access_key",
    secret_key="your_aws_secret_key",
)

s3 = client.register_s3(
    name="s3-store",
    credentials=aws_creds,
    bucket_name="my-featureform-bucket",
    bucket_region="us-east-1",
)

databricks = ff.DatabricksCredentials(
    host="https://your-workspace.cloud.databricks.com",
    token="your_databricks_token",
    cluster_id="your_cluster_id",
)

spark = client.register_spark(
    name="databricks-prod",
    executor=databricks,
    filestore=s3,
    catalog=unity,
)

section_id: databricks-or-spark

code:
import featureform as ff

databricks = ff.DatabricksCredentials(
    host="https://your-workspace.cloud.databricks.com",
    client_id="my-service-principal-client-id",
    client_secret="my-service-principal-secret",
    cluster_id="1234-567890-abcd123",
)

code:
import featureform as ff

cluster_config = ff.DatabricksClusterConfig(
    spark_version="14.3.x-scala2.12",
    node_type_id="i3.xlarge",
    num_workers=4,
)

databricks = ff.DatabricksCredentials(
    host="https://your-workspace.cloud.databricks.com",
    token="your_databricks_token",
    cluster_config=cluster_config,
)

code:
from featureform import UnityCatalog, GlueCatalog, SnowflakeCatalog, TableFormat

unity = UnityCatalog(
    catalog="my_catalog",
    schema="my_schema",
    table_format=TableFormat.DELTA,
)

glue = GlueCatalog(
    region="us-east-1",
    database="my_database",
    warehouse="s3://my-bucket/warehouse/",
    assume_role_arn="arn:aws:iam::123456789:role/GlueRole",
    table_format=TableFormat.ICEBERG,
)

section_id: catalog-options

code:
snowflake = client.get_snowflake("snowflake-prod")
spark = client.get_spark("databricks-prod")
redis = client.get_redis("redis-prod")


title: Featureform quickstart

title: Overview

text:
This quickstart helps you register a simple Featureform workflow and serve feature values from Redis.

You'll do the following:

1. Connect to Featureform.
2. Register an offline provider and a Redis online store.
3. Register a dataset and define a transformation.
4. Define an entity and features.
5. Register metadata.
6. Materialize a feature view to Redis.
7. Serve feature values.

At the end, you'll have a Featureform feature view backed by Redis and a working `serve_feature_view(...)` call.

title: Before you begin

text:
Before you start, make sure you have:

- a running Featureform deployment
- access to an offline system, such as Databricks or Spark
- access to a Redis deployment for online serving
- credentials for the systems you register in this guide

title: Connect to Featureform

text:
[code example]

For local development, you might use an insecure endpoint:

[code example]

title: Register providers

text:
This example uses Databricks as the offline provider and Redis as the online store.

[code example]

title: Register a dataset and transformation

text:
Next, register a dataset from the offline system and define a transformation that computes feature values.

[code example]

title: Define an entity and features

text:
Define an entity class, then attach features to it.

[code example]

title: Register metadata, then materialize

text:
`client.apply()` registers providers, datasets, transformations, and feature definitions. In the current workflow, it does not create the online serving surface by itself.

[code example]

title: Serve features

text:
After the feature view is materialized, retrieve feature values by entity ID:

[code example]

title: What to read next

text:
- [Connect providers]()
- [Define datasets and transformations]()
- [Define features and labels]()

code:
import featureform as ff

client = ff.Client(host="your-featureform-host:443")

section_id: connect-to-featureform

code: client = ff.Client(host="localhost:7878", insecure=True)

code:
import featureform as ff

aws_creds = ff.AWSStaticCredentials(
    access_key="your_aws_access_key",
    secret_key="your_aws_secret_key",
)

s3 = client.register_s3(
    name="s3-store",
    credentials=aws_creds,
    bucket_name="my-featureform-bucket",
    bucket_region="us-east-1",
)

databricks = ff.DatabricksCredentials(
    host="https://your-workspace.cloud.databricks.com",
    token="your_databricks_token",
    cluster_id="your_cluster_id",
)

spark = client.register_spark(
    name="databricks-prod",
    executor=databricks,
    filestore=s3,
)

redis = client.register_redis(
    name="redis-prod",
    host="redis.example.com",
    port=6379,
    password="redis_password",
)

section_id: register-providers

code:
transactions = spark.register_delta_table(
    name="transactions",
    database="my_catalog.my_schema",
    table="transactions",
    description="Raw transaction data",
)

@spark.df_transformation(inputs=[transactions])
def user_transaction_features(transactions_df):
    from pyspark.sql import functions as F

    return transactions_df.groupBy("user_id").agg(
        F.avg("amount").alias("avg_transaction_amount"),
        F.count("*").alias("transaction_count"),
        F.max("timestamp").alias("latest_transaction"),
    )

section_id: register-a-dataset-and-transformation

code:
from datetime import timedelta

@ff.entity
class User:
    avg_transaction_amount = (
        ff.Feature()
        .from_dataset(
            user_transaction_features,
            entity="user_id",
            values="avg_transaction_amount",
            timestamp="latest_transaction",
        )
    )

    transaction_count = (
        ff.Feature()
        .from_dataset(
            transactions,
            entity="user_id",
            values="amount",
            timestamp="timestamp",
        )
        .aggregate(
            function=ff.AggregateFunction.COUNT,
            windows=[timedelta(days=7), timedelta(days=30)],
        )
    )

section_id: define-an-entity-and-features

code:
client.apply()

client.materialize_feature_view(
    view_name="user_features_view",
    inference_store=redis,
    features=[
        User.avg_transaction_amount,
        User.transaction_count[timedelta(days=7)],
        User.transaction_count[timedelta(days=30)],
    ],
)

section_id: register-metadata-then-materialize

code:
features = client.serve_feature_view(
    view="user_features_view",
    entity_ids=["user_123", "user_456"],
)

section_id: serve-features


title: Streaming features in Featureform

title: Overview

text:
Featureform supports stream-backed feature workflows for use cases that need continuously updated online values while preserving historical correctness for training.

This page focuses on the documented SDK surface: register Kafka, define a streaming transformation, define features with `from_stream(...)`, optionally backfill from a batch source, materialize a feature view, and serve it from Redis.

title: Prerequisites

text:
Before you build streaming features, you need:

- a running Featureform deployment
- a registered Redis online store
- a stream-capable compute provider such as Spark or Databricks
- a Kafka topic that contains the events you want to transform into features

title: Register Kafka

text: [code example]

title: Register a Kafka topic

text: [code example]

title: Define a streaming transformation

text: [code example]

title: Define features from a stream

text: [code example]

title: Backfill from batch history

text:
If the stream is the online source of truth but you already have historical data in batch storage, backfill the stream-backed feature:

[code example]

title: Register metadata and materialize

text: [code example]

title: Serve streaming feature values

text: [code example]

title: Guidance

text:
- Parse and cast stream payloads in the transformation layer.
- Reuse one transformed stream for multiple features.
- Keep backfill semantics aligned with the stream definition so training and serving stay consistent.
- Avoid undocumented parameters or status names in production documentation and examples.

code:
from featureform.config.file_stores import KafkaConfig

kafka = ff.register_kafka(
    name="transactions-kafka",
    kafka_config=KafkaConfig(
        bootstrap_servers=["kafka-1:9092", "kafka-2:9092"],
        use_msk_iam_auth=False,
        options={
            "kafka.security.protocol": "SASL_SSL",
            "kafka.sasl.mechanism": "SCRAM-SHA-512",
        },
    ),
)

section_id: register-kafka

code:
transactions_stream = kafka.register_kafka_topic(
    name="transactions-stream",
    topic="transactions",
    description="Raw transaction events from Kafka",
)

section_id: register-a-kafka-topic

code:
@spark.streaming_sql_transformation(
    name="parsed_transactions",
    inputs=[transactions_stream],
)
def parsed_transactions(source):
    return """
        SELECT
            get_json_object(CAST(value AS STRING), '$.user_id') AS user_id,
            CAST(get_json_object(CAST(value AS STRING), '$.amount') AS DOUBLE) AS amount,
            CAST(get_json_object(CAST(value AS STRING), '$.event_time') AS TIMESTAMP) AS event_time
        FROM {{ source }}
    """

section_id: define-a-streaming-transformation

code:
from datetime import timedelta

window = timedelta(days=7)

@ff.entity
class User:
    rolling_amount = (
        ff.Feature()
        .from_stream(
            parsed_transactions,
            entity="user_id",
            values="amount",
            timestamp="event_time",
        )
        .aggregate(
            function=ff.AggregateFunction.SUM,
            windows=[window],
        )
    )

section_id: define-features-from-a-stream

code:
historical_transactions = spark.register_delta_table(
    name="historical_transactions",
    database="ml_catalog.featureform",
    table="historical_transactions",
)

@ff.entity
class User:
    rolling_amount = (
        ff.Feature()
        .from_stream(
            parsed_transactions,
            entity="user_id",
            values="amount",
            timestamp="event_time",
        )
        .backfill_from(
            source=historical_transactions,
            entity="user_id",
            values="amount",
            timestamp="event_time",
        )
        .aggregate(
            function=ff.AggregateFunction.SUM,
            windows=[window],
        )
    )

section_id: backfill-from-batch-history

code:
client.apply()

client.materialize_feature_view(
    view_name="user_streaming_features",
    inference_store=redis,
    features=[User.rolling_amount[window]],
)

section_id: register-metadata-and-materialize

code:
result = client.serve_feature_view(
    view="user_streaming_features",
    entity_ids=["user_1", "user_2"],
)

section_id: serve-streaming-feature-values


title: Overview

text:
Training sets and feature views are where Featureform turns definitions into outputs that model builders and applications can use.

- training sets support model development
- feature views support online inference

title: Register metadata first

text:
In the current workflow, `client.apply()` registers metadata for providers, datasets, transformations, entities, features, and labels:

[code example]

This is a separate step from creating the Redis-backed serving surface.

title: Training sets

text:
Register a training set by combining a label with the features you want to train on:

[code example]

After registration, iterate over the training set or convert it to a data frame for analysis:

[code example]

title: Feature views

text:
Materialize a feature view to Redis when you need online serving:

[code example]

Use feature views to group the online features that an application or model needs at inference time.

title: Serve feature values

text:
[code example]

The result contains the latest materialized values stored in Redis for those entity IDs.

title: Common point of confusion

text:
Keep these two steps separate in your mental model:

- `client.apply()` registers definitions and lineage
- `client.materialize_feature_view(...)` creates the serving surface in Redis

That distinction matters when you troubleshoot missing online data. A successful metadata registration does not, by itself, mean the feature view is ready for serving.

title: Best practices

text:
- Use training sets for repeatable model development workflows.
- Keep online feature views focused on the features needed by one serving surface.
- Treat Redis as the online system of record for materialized feature views, not the source of offline feature computation.

title: What to read next

text: - [Streaming features]()

section_id: register-metadata-first

code:
fraud_training_set = client.register_training_set(
    name="fraud_training_set",
    label=User.is_fraud,
    features=[
        User.avg_transaction_amount,
        User.transaction_count[timedelta(days=7)],
    ],
)

section_id: training-sets

code:
client.materialize_feature_view(
    view_name="user_features_view",
    inference_store=redis,
    features=[
        User.avg_transaction_amount,
        User.transaction_count[timedelta(days=7)],
        User.transaction_count[timedelta(days=30)],
    ],
)

section_id: feature-views

code:
result = client.serve_feature_view(
    view="user_features_view",
    entity_ids=["user_1", "user_2"],
)

section_id: serve-feature-values


title: Redis for AI and search

summary: An overview of Redis for AI and search documentation

summary: This is the Redis vector library (RedisVL).

title: RedisVL

summary: Searching and querying Redis data using Redis Search

title: Redis Search

summary: Store LLM responses for AI apps in a semantic cache.

title: Redis LangCache

summary: This collection showcases how Redis can be integrated into AI workflows to enhance performance, reduce latency, and enable real-time AI applications. Each notebook comes with complete code examples, explanations, and integration guides.

title: Notebooks collection

summary: Build custom AI agents powered by Redis with our interactive code generator

title: AI agent builder

title: Redis AI ecosystem integrations

title: Featureform

title: Redis video tutorial collection

title: Overview

text:
Redis stores and indexes vector embeddings that semantically represent unstructured data including text passages, images, videos, or audio. Store vectors and the associated metadata within [hashes]() or [JSON]() documents for [indexing]() and [querying]().

<div class="grid grid-cols-1 md:grid-cols-3 gap-6 my-8">

</div>

title: Featureform

text:
Use [Featureform]() to define, manage, and serve machine learning features on top of your existing data systems. The Featureform docs cover the Python SDK workflow from provider registration through feature serving.

#### Overview

This page is organized into a few sections depending on what you're trying to do:
* **How to's** - The comprehensive reference section for every feature, API, and setting. It's your source for detailed, technical information to support any level of development.
* **Concepts** - Explanations of foundational ideas and core principles to help you understand the reason behind the product's features and design.
* **Quickstarts** - Short, focused guides to get you started with key features or workflows in minutes.
* **Tutorials** - In-depth walkthroughs that dive deeper into specific use cases or processes. These step-by-step guides help you master essential tasks and workflows.
* **Integrations** - Guides and resources to help you connect and use the product with popular tools, frameworks, or platforms.
* **Video tutorials** - Watch our AI video collection featuring practical tutorials and demonstrations.
* **Benchmarks** - Performance comparisons and metrics to demonstrate how the product performs under various scenarios. This helps you understand its efficiency and capabilities.
* **Best practices** - Recommendations and guidelines for maximizing effectiveness and avoiding common pitfalls. This section equips you to use the product effectively and efficiently.

title: How to's

text:
1. [**Create a vector index**](): Redis maintains a secondary index over your data with a defined schema (including vector fields and metadata). Redis supports [`FLAT`]() and [`HNSW`]() vector index types.
1. [**Store and update vectors**](): Redis stores vectors and metadata in hashes or JSON objects.
1. [**Search with vectors**](): Redis supports several advanced querying strategies with vector fields including k-nearest neighbor ([KNN]()), [vector range queries](), and [metadata filters]().
1. [**Configure vector queries at runtime**](). Select the best filter mode to optimize query execution.

#### Learn how to index and query vector embeddings
* [redis-py (Python)]()
* [NRedisStack (C#/.NET)]()
* [node-redis (JavaScript)]()
* [Jedis (Java)]()
* [go-redis (Go)]()

title: Concepts

text:
Learn to perform vector search and use gateways and semantic caching in your AI/ML projects.

<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 my-8">

</div>

title: Quickstarts

text:
Quickstarts or recipes are useful when you are trying to build specific functionality. For example, you might want to do RAG with LangChain or set up LLM memory for your AI agent.

Get started with these foundational guides:

* [Redis vector database quick start guide]()
* [Retrieval-Augmented Generation quick start guide]()

#### RAG
Retrieval Augmented Generation (aka RAG) is a technique to enhance the ability of an LLM to respond to user queries. The retrieval part of RAG is supported by a vector database, which can return semantically relevant results to a user's query, serving as contextual information to augment the generative capabilities of an LLM.

Explore our [AI notebooks collection]() for comprehensive RAG examples including:

* RAG implementations with RedisVL, LangChain, and LlamaIndex
* Advanced RAG techniques and optimizations
* RAG evaluation with the RAGAS framework
* Integration with cloud platforms like Azure and Vertex AI

Additional resources:
* [Vector search with Azure](https://techcommunity.microsoft.com/blog/azuredevcommunityblog/vector-similarity-search-with-azure-cache-for-redis-enterprise/3822059)
* [RAG with Vertex AI](https://github.com/redis-developer/gcp-redis-llm-stack/tree/main)

#### Agents
AI agents can act autonomously to plan and execute tasks for the user.
* [Redis Notebooks for LangGraph](https://github.com/redis-developer/langgraph-redis/tree/main/examples)

title: Tutorials

text:
Need a deeper-dive through different use cases and topics?

#### RAG
* [Agentic RAG](https://github.com/redis-developer/agentic-rag) - A tutorial focused on agentic RAG with LlamaIndex and Amazon Bedrock
* [RAG on Vertex AI](https://github.com/redis-developer/gcp-redis-llm-stack/tree/main) - A RAG tutorial featuring Redis with Vertex AI
* [RAG workbench](https://github.com/redis-developer/redis-rag-workbench) - A development playground for exploring RAG techniques with Redis
* [ArXiv Chat](https://github.com/redis-developer/ArxivChatGuru) - Streamlit demo of RAG over ArXiv documents with Redis & OpenAI

#### Recommendations and search
* [Recommendation systems w/ NVIDIA Merlin & Redis](https://github.com/redis-developer/redis-nvidia-recsys) - Three examples, each escalating in complexity, showcasing the process of building a realtime recsys with NVIDIA and Redis
* [Redis product search](https://github.com/redis-developer/redis-product-search) - Build a real-time product search engine using features like full-text search, vector similarity, and real-time data updates
* [ArXiv Search](https://github.com/redis-developer/redis-arxiv-search) - Full stack implementation of Redis with React FE

title: Ecosystem integrations

text:
Explore our comprehensive [ecosystem integrations page]() to discover how Redis works with popular AI frameworks, platforms, and tools including:

* LangGraph, LangChain, and LlamaIndex for building advanced AI applications
* Amazon Bedrock and NVIDIA NIM for enhanced AI infrastructure
* Microsoft Semantic Kernel and Kernel Memory for LLM applications
* And many more integrations to power your AI solutions

title: Video tutorials

text:
Watch our [AI video collection]() featuring practical tutorials and demonstrations on:

* Building RAG applications and implementing vector search
* Working with LangGraph for AI agents with memory
* Semantic caching and search techniques
* Redis integrations with popular AI frameworks
* Real-world AI application examples and best practices

title: Benchmarks

role: performance

text:
See how we stack up against the competition.
* [Redis vector benchmark results](https://redis.io/blog/benchmarking-results-for-vector-databases/)
* [1 billion vectors](https://redis.io/blog/redis-8-0-m02-the-fastest-redis-ever/)

title: Best practices

text:
See how leaders in the industry are building their RAG apps.
* [Get better RAG responses with Ragas](https://redis.io/blog/get-better-rag-responses-with-ragas/)

title: Continue learning with Redis University

text:
* [Context Engineering with Redis & LangChain](https://university.redis.io/course/vsgabnbkd3f5cd?tab=details)
* [Vector Search with RedisVL](https://university.redis.io/course/1npvvtfft2agew?tab=details)
* [Build a RAG Chatbot](https://university.redis.io/course/ihjs7iip0gpkrw?tab=details)


title: Use the LangCache API and SDK

summary: Learn to use the Redis LangCache API for semantic caching.

title: Authentication

role: security

text:
To access the LangCache API, you need:

- LangCache API base URL
- LangCache service API key
- Cache ID

When you call the API, you need to pass the LangCache API key in the `Authorization` header as a Bearer token and the Cache ID as the `cacheId` path parameter.

For example:

#### Code Examples

**Redis CLI:**

[code example]

**Available in:** Redis CLI, JavaScript (Node.js), Python

**JavaScript (Node.js):**

[code example]

**Python:**

[code example]

This example expects several variables to be set in the shell:

- **$HOST** - the LangCache API base URL
- **$CACHE_ID** - the Cache ID of your cache
- **$API_KEY** - The LangCache API token

title: Examples

role: example

title: Search LangCache for similar responses

text:
Use [`POST /v1/caches/{cacheId}/entries/search`]() to search the cache for matching responses to a user prompt.

#### Code Examples

**Redis CLI:**

[code example]

**Available in:** Redis CLI, JavaScript (Node.js), Python

**JavaScript (Node.js):**

[code example]

**Python:**

[code example]

Place this call in your client app right before you call your LLM's REST API. If LangCache returns a response, you can send that response back to the user instead of calling the LLM.

If LangCache does not return a response, you should call your LLM's REST API to generate a new response. After you get a response from the LLM, you can [store it in LangCache](#store-a-new-response-in-langcache) for future use.

#### Attributes
You can also scope the responses returned from LangCache by adding an `attributes` object to the request. LangCache will only return responses that match the attributes you specify.

#### Code Examples

**Redis CLI:**

[code example]

**Available in:** Redis CLI, JavaScript (Node.js), Python

**JavaScript (Node.js):**

[code example]

**Python:**

[code example]

#### Search strategies
LangCache supports two search strategies when looking for a cached response:

- **`exact`**: Returns a result only when the stored prompt matches the query exactly (case insensitive).
- `**semantic**`: Uses vector similarity to find semantically similar prompts and responses.

By default, LangCache uses `semantic` search only. You can specify one or more search strategies in the request body.

#### Code Examples

**Redis CLI:**

[code example]

**Available in:** Redis CLI, JavaScript (Node.js), Python

**JavaScript (Node.js):**

[code example]

**Python:**

[code example]

title: Store a new response in LangCache

text:
Use [`POST /v1/caches/{cacheId}/entries`]() to store a new response in the cache.

#### Code Examples

**Redis CLI:**

[code example]

**Available in:** Redis CLI, JavaScript (Node.js), Python

**JavaScript (Node.js):**

[code example]

**Python:**

[code example]

Place this call in your client app after you get a response from the LLM. This will store the response in the cache for future use.

You can also store the responses with custom attributes by adding an `attributes` object to the request.

#### Code Examples

**Redis CLI:**

[code example]

**Available in:** Redis CLI, JavaScript (Node.js), Python

**JavaScript (Node.js):**

[code example]

**Python:**

[code example]

title: Delete cached responses

text:
Use [`DELETE /v1/caches/{cacheId}/entries/{entryId}`]() to delete a cached response from the cache.

#### Code Examples

**Redis CLI:**

[code example]

**Available in:** Redis CLI, JavaScript (Node.js), Python

**JavaScript (Node.js):**

[code example]

**Python:**

[code example]

You can also use [`DELETE /v1/caches/{cacheId}/entries`]() to delete multiple cached responses based on the `attributes` you specify. If you specify multiple `attributes`, LangCache will delete entries that contain all given attributes.

If you do not specify any `attributes`, all responses in the cache will be deleted. This cannot be undone.

<br/>

#### Code Examples

**Redis CLI:**

[code example]

**Available in:** Redis CLI, JavaScript (Node.js), Python

**JavaScript (Node.js):**

[code example]

**Python:**

[code example]

title: Flush the cache

text:
Use
[POST /v1/caches/{cacheId}/flush](https://redis.io/docs/latest/develop/ai/langcache/api-reference/#tag/Cache-Entries/operation/flush)
to flush all entries from the cache.

#### Code Examples

**Redis CLI:**

[code example]

**Available in:** Redis CLI, JavaScript (Node.js), Python

**JavaScript (Node.js):**

[code example]

**Python:**

[code example]

code:
curl -s -X POST "https://$HOST/v1/caches/$CACHE_ID/entries/search" \
    -H "accept: application/json" \
    -H "Authorization: Bearer $API_KEY" \
    -d '{ "prompt": "What is semantic caching" }'

section_id: authentication

code:
import { LangCache } from "@redis-ai/langcache";

const langCache = new LangCache({
    serverURL: "https://" + process.env.HOST,
    cacheId: process.env.CACHE_ID,
    apiKey: process.env.API_KEY,
  });

code:
from langcache import LangCache
import os

lang_cache = LangCache(
    server_url=f"https://{os.getenv('HOST', '')}",
    cache_id=os.getenv("CACHE_ID", ""),
    api_key=os.getenv("API_KEY", "")
)

code:
POST https://[host]/v1/caches/{cacheId}/entries/search
{
    "prompt": "User prompt text"
}

section_id: search-langcache-for-similar-responses

code:
async function searchBasic() {
    const result = await langCache.search({
      prompt: "User prompt text",
      similarityThreshold: 0.9,
    });

    console.log(result);
}

searchBasic();

code:
res = lang_cache.search(
    prompt="User prompt text",
    similarity_threshold=0.9
)

print(res)

code:
POST https://[host]/v1/caches/{cacheId}/entries/search
{
    "prompt": "User prompt text",
    "attributes": {
        "customAttributeName": "customAttributeValue"
    }
}

code:
async function searchAttributes() {
    const result = await langCache.search({
      prompt: "User prompt text",
      attributes: {
        "customAttributeName": "customAttributeValue",
      },
      similarityThreshold: 0.9,
    });

    console.log(result);
}

searchAttributes();

code:
res = lang_cache.search(
    prompt="User prompt text",
    attributes={"customAttributeName": "customAttributeValue"},
    similarity_threshold=0.9,
)

print(res)

code:
POST https://[host]/v1/caches/{cacheId}/entries/search
{
    "prompt": "User prompt text",
    "searchStrategies": ["exact", "semantic"]
}

code:
import { SearchStrategy } from '@redis-ai/langcache/models/searchstrategy.js';

async function searchStrategies() {
    const result = await langCache.search({
      prompt: "User prompt text",
      searchStrategies: [SearchStrategy.Exact, SearchStrategy.Semantic],
      similarityThreshold: 0.9,
    });

    console.log(result);
}

searchStrategies();

code:
from langcache.models import SearchStrategy

res = lang_cache.search(
    prompt="User prompt text",
    search_strategies=[SearchStrategy.EXACT, SearchStrategy.SEMANTIC],
    similarity_threshold=0.9,
)

print(res)

code:
POST https://[host]/v1/caches/{cacheId}/entries
{
    "prompt": "User prompt text",
    "response": "LLM response text"
}

section_id: store-a-new-response-in-langcache

code:
async function storeBasic() {
    const result = await langCache.set({
      prompt: "User prompt text",
      response: "LLM response text",
    });

    console.log(result);
}

storeBasic();

code:
res = lang_cache.set(
    prompt="User prompt text",
    response="LLM response text",
)

print(res)

code:
POST https://[host]/v1/caches/{cacheId}/entries
{
    "prompt": "User prompt text",
    "response": "LLM response text",
    "attributes": {
        "customAttributeName": "customAttributeValue"
    }
}

code:
async function storeAttributes() {
    const result = await langCache.set({
      prompt: "User prompt text",
      response: "LLM response text",
      attributes: {
        "customAttributeName": "customAttributeValue",
      },
    });

    console.log(result);
}

storeAttributes();

code:
res = lang_cache.set(
    prompt="User prompt text",
    response="LLM response text",
    attributes={"customAttributeName": "customAttributeValue"},
)

print(res)

section_id: delete-cached-responses

code:
async function deleteEntry() {
    const result = await langCache.deleteById({
      entryId: "<entryId>",
    });

    console.log(result);
}

deleteEntry();

code:
res = lang_cache.delete_by_id(entry_id="<entryId>")

print(res)

code:
DELETE https://[host]/v1/caches/{cacheId}/entries
{
    "attributes": {
        "customAttributeName": "customAttributeValue"
    }
}

code:
async function deleteQuery() {
    const result = await langCache.deleteQuery({
      attributes: {
        "customAttributeName": "customAttributeValue",
      },
    });

    console.log(result);
}

deleteQuery();

code:
res = lang_cache.delete_query(
    attributes={"customAttributeName": "customAttributeValue"},
)

print(res)

section_id: flush-the-cache

code:
async function flush() {
    await langCache.flush();
}

flush();


title: LangCache REST API

page_type: index


title: Redis LangCache

title: Use the LangCache API and SDK

title: LangCache REST API

title: Overview

text:
Redis LangCache is a fully-managed semantic caching service that reduces large language model (LLM) costs and improves response times for AI applications.

[Get started](#get-started) with LangCache on [Redis Cloud]() or join the [private preview](https://redis.io/langcache/).

title: LangCache overview

text:
LangCache uses semantic caching to store and reuse previous LLM responses for repeated queries. Instead of calling the LLM for every request, LangCache checks if a similar response has already been generated and is stored in the cache. If a match is found, LangCache returns the cached response instantly, saving time and resources.

Imagine you’re using an LLM to build an agent to answer questions about your company's products. Your users may ask questions like the following:

- "What are the features of Product A?"
- "Can you list the main features of Product A?"
- "Tell me about Product A’s features."

These prompts may have slight variations, but they essentially ask the same question. LangCache can help you avoid calling the LLM for each of these prompts by caching the response to the first prompt and returning it for any similar prompts.

Using LangCache as a semantic caching service has the following benefits:

- **Lower LLM costs**:  Reduce costly LLM calls by easily storing the most frequently-requested responses.
- **Faster AI app responses**: Get faster AI responses by retrieving previously-stored requests from memory.
- **Simpler deployments**: Access our managed service using a REST API with automated embedding generation, configurable controls, and no database management required.
- **Advanced cache management**: Manage data access, privacy, and eviction protocols. Monitor usage and cache hit rates.

LangCache works well for the following use cases:

- **AI assistants and chatbots**: Optimize conversational AI applications by caching common responses and reducing latency for frequently asked questions.
- **RAG applications**: Enhance retrieval-augmented generation performance by caching responses to similar queries, reducing both cost and response time.
- **AI agents**: Improve multi-step reasoning chains and agent workflows by caching intermediate results and common reasoning patterns.
- **AI gateways**: Integrate LangCache into centralized AI gateway services to manage and control LLM costs across multiple applications..

title: LLM cost reduction with LangCache

title: LangCache architecture

text:
The following diagram displays how you can integrate LangCache into your GenAI app:

1. A user sends a prompt to your AI app.
1. Your app sends the prompt to LangCache through the `POST /v1/caches/{cacheId}/entries/search` endpoint.
1. LangCache calls an embedding model service to generate an embedding for the prompt.
1. LangCache searches the cache to see if a similar response already exists by matching the embeddings of the new query with the stored embeddings.
1. If a semantically similar entry is found (also known as a cache hit), LangCache gets the cached response and returns it to your app. Your app can then send the cached response back to the user.
1. If no match is found (also known as a cache miss), your app receives an empty response from LangCache. Your app then queries your chosen LLM to generate a new response.
1. Your app sends the prompt and the new response to LangCache through the `POST /v1/caches/{cacheId}/entries` endpoint.
1. LangCache stores the embedding with the new response in the cache for future use.

See the [LangCache API and SDK examples]() for more information on how to use the LangCache API.

title: Get started

text:
LangCache is currently in preview:

- Public preview on [Redis Cloud]()
- Fully-managed [private preview](https://redis.io/langcache/)

**Redis Cloud:**

**Private preview:**

title: Prerequisites

text:
To use LangCache in private preview, you need:

- An AI application that makes LLM API calls
- A use case involving repetitive or similar queries
- Willingness to provide feedback during the preview phase

title: Access

text:
LangCache is offered as a fully-managed service. During the private preview:

- Participation is free
- Usage limits may apply
- Dedicated support is provided
- Regular feedback sessions are conducted

title: Data security and privacy

text: LangCache stores your data on your Redis servers. Redis does not access your data or use it to train AI models. The service maintains enterprise-grade security and privacy standards.

title: Support

role: compatibility

text:
Private preview participants receive:

- Dedicated onboarding resources
- Documentation and tutorials
- Email and chat support
- Regular check-ins with the product team
- Exclusive roadmap updates

For more information about joining the private preview, visit the [Redis LangCache website](https://redis.io/langcache/).


title: Notebooks collection

title: Overview

text:
| Notebook | Category | Description |  |
|----------|----------|-------------|--|
| The place to start if you are brand new to Redis | Introduction | Great for Redis beginners looking for a guided Colab experience. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/redis-intro/00_redis_intro.ipynb) |
| Implementing hybrid search with Redis | Hybrid and Vector Search | Combines vector similarity with keyword filters. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/02_hybrid_search.ipynb) |
| Vector search with Redis Python client | Hybrid and Vector Search | Demonstrates pure vector search using the Redis Python client. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/00_redispy.ipynb) |
| Vector search with Redis Vector Library | Hybrid and Vector Search | Uses RedisVL for advanced vector indexing and querying. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/01_redisvl.ipynb) |
| Shows how to convert a float32 index to float16 or integer data types | Hybrid and Vector Search | Demonstrates data type optimization for vector indices. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/03_dtype_support.ipynb) |
| RAG from scratch with Redis Vector Library | RAG | Basic RAG implementation using RedisVL. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/RAG/01_redisvl.ipynb) |
| RAG using Redis and LangChain | RAG | Shows integration between Redis and LangChain for RAG. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/RAG/02_langchain.ipynb) |
| RAG using Redis and LlamaIndex | RAG | Walkthrough of RAG with Redis and LlamaIndex. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/RAG/03_llamaindex.ipynb) |
| Advanced RAG with RedisVL | RAG | Advanced concepts and techniques using RedisVL. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/RAG/04_advanced_redisvl.ipynb) |
| RAG using Redis and Nvidia | RAG | NVIDIA + Redis for LLM context retrieval. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/RAG/05_nvidia_ai_rag_redis.ipynb) |
| Utilize RAGAS framework to evaluate RAG performance | RAG | Evaluation of RAG apps using the RAGAS framework. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/RAG/06_ragas_evaluation.ipynb) |
| Implement a simple RBAC policy with vector search using Redis | RAG | Role-based access control implementation for RAG systems. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/RAG/07_user_role_based_rag.ipynb) |
| LangGraph and agents | Agents | Getting started with agent workflows. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/agents/00_langgraph_redis_agentic_rag.ipynb) |
| Movie recommendation system | Agents | Collaborative agent-based movie recommender. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/agents/01_crewai_langgraph_redis.ipynb) |
| Full-Featured Agent Architecture | Agents | Comprehensive agent implementation with advanced features. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/agents/02_full_featured_agent.ipynb) |
| Optimize semantic cache threshold with RedisVL | Semantic Cache | Performance optimization for semantic caching systems. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/semantic-cache/02_semantic_cache_optimization.ipynb) |
| Simple examples of how to build an allow/block list router in addition to a multi-topic router | Semantic Router | Basic routing patterns and access control mechanisms. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/semantic-router/00_semantic_routing.ipynb) |
| Use `RouterThresholdOptimizer` from RedisVL to setup best router config | Semantic Router | Router configuration optimization using RedisVL. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/semantic-router/01_routing_optimization.ipynb) |
| Facial recognition | Computer Vision | Face matching using Facenet and RedisVL. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/computer-vision/00_facial_recognition_facenet.ipynb) |
| Content filtering with RedisVL | Recommendation Systems | Introduction to content-based filtering. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/recommendation-systems/00_content_filtering.ipynb) |
| Collaborative filtering with RedisVL | Recommendation Systems | Intro to collaborative filtering with RedisVL. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/recommendation-systems/01_collaborative_filtering.ipynb) |
| Intro deep learning two tower example with RedisVL | Recommendation Systems | Deep learning approach to recommendation systems. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/recommendation-systems/02_two_towers.ipynb) |
| Credit scoring system using Feast with Redis as the online store | Feature Store | Feature store implementation for ML model serving. | [Open in Colab](https://colab.research.google.com/github/redis-developer/redis-ai-resources/blob/main/python-recipes/feature-store/00_feast_credit_score.ipynb) |

title: Additional resources

text:
Looking for more ways to learn about Redis for AI? Check out our:

* [AI video collection]() - Video tutorials and demonstrations covering Redis AI concepts
* [Ecosystem integrations]() - Learn how Redis works with popular AI frameworks and tools