This library provides object mapping and querying capabilities for .NET applications interacting with Redis. It simplifies data modeling, indexing, and querying by offering declarative attributes and LINQ-like syntax, targeting .NET developers who want to leverage Redis as a primary data store.
How It Works
Redis OM .NET utilizes Redis Stack's RediSearch module for advanced data operations. It maps .NET objects to JSON documents stored in Redis, allowing developers to define indexes using attributes like [Indexed]
and [Searchable]
. Queries are translated into RediSearch query syntax, enabling efficient filtering, sorting, and aggregations. It also supports vector embeddings for similarity searches.
Quick Start & Requirements
- Install via NuGet:
dotnet add package Redis.OM
- Requires Redis Stack (version 1.6.10+ recommended) for indexing, querying, and aggregations. A quick way to start is with Docker:
docker run -p 6379:6379 -p 8001:8001 redis/redis-stack
- Supports .NET 6 and later.
- Official Documentation: https://redis.github.io/redis-om-dotnet/
Highlighted Details
- Declarative object mapping with JSON storage and attribute-based indexing.
- LINQ-style querying and fluent APIs for complex data retrieval and aggregations.
- Built-in support for vector embeddings with various vectorizers (HuggingFace, OpenAI, AzureOpenAI) and ML.NET integration.
- Semantic caching capabilities for AI-driven applications.
- Azure Managed Redis integration with EntraId authentication.
Maintenance & Community
- Active development with numerous contributors listed.
- Troubleshooting and community support available via the Redis Discord Server.
- Contributing guide available.
Licensing & Compatibility
- Licensed under the MIT License, permitting commercial use and integration with closed-source applications.
Limitations & Caveats
- Advanced features like indexing, querying, and aggregations are dependent on Redis Stack; basic key-value operations work with standard Redis.
- Indexing limitations exist for multiple predicates on embedded documents within a single query.