redis-vl-dotnet
Core Features
This section is the canonical overview for the core Redis-backed library surface.
Main workflow areas
The core package centers on these feature groups:
-
SearchSchemaandIndexDefinitionfor defining index names, prefixes, storage type, and fields -
field definitions for text, tag, numeric, geo, and vector indexing
-
SearchIndexfor index creation, inspection, listing, clearing, rediscovery, and dropping -
document lifecycle and partial updates for JSON and HASH CRUD flows
-
structured query objects for filter, text, count, vector, hybrid, multi-vector, and aggregation workflows
-
higher-level caches and workflows for embeddings reuse, semantic response reuse, semantic routing, and chat-history retrieval
Schema and index docs
| Topic | What it covers |
|---|---|
How schema metadata and field collections fit together, including JSON versus HASH storage behavior. |
|
Index naming, prefixes, key separators, stopwords, and advanced FT.CREATE flags exposed by the library. |
|
Supported field types plus the validation rules behind sortable, |
|
|
|
|
|
|
|
|
Query and aggregation docs
| Topic | What it covers |
|---|---|
Structured RediSearch filtering with |
|
Full-text search strings, return-field projections, typed mapping, and text-search batch helpers. |
|
Count-only requests that reuse the filter DSL without fetching documents. |
|
KNN search, |
|
Radius-style vector search with distance thresholds, paging, and range runtime options. |
|
Combined text-plus-vector search where a text predicate narrows semantic search candidates. |
|
Vector + text filtering with aggregation pipelines, load fields, reducers, sort clauses, and runtime tuning. |
|
Weighted search across multiple vector fields with deterministic score combination and shared projections. |
|
|
Cache and workflow docs
| Topic | What it covers |
|---|---|
Exact-input embedding reuse with SHA-256-based keys, optional namespaces, and TTL-driven expiration. |
|
Semantic response reuse with vector thresholds, optional metadata, filterable fields, and vectorizer-based overloads. |
|
Route registration and nearest-route lookup for AI-adjacent request routing workflows. |
|
Session-scoped append-only chat history with recency retrieval and optional role filters. |
|
Recency plus semantic retrieval inside one session with configurable vector thresholds. |
Primary example
The primary runnable example for this area is /examples/JsonStorageExample.
It demonstrates:
-
loading a schema from YAML
-
creating a JSON-backed index with overwrite semantics
-
listing indexes and rediscovering one with
SearchIndex.FromExistingAsync -
loading, fetching, partially updating, clearing, and dropping JSON documents
Pair it with /examples/VectorSearchExample when you need the HASH-backed view of update, fetch, and cleanup flows.
The primary runnable references for query coverage are:
-
/examples/JsonStorageExamplefor filter, text, count, batching, and standard aggregation -
/examples/VectorSearchExamplefor vector, hybrid aggregate, multi-vector, paging windows, and runtime vector options
Storage behavior
The library supports both JSON and HASH storage models:
-
StorageType.Jsonuses RedisJSON paths and requires RedisJSON plus RediSearch. -
StorageType.Hashuses Redis hashes and requires RediSearch only.
Choose the storage type in IndexDefinition, then use the matching SearchIndex APIs. JSON flows call methods such as LoadJsonAsync and FetchJsonByIdAsync; HASH flows call LoadHashAsync and FetchHashByIdAsync.
Query pagination is shared across the search APIs, and typed result mapping is designed to let callers work with strongly typed documents or projections instead of parsing raw Redis arrays directly.
Related sections
-
Getting Started for the first local setup flow
-
SearchSchema to start defining an index
-
Document lifecycle for load, fetch, delete, clear, and drop flows
-
Partial updates for JSONPath and HASH field update rules
-
FilterQuery for structured filtering
-
VectorQuery for vector search and runtime tuning
-
Aggregation workflows for grouping and typed aggregate results
-
Examples for runnable coverage
-
CLI for terminal-oriented schema and index operations
-
EmbeddingsCache for exact embedding reuse
-
SemanticCache for semantic response reuse
-
SemanticRouter for nearest-route matching
-
MessageHistory for recency-only chat history
-
SemanticMessageHistory for semantic session retrieval