# RedisConfig

> **Class** in `langchain_redis`

📖 [View in docs](https://reference.langchain.com/python/langchain-redis/config/RedisConfig)

Configuration class for Redis vector store settings.

This class defines the configuration parameters for setting up and interacting with
a Redis vector store. It uses Pydantic for data validation and settings management.

## Signature

```python
RedisConfig()
```

## Description

**Example:**

```python
from langchain_redis import RedisConfig

config = RedisConfig(
    index_name="my_index",
    redis_url="redis://localhost:6379",
    distance_metric="COSINE",
    embedding_dimensions=1536
)

# Use this config to initialize a RedisVectorStore
vector_store = RedisVectorStore(embeddings=my_embeddings, config=config)
```

**Note:**

- Only one of `'index_schema'`, `'schema_path'`, or `'metadata_schema'`
    should be specified.
- The `'key_prefix'` is automatically set to `'index_name'` if not provided.
- When `'from_existing'` is `True`, it connects to an existing index instead
    of creating a new one.
- Custom validation ensures that incompatible options are not
    simultaneously specified.

## Extends

- `BaseModel`

## Properties

- `index_name`
- `from_existing`
- `key_prefix`
- `redis_url`
- `redis_client`
- `connection_args`
- `distance_metric`
- `indexing_algorithm`
- `vector_datatype`
- `storage_type`
- `id_field`
- `content_field`
- `embedding_field`
- `default_tag_separator`
- `metadata_schema`
- `index_schema`
- `schema_path`
- `return_keys`
- `custom_keys`
- `embedding_dimensions`
- `legacy_key_format`
- `model_config`

## Methods

- [`check_schema_options()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/check_schema_options)
- [`set_key_prefix()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/set_key_prefix)
- [`from_kwargs()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/from_kwargs)
- [`from_schema()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/from_schema)
- [`from_yaml()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/from_yaml)
- [`with_metadata_schema()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/with_metadata_schema)
- [`from_existing_index()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/from_existing_index)
- [`to_index_schema()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/to_index_schema)
- [`is_sentinel_url()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/is_sentinel_url)
- [`redis()`](https://reference.langchain.com/python/langchain-redis/config/RedisConfig/redis)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-redis/blob/17794ab183d4abde98747360f251478088836347/libs/redis/langchain_redis/config.py#L10)