RAGToolkit.AI.VectorData.Qdrant
1.0.1
dotnet add package RAGToolkit.AI.VectorData.Qdrant --version 1.0.1
NuGet\Install-Package RAGToolkit.AI.VectorData.Qdrant -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RAGToolkit.AI.VectorData.Qdrant" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RAGToolkit.AI.VectorData.Qdrant" Version="1.0.1" />
<PackageReference Include="RAGToolkit.AI.VectorData.Qdrant" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RAGToolkit.AI.VectorData.Qdrant --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RAGToolkit.AI.VectorData.Qdrant, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RAGToolkit.AI.VectorData.Qdrant@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RAGToolkit.AI.VectorData.Qdrant&version=1.0.1
#tool nuget:?package=RAGToolkit.AI.VectorData.Qdrant&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RAGToolkit.AI.VectorData.Qdrant
Qdrant 的 VectorStore / VectorStoreCollection 实现,在官方 provider 基础上加了稀疏向量。
核心类型
| 类型 | 说明 |
|---|---|
QdrantVectorStore |
VectorStore 实现 |
QdrantCollection<TKey, TRecord> |
VectorStoreCollection + IKeywordHybridSearchable 实现 |
QdrantDynamicCollection |
无模型的 Dictionary<string, object?> 集合 |
QdrantServiceCollectionExtensions |
AddQdrantVectorStore / AddQdrantCollection 及其 keyed 变体 |
选项
| 类型 | 关键成员 |
|---|---|
QdrantVectorStoreOptions |
EmbeddingGenerator、HasNamedVectors、SparseVectors / SparseVector |
QdrantCollectionOptions |
同上,另有 SparseVectorProperty |
QdrantSparseVectorOptions |
StorageName(默认 "sparse")、Modifier、Index、EmbeddingGenerator、SourcePropertyName |
QdrantSparseIndexOptions |
FullScanThreshold、OnDisk |
QdrantSparseModifier |
None / Idf |
SparseVector 是 SparseVectors 里第一条的快捷方式(getter 取 [0],setter 整个替换)。
稀疏向量选项的解析顺序
按优先级取第一个命中的,后面的不看:
options.SparseVectors(显式列表)options.SparseVectorPropertyTRecord上的[VectorStoreSparseVector]特性(全扫,可以标多个)
也就是说:显式配置会整个覆盖特性标注,不是合并。
混合检索
HybridSearchAsync(dense, keywords, top) 发一个带两路 Prefetch 的 Qdrant 查询,
用 Fusion.Rrf 在服务端融合:
Query
├─ Prefetch[0] nearest: 稠密向量 using: "Embedding"
└─ Prefetch[1] nearest: 稀疏向量 / bm25 using: "sparse"
fusion: Rrf
keywords 为空、或者根本没配稀疏选项时,只发稠密那一路。
DI 自动挂生成器
AddQdrantVectorStore / AddQdrantCollection 会在选项没显式给生成器时,从容器里捞:
IEmbeddingGenerator→EmbeddingGeneratorISparseEmbeddingGenerator<string>→ 每个既没EmbeddingGenerator又没SourcePropertyName的稀疏选项
builder.Services.AddSingleton<ISparseEmbeddingGenerator<string>>(sparseGenerator);
写入时的稀疏构造
UpsertAsync 对每条记录、每个稀疏选项:
- 有
EmbeddingGenerator→ 客户端生成SparseVector{indices, values}; - 只有
SourcePropertyName→ 把原文当 BM25 文档发过去,服务端索引; - 源文本为空 → 这一条跳过该稀疏字段。
依赖
RAGToolkit.AI.VectorData.AbstractionsMicrosoft.Extensions.VectorData.AbstractionsMicrosoft.Extensions.AI.AbstractionsMicrosoft.Extensions.DependencyInjection.AbstractionsQdrant.Client
许可证
MIT —— 见 LICENSE。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.AI.Abstractions (>= 10.10.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.10.0)
- Qdrant.Client (>= 1.19.0)
- RAGToolkit.AI.VectorData.Abstractions (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.