redis-vl-dotnet
Getting Started
This section is the canonical entry point for installation, local Redis setup, connection environment variables, and the first end-to-end workflow.
Prerequisites
The current local development flow assumes:
-
.NET 9 SDK
-
Redis 8 or another Redis deployment with the Query Engine (RediSearch) enabled
-
JSON support for JSON-backed examples and document workflows
-
Docker Desktop or another Docker-compatible runtime when you want the repository-managed local Redis instance
-
A reachable Redis connection string such as
localhost:6379
Default local setup
Start Redis locally from the repository root:
docker compose -f docker-compose.integration.yml up -d redis
export REDIS_VL_REDIS_URL=localhost:6379
Install and validate the docs plus example toolchain from the repository root:
dotnet --version
npm install
npm run docs:validate
npm run examples:build
Run the first end-to-end example:
dotnet run --project examples/JsonStorageExample/JsonStorageExample.csproj
Connection environment variables
The examples and tests use environment variables so the same commands work across local and cluster deployments.
| Variable | Required when | Purpose |
|---|---|---|
|
Direct connection flow |
Standalone Redis endpoint. The examples fall back to |
|
Cluster flow |
Comma-delimited Redis cluster seed nodes such as |
|
Authenticated cluster flow |
Redis username forwarded through the connection factory helpers. |
|
Authenticated cluster flow |
Redis password forwarded through the connection factory helpers. |
|
TLS-enabled cluster flow |
Set to |
Copy-paste connection setup
First workflow
The minimal library flow is:
-
Add the library to an app
-
Connect to Redis
-
Define a schema
-
Create an index
-
Load documents
-
Fetch and query documents
-
Clear or drop the index when finished
The current canonical walkthrough for that sequence still starts from the JSON example and the runnable examples catalog:
-
Examples maps the main feature areas to concrete sample projects
-
/examples/JsonStorageExampledemonstrates schema creation, document loading, fetch, filter search, text search, aggregations, count, clear, and drop flows
Connection topologies
Use RedisConnectionFactory when you need StackExchange.Redis ConfigurationOptions helpers for more than a direct endpoint:
-
cluster discovery through
ConnectClusterAsync(…) -
parsed option creation through
CreateClusterOptions(…)
These helpers normalize seed-node lists, reject unsupported configuration early, and keep the rest of the library on the same IDatabase-based APIs.
Provider environment variables
Provider-backed examples add service credentials on top of the Redis connection variables:
| Variable | Used by |
|---|---|
|
|
|
Optional override for the OpenAI example embedding model. Defaults to |
|
Optional override for the OpenAI example embedding size. Defaults to |
|
|
|
|
If those credentials are missing, the provider-backed examples and matching integration tests fail fast with an explicit environment-variable message instead of attempting a partially configured request.
Related sections
-
Core Features for schema, index, document, and query coverage
-
Examples for runnable sample projects
-
Testing for local validation commands and Redis-backed test setup