XiHan.Framework.AI.VectorData 5.0.0-preview.1

Prefix Reserved
This is a prerelease version of XiHan.Framework.AI.VectorData.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package XiHan.Framework.AI.VectorData --version 5.0.0-preview.1
                    
NuGet\Install-Package XiHan.Framework.AI.VectorData -Version 5.0.0-preview.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="XiHan.Framework.AI.VectorData" Version="5.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XiHan.Framework.AI.VectorData" Version="5.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="XiHan.Framework.AI.VectorData" />
                    
Project file
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 XiHan.Framework.AI.VectorData --version 5.0.0-preview.1
                    
#r "nuget: XiHan.Framework.AI.VectorData, 5.0.0-preview.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 XiHan.Framework.AI.VectorData@5.0.0-preview.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=XiHan.Framework.AI.VectorData&version=5.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=XiHan.Framework.AI.VectorData&version=5.0.0-preview.1&prerelease
                    
Install as a Cake Tool

XiHan.Framework.AI.VectorData

AI 知识库的 Microsoft.Extensions.VectorData Provider(Ring 3,RFC-0022):提供 ai.knowledge@1,把 IKnowledgeStore 映射到应用注册的 VectorStore——任何连接器(内存、Qdrant、PostgreSQL pgvector、Redis、Azure AI Search…)都行。

类型 用途
VectorDataKnowledgeFeature 要求 ai.embedding@1;启动时容器里没有 VectorStore → AI_UNAVAILABLE_002 启动失败;健康项 HealthName(ai.vectordata.store)
VectorDataKnowledgeOptions 本包自己的选项 XiHan:AI:VectorData:HealthProbeIntervalSeconds(默认 15,有限的正数,也是单次探测的超时)
VectorDataKnowledgeStore 每个知识库集合一个向量集合(定义按 XiHan:AI:Knowledge:Dimensions 构造,余弦相似度);DocumentIds 过滤下推,元数据过滤取回 top × 4 条后在进程内完成;按文档删除与按块序号裁剪(DocumentId、ChunkIndex 是可过滤字段)都先分页取键再按键删
KnowledgeVectorRecord 向量记录:Key(由记录 ID 确定性推出的 Guid,KeyOf)、RecordId、DocumentId、ChunkIndex、Text、Metadata(JSON)、Vector
// 连接器由应用选择并自行引用其包,本包不引用任何连接器;例如内存连接器(CommunityToolkit.VectorData.InMemory),只适合开发
builder.Services.AddSingleton<VectorStore>(new InMemoryVectorStore());
builder.AddXiHan(x => x.UseStandardProfile().UseFeature<OpenAIFeature>().UseFeature<VectorDataKnowledgeFeature>());

await ingestor.IngestAsync(new KnowledgeIngestRequest { DocumentId = "faq", Text = faqText }, ct);
var chunks = (await retriever.RetrieveAsync(new KnowledgeQuery { Text = "How do I reset my password?" }, ct)).ValueOrThrow();
var prompt = augmenter.Augment("How do I reset my password?", chunks);

健康项 ai.vectordata.store(ADR-0030、ADR-0110):被选为 ai.knowledge 时登记,启动时同步探一次、之后按间隔在后台重探;探针只问默认集合(Knowledge:Collection)在不在,不列集合、不建集合、不读写记录,连接器不理会取消令牌也按时限结束等待。应答 Ready;连接器抛出 Degraded(AI_UNAVAILABLE_002,与存储操作同一个错误);超时 Degraded(KERNEL_UNAVAILABLE_005);没有 Failed,向量库不可达时应用照常启动与服务。条目不带数据与说明,不写端点或连接信息;应用不必另写向量库的健康检查。

连接器抛出时,存储操作与健康项的 reason 都只写异常类型的全名,完整异常进日志(ADR-0111、ADR-0112)。

连接器要接受 Guid 键;键形状变化之前建的集合要重建(ADR-0111)。Qdrant 用 CommunityToolkit.VectorData.Qdrant:Microsoft.SemanticKernel.Connectors.Qdrant 预览包与当前的 VectorData 不兼容。

向量集合的维度在创建后不能改:换嵌入模型要换 Collection 或删掉旧集合。知识库配置在装配时读一次、不热更新,改了要重启应用(ADR-0074)。通过 AI.Conformance 的 KnowledgeStoreConformance。

依赖方向

依赖 XiHan.Framework.AI.Abstractions、Microsoft.Extensions.VectorData.Abstractions。不进 Profiles.Full(需要应用注册向量存储)。

状态

P0:可用(Preview)。

Product 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0-preview.2 44 11/6/2026
5.0.0-preview.1 49 11/4/2026