Bitzsoft.Integrations.AI.Hermes
1.2.0
dotnet add package Bitzsoft.Integrations.AI.Hermes --version 1.2.0
NuGet\Install-Package Bitzsoft.Integrations.AI.Hermes -Version 1.2.0
<PackageReference Include="Bitzsoft.Integrations.AI.Hermes" Version="1.2.0" />
<PackageVersion Include="Bitzsoft.Integrations.AI.Hermes" Version="1.2.0" />
<PackageReference Include="Bitzsoft.Integrations.AI.Hermes" />
paket add Bitzsoft.Integrations.AI.Hermes --version 1.2.0
#r "nuget: Bitzsoft.Integrations.AI.Hermes, 1.2.0"
#:package Bitzsoft.Integrations.AI.Hermes@1.2.0
#addin nuget:?package=Bitzsoft.Integrations.AI.Hermes&version=1.2.0
#tool nuget:?package=Bitzsoft.Integrations.AI.Hermes&version=1.2.0
Bitzsoft.Integrations.AI.Hermes
Bitzsoft AI Suite 1.2.0 智能体运行时 Harness 核心包,面向多租户、Native AOT 兼容的企业级智能体编排场景。提供九阶段生命周期钩子管线(AgentHarnessHookPipeline)与不可变轨迹物化视图投影(AITrajectorySurfaceProjector)、三重隔离大结果旁路产物仓(IExecutionArtifactStore / AIArtifactSpillHook / artifact_inspect)、零反射跨数据集十进制分析与同环比引擎(IArtifactAnalysisEngine / InMemoryDecimalArtifactAnalysisEngine / artifact_query)、声明式文档导出纯端口与元工具(IArtifactDocumentExporter / AIWorkbookExportSpec / AIDocumentExportSpec / AISlideDeckExportSpec / artifact_export_document)、工具依赖图谱子图裁剪(IToolDependencyGraphProvider / AIToolsetProfile / IToolSubgraphSelector)、确定性多租户 Shadow/Canary 灰度路由策略(IAICanaryRoutingPolicy / AICanaryRoutingPolicy)以及 OpenTelemetry GenAI 三层嵌套追踪与轻量诊断回放树(OpenTelemetryAgentHarnessHook / InMemoryTurnTraceCollectorHook)。
功能范围与限制
- 核心定位与最小依赖:仅依赖
AI.Abstractions、AI.Governance、AI.Skills、AI.Conversation及Microsoft.Extensions.{DependencyInjection,Logging,Options}抽象包,零 ASP.NET Core 共享框架传递依赖,可直接接入控制台、Worker 与 Web 宿主; - 大结果旁路与十进制计算边界:原始完整数据集留在受信任三重隔离(
TenantId + UserId + SessionId)产物仓内供确定性分析引擎精确计算,任何送回大模型的紧凑句柄摘要与样本行均强制经过出站脱敏与数据驻留策略校验; - 目标框架:
net8.0;net10.0(完整启用IsAotCompatible=true与AIHermesJsonContext源生成序列化); - 安全与边界:完全领域无关,不引入 ORM、Redis 或消息队列强依赖;所有选项在启动阶段经
AIHermesOptionsValidator强制校验。
安装
dotnet add package Bitzsoft.Integrations.AI.Hermes
配置示例
{
"AI": {
"Hermes": {
"SpillThresholdChars": 8192,
"SpillThresholdRows": 50,
"MaxSubgraphTools": 16,
"MaxArtifactBytesPerSession": 33554432,
"ArtifactTimeToLive": "00:30:00",
"EnableGoalVerificationGate": false,
"MaxGoalVerificationRetries": 1
}
}
}
依赖注入注册
using Microsoft.Extensions.DependencyInjection;
services
.AddBitzAIHermes(options =>
{
options.SpillThresholdChars = 8_192;
options.SpillThresholdRows = 50;
options.MaxSubgraphTools = 16;
})
.AddInMemoryArtifactStore()
.AddInMemoryDecimalAnalyticsEngine()
.AddOpenTelemetryHarnessHook()
.AddInMemoryTurnTraceCollector();
完整最小示例
using System.Text.Json;
using Bitzsoft.Integrations.AI.Hermes;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services
.AddBitzAIHermes(options =>
{
options.SpillThresholdChars = 8_192;
options.SpillThresholdRows = 50;
options.MaxSubgraphTools = 16;
})
.AddInMemoryArtifactStore()
.AddInMemoryDecimalAnalyticsEngine()
.AddOpenTelemetryHarnessHook()
.AddInMemoryTurnTraceCollector();
await using ServiceProvider provider = services.BuildServiceProvider(
new ServiceProviderOptions { ValidateScopes = true, ValidateOnBuild = true });
AIHermesRuntimeInfo info = provider.GetRequiredService<AIHermesRuntimeInfo>();
string json = JsonSerializer.Serialize(info, AIHermesJsonContext.Relaxed.AIHermesRuntimeInfo);
Console.WriteLine(json);
关键错误码与配置字段
| 常量 / 字段 | 说明 |
|---|---|
AIHermesErrorCodes.ArtifactNotFound |
目标执行产物不存在或已过期 |
AIHermesErrorCodes.ArtifactAccessDenied |
跨租户、跨用户或跨会话访问执行产物被 Fail-Closed 拒绝 |
AIHermesErrorCodes.ArtifactQuotaExceeded |
单会话旁路产物字节配额超限 |
AIHermesErrorCodes.AnalysisPlanInvalid |
声明式跨数据集分析计划非法或超出安全上限 |
AIHermesErrorCodes.HookAbortedTurn |
门禁钩子基于合规或预算熔断终止回合 |
AIHermesErrorCodes.GoalVerificationFailed |
目标完成核查门禁判定必查项未满足 |
AIHermesErrorCodes.ExportBlueprintInvalid |
文档导出蓝图缺失、格式不匹配、规模超限或文件名/模板别名触发防穿越校验失败 |
AIHermesErrorCodes.ExporterNotConfigured |
宿主未通过 AddArtifactDocumentExporter<T>() 装配文档二进制导出实现 |
AIHermesErrorCodes.TrajectoryRedactionBlocked |
轨迹录制出站脱敏检查失败或被驻留策略阻断 |
AIHermesErrorCodes.DistillationProposalRejected |
轨迹蒸馏候选提案未通过反污染安全门禁校验 |
AIHermesErrorCodes.ProactiveTokenBudgetExceeded |
主动式代理超出单次总令牌预算硬上限并已立即熔断 |
AIHermesErrorCodes.ProactiveExecutionTimeout |
主动式代理超出最长执行时长硬上限并已强制取消 |
AIHermesOptions.SpillThresholdChars |
触发旁路落盘的最小观测字符阈值(512..1,000,000,默认 8,192) |
AIHermesOptions.MaxSubgraphTools |
单轮工具子图最大预算(1..256,默认 16) |
轨迹录制、异步蒸馏、Goal Mode 与主动式定时代理
- 强制脱敏 JSONL 轨迹录制(
IAITrajectoryRecorder/JsonlAITrajectoryRecorder/AddTrajectoryRecorder<T>()):所有轨迹写入均先经IAIOutboundRedactor执行 PII/密钥脱敏与驻留边界校验(Fail-Closed 阻断不落盘),以AIHermesJsonContext.Relaxed单行输出供离线零副作用重放。 - 零误触发异步结晶蒸馏(
AddTrajectoryDistillation()/AITrajectoryDistillationTriggerPolicy/AITrajectoryDistillationJobHandler):默认Enabled = false零成本静默关闭;开启后依据错误恢复/高迭代门槛与 10 分钟会话冷却窗口异步入队(纠偏反馈豁免冷却),后台四步管线经脱敏 → 不可信围栏 + 零推理快路 →AIMemorySecurityScanner反污染门禁 → 待审提案池 /IAISkillCrystallizer草稿沙箱。 - Goal Mode 目标核查门禁(
AddGoalModeSupport()/goal_plan_update/AIGoalVerificationHook):提供租户/用户/会话作用域硬绑定的计划追踪元工具与完成门禁(含至多MaxGoalVerificationRetries次自愈重试与GoalVerificationFailed拒绝)。 - 主动式定时代理状态机(
AddProactiveScheduledAgent()/AIScheduledAgentDispatcher/AIProactiveAgentJobHandler):内置令牌预算/工具轮次/执行时长三道硬熔断、[NO_ACTION_REQUIRED]静默零打扰、HITLSuspended审批推送与唤醒续跑以及租约心跳自动上报。
声明式文档导出纯端口与灰度路由
- 零许可依赖导出纯端口(
IArtifactDocumentExporter+artifact_export_document):本包仅定义AIWorkbookExportSpec(XLSX/CSV)、AIDocumentExportSpec(DOCX/PDF/Markdown)、AISlideDeckExportSpec(PPTX)声明式蓝图与写操作元工具AIArtifactExportDocumentTool(isWriteOperation=true、readOnlyHint=false;调用前逐一核验引用的ArtifactId归属当前(TenantId, UserId, SessionId)防止 IDOR,执行累计行数/字节上限、字段长度限制与TemplateAlias防穿越校验,且不向模型透出BlobKey),通过AddArtifactDocumentExporter<TExporter>()由宿主自由对接ClosedXML、QuestPDF、OpenXML SDK或云端渲染服务; - 确定性多租户灰度路由(
IAICanaryRoutingPolicy/ConfigureCanaryRouting(...)):基于SHA-256(ruleId|tenantId|stickinessKey)长度前缀规范串执行跨进程粘性分桶,按「黑名单 > 白名单 > 百分比分桶」优先级判定Canary切流或Shadow影子旁路,空租户强制 Fail-Closed 回落主通道,并通过GetDiagnosticSummaries()输出脱敏摘要(绝不回吐原始租户名单)。
相关包
- Bitzsoft.Integrations.AI.Abstractions — 共享契约、脱敏、FinOps 与生命周期抽象
- Bitzsoft.Integrations.AI.Conversation — 会话、压缩、投影、记忆与多轮工具循环
- Bitzsoft.Integrations.AI.Mcp — MCP Client/Server 双端与多租户安全治理
- Bitzsoft.Integrations.AI.Agents — Microsoft Agent Framework 统一集成
- Bitzsoft.Integrations.AI.All — AI 套件 11 个运行期包一键元包
| 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
- Bitzsoft.Integrations.AI.Abstractions (>= 1.2.0)
- Bitzsoft.Integrations.AI.Conversation (>= 1.2.0)
- Bitzsoft.Integrations.AI.Governance (>= 1.2.0)
- Bitzsoft.Integrations.AI.Skills (>= 1.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Options (>= 10.0.14)
-
net8.0
- Bitzsoft.Integrations.AI.Abstractions (>= 1.2.0)
- Bitzsoft.Integrations.AI.Conversation (>= 1.2.0)
- Bitzsoft.Integrations.AI.Governance (>= 1.2.0)
- Bitzsoft.Integrations.AI.Skills (>= 1.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Options (>= 10.0.14)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Bitzsoft.Integrations.AI.Hermes:
| Package | Downloads |
|---|---|
|
Bitzsoft.Integrations.AI.AspNetCore
ASP.NET Core AI 基础设施包 — 提供零缓冲 SSE/NDJSON 流式写出器(HITL/DryRun/Continuation/FinOps)、源生成 RFC 9457 ProblemDetails 异常映射、HttpContext 身份绑定、多模态与后台任务端点辅助,以及标注 AOT 边界的 MVC 只读工具反射发现与构建器 |
|
|
Bitzsoft.Integrations.AI.Testing
Bitzsoft AI 与 MCP 测试支持包 — 无测试框架锁定的存储端口契约测试基类、进程内测试替身、受控测试时钟与 FDE 黄金评估运行器 |
|
|
Bitzsoft.Integrations.AI.All
Bitzsoft AI 套件 1.2.0 独立运行期聚合元包 — 一键引入全部 11 个活跃 Bitzsoft.Integrations.AI.* 运行期包(不含已弃用旧包、不含 Ocr 与 AI.Testing) |
|
|
Bitzsoft.Integrations.AI.Agents
Microsoft Agent Framework 统一集成 — Provider-neutral Agent、BitzAgentBuilder、会话持久化桥接、技能与上下文供给、长任务续传、HITL 审批与迭代循环编排(替代原 Bitzsoft.Integrations.AgentFramework) |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 0 | 11/21/2026 |