Respire.AI
0.11.0
Prefix Reserved
dotnet add package Respire.AI --version 0.11.0
NuGet\Install-Package Respire.AI -Version 0.11.0
<PackageReference Include="Respire.AI" Version="0.11.0" />
<PackageVersion Include="Respire.AI" Version="0.11.0" />
<PackageReference Include="Respire.AI" />
paket add Respire.AI --version 0.11.0
#r "nuget: Respire.AI, 0.11.0"
#:package Respire.AI@0.11.0
#addin nuget:?package=Respire.AI&version=0.11.0
#tool nuget:?package=Respire.AI&version=0.11.0
Respire.AI
Semantic response caching for Microsoft.Extensions.AI chat clients, backed by Redis vector search, and exact-text embedding caching with batched misses on ordinary Redis.
Also includes bounded Redis conversation history, UseRespireChatHistory middleware for
streaming and non-streaming calls, and RespireChatHistoryProvider for Microsoft Agent
Framework. History supports tool calls and results, atomic concurrent appends, trimming,
expiry, and clearing; it does not require Redis Search.
When composing history with tools, register UseRespireChatHistory before
UseFunctionInvocation so history wraps the whole tool loop. Reversing this order is
unsupported and duplicates messages during tool iterations. Pass only new messages;
repeated system messages are stored again too.
Install
dotnet add package Respire.AI
Usage
using Microsoft.Extensions.AI;
using Respire;
using Respire.AI;
public static class ChatSetup
{
public static IChatClient Build(
IChatClient provider,
IRespireClient redis,
IEmbeddingGenerator<string, Embedding<float>> embeddings)
=> new ChatClientBuilder(provider)
.UseRespireSemanticCache(redis, embeddings, new()
{
CacheName = "support:model-v1:deployment-v1",
Dimensions = 1536,
DistanceThreshold = 0.1,
TimeToLive = TimeSpan.FromMinutes(30),
ScopeSelector = (_, options) =>
options?.AdditionalProperties?.TryGetValue("UserId", out var user) == true
? user as string : null,
})
.Build();
}
Supply your chat provider and embedding generator, and match Dimensions to its output. Requires standalone Redis Query Engine. Set UserId in request AdditionalProperties to isolate users; see the guide for scope, bypass, and cache lifetime behavior.
Read the guide for configuration, requirements, and further examples.
For embedding generation, use EmbeddingGeneratorBuilder<string, Embedding<float>>.UseRespireEmbeddingCache
with a Redis client and RespireEmbeddingCacheOptions. It preserves batch order, deduplicates misses,
stores compact FLOAT32 vectors with optional TTL, and exposes hit/miss metrics.
See the embedding cache guide
and runnable sample.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Agents.AI.Abstractions (>= 1.25.0)
- Microsoft.Extensions.AI (>= 10.11.0)
- Respire.Search (>= 0.11.0)
-
net8.0
- Microsoft.Agents.AI.Abstractions (>= 1.25.0)
- Microsoft.Extensions.AI (>= 10.11.0)
- Respire.Search (>= 0.11.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.