@opensearch-project/agent-health 0.3.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -6
- package/cli/dist/index.js +10072 -4502
- package/deployment/cloudformation/agent-health-observability.yaml +762 -0
- package/dist/assets/index-CCQRDlO0.js +243 -0
- package/dist/assets/index-CNHQVbcj.css +1 -0
- package/dist/index.html +2 -2
- package/docs/ARCHITECTURE.md +450 -0
- package/docs/BACKEND_JOB_QUEUE.md +405 -0
- package/docs/CLAUDE_CODE_TELEMETRY.md +283 -0
- package/docs/CLI.md +431 -0
- package/docs/CODING_AGENT_ANALYTICS.md +298 -0
- package/docs/CONFIGURATION.md +388 -0
- package/docs/CONNECTORS.md +536 -0
- package/docs/INSTRUMENT_WITH_OTEL.md +390 -0
- package/docs/ML-COMMONS-SETUP.md +289 -0
- package/docs/NPX_PACKAGING.md +195 -0
- package/docs/PERFORMANCE-MONITORING.md +200 -0
- package/docs/PERFORMANCE.md +390 -0
- package/docs/PI_PROFILING.md +169 -0
- package/docs/PLAN-non-agui-agent-support.md +525 -0
- package/docs/SDK.md +577 -0
- package/docs/SKILLS.md +264 -0
- package/docs/blogs/2026-02-28-opensearch-agent-health.md +200 -0
- package/docs/blogs/getting-started-blog.md +608 -0
- package/docs/diagrams/Agent-health.excalidraw +5656 -0
- package/docs/diagrams/architecture.png +0 -0
- package/docs/plans/field-redesign.md +468 -0
- package/docs/rfcs/001-coding-agent-analytics.md +374 -0
- package/docs/rfcs/002-enterprise-leaderboard.md +267 -0
- package/docs/rfcs/003-remote-aggregation.md +146 -0
- package/docs/rfcs/004-test-sdk-v2.md +599 -0
- package/docs/skills/AGENT_HEALTH.md +598 -0
- package/docs/skills/AGENT_PROFILE.md +191 -0
- package/docs/skills/add-connector/SKILL.md +68 -0
- package/docs/skills/agent-health-profile/SKILL.md +40 -0
- package/docs/skills/config-auth/SKILL.md +194 -0
- package/docs/skills/config-auth/evals/evals.json +35 -0
- package/docs/skills/create-pr/SKILL.md +73 -0
- package/docs/skills/instrument-otel/SKILL.md +84 -0
- package/docs/skills/write-test/SKILL.md +124 -0
- package/docs/ui prd.md +376 -0
- package/examples/README.md +53 -0
- package/examples/config/agent-health.config.example.ts +155 -0
- package/examples/connectors/echo-connector.ts +131 -0
- package/examples/eval-files/demo.eval.js +128 -0
- package/examples/eval-files/sdk-hooks-demo.eval.js +99 -0
- package/examples/pi-profiling/README.md +77 -0
- package/examples/pi-profiling/agent-health-profile.ts +417 -0
- package/lib/dist/lib/agentUtils.d.ts +29 -0
- package/lib/dist/lib/agentUtils.d.ts.map +1 -0
- package/lib/dist/lib/agentUtils.js +43 -0
- package/lib/dist/lib/agentUtils.js.map +1 -0
- package/lib/dist/lib/benchmarkExport.d.ts +14 -0
- package/lib/dist/lib/benchmarkExport.d.ts.map +1 -0
- package/lib/dist/lib/benchmarkExport.js +41 -0
- package/lib/dist/lib/benchmarkExport.js.map +1 -0
- package/lib/dist/lib/benchmarkVersionUtils.d.ts +37 -0
- package/lib/dist/lib/benchmarkVersionUtils.d.ts.map +1 -0
- package/lib/dist/lib/benchmarkVersionUtils.js +68 -0
- package/lib/dist/lib/benchmarkVersionUtils.js.map +1 -0
- package/lib/dist/lib/config/defineConfig.d.ts +27 -0
- package/lib/dist/lib/config/defineConfig.d.ts.map +1 -0
- package/lib/dist/lib/config/defineConfig.js +28 -0
- package/lib/dist/lib/config/defineConfig.js.map +1 -0
- package/lib/dist/lib/config/index.d.ts +9 -0
- package/lib/dist/lib/config/index.d.ts.map +1 -0
- package/lib/dist/lib/config/index.js +8 -0
- package/lib/dist/lib/config/index.js.map +1 -0
- package/lib/dist/lib/config/loader.d.ts +39 -0
- package/lib/dist/lib/config/loader.d.ts.map +1 -0
- package/lib/dist/lib/config/loader.js +258 -0
- package/lib/dist/lib/config/loader.js.map +1 -0
- package/lib/dist/lib/config/statePaths.d.ts +61 -0
- package/lib/dist/lib/config/statePaths.d.ts.map +1 -0
- package/lib/dist/lib/config/statePaths.js +188 -0
- package/lib/dist/lib/config/statePaths.js.map +1 -0
- package/lib/dist/lib/config/types.d.ts +231 -0
- package/lib/dist/lib/config/types.d.ts.map +1 -0
- package/lib/dist/lib/config/types.js +6 -0
- package/lib/dist/lib/config/types.js.map +1 -0
- package/lib/dist/lib/config.d.ts +39 -0
- package/lib/dist/lib/config.d.ts.map +1 -0
- package/lib/dist/lib/config.js +118 -0
- package/lib/dist/lib/config.js.map +1 -0
- package/lib/dist/lib/constants.d.ts +70 -0
- package/lib/dist/lib/constants.d.ts.map +1 -0
- package/lib/dist/lib/constants.js +365 -0
- package/lib/dist/lib/constants.js.map +1 -0
- package/lib/dist/lib/contextUtilization.d.ts +23 -0
- package/lib/dist/lib/contextUtilization.d.ts.map +1 -0
- package/lib/dist/lib/contextUtilization.js +72 -0
- package/lib/dist/lib/contextUtilization.js.map +1 -0
- package/lib/dist/lib/dashboardMetrics.d.ts +87 -0
- package/lib/dist/lib/dashboardMetrics.d.ts.map +1 -0
- package/lib/dist/lib/dashboardMetrics.js +242 -0
- package/lib/dist/lib/dashboardMetrics.js.map +1 -0
- package/lib/dist/lib/dataSourceConfig.d.ts +108 -0
- package/lib/dist/lib/dataSourceConfig.d.ts.map +1 -0
- package/lib/dist/lib/dataSourceConfig.js +166 -0
- package/lib/dist/lib/dataSourceConfig.js.map +1 -0
- package/lib/dist/lib/debug.d.ts +26 -0
- package/lib/dist/lib/debug.d.ts.map +1 -0
- package/lib/dist/lib/debug.js +132 -0
- package/lib/dist/lib/debug.js.map +1 -0
- package/lib/dist/lib/diagnostics.d.ts +28 -0
- package/lib/dist/lib/diagnostics.d.ts.map +1 -0
- package/lib/dist/lib/diagnostics.js +65 -0
- package/lib/dist/lib/diagnostics.js.map +1 -0
- package/lib/dist/lib/envCompat.d.ts +27 -0
- package/lib/dist/lib/envCompat.d.ts.map +1 -0
- package/lib/dist/lib/envCompat.js +73 -0
- package/lib/dist/lib/envCompat.js.map +1 -0
- package/lib/dist/lib/findPackageRoot.d.ts +7 -0
- package/lib/dist/lib/findPackageRoot.d.ts.map +1 -0
- package/lib/dist/lib/findPackageRoot.js +57 -0
- package/lib/dist/lib/findPackageRoot.js.map +1 -0
- package/lib/dist/lib/hooks.d.ts +36 -0
- package/lib/dist/lib/hooks.d.ts.map +1 -0
- package/lib/dist/lib/hooks.js +112 -0
- package/lib/dist/lib/hooks.js.map +1 -0
- package/lib/dist/lib/index.d.ts +47 -0
- package/lib/dist/lib/index.d.ts.map +1 -0
- package/lib/dist/lib/index.js +62 -0
- package/lib/dist/lib/index.js.map +1 -0
- package/lib/dist/lib/labels.d.ts +90 -0
- package/lib/dist/lib/labels.d.ts.map +1 -0
- package/lib/dist/lib/labels.js +158 -0
- package/lib/dist/lib/labels.js.map +1 -0
- package/lib/dist/lib/markdown.d.ts +16 -0
- package/lib/dist/lib/markdown.d.ts.map +1 -0
- package/lib/dist/lib/markdown.js +42 -0
- package/lib/dist/lib/markdown.js.map +1 -0
- package/lib/dist/lib/matchers/expect.d.ts +3 -0
- package/lib/dist/lib/matchers/expect.d.ts.map +1 -0
- package/lib/dist/lib/matchers/expect.js +225 -0
- package/lib/dist/lib/matchers/expect.js.map +1 -0
- package/lib/dist/lib/matchers/index.d.ts +8 -0
- package/lib/dist/lib/matchers/index.d.ts.map +1 -0
- package/lib/dist/lib/matchers/index.js +9 -0
- package/lib/dist/lib/matchers/index.js.map +1 -0
- package/lib/dist/lib/matchers/judgeAccessor.d.ts +113 -0
- package/lib/dist/lib/matchers/judgeAccessor.d.ts.map +1 -0
- package/lib/dist/lib/matchers/judgeAccessor.js +183 -0
- package/lib/dist/lib/matchers/judgeAccessor.js.map +1 -0
- package/lib/dist/lib/matchers/session.d.ts +39 -0
- package/lib/dist/lib/matchers/session.d.ts.map +1 -0
- package/lib/dist/lib/matchers/session.js +116 -0
- package/lib/dist/lib/matchers/session.js.map +1 -0
- package/lib/dist/lib/matchers/traces.d.ts +55 -0
- package/lib/dist/lib/matchers/traces.d.ts.map +1 -0
- package/lib/dist/lib/matchers/traces.js +116 -0
- package/lib/dist/lib/matchers/traces.js.map +1 -0
- package/lib/dist/lib/matchers/types.d.ts +75 -0
- package/lib/dist/lib/matchers/types.d.ts.map +1 -0
- package/lib/dist/lib/matchers/types.js +6 -0
- package/lib/dist/lib/matchers/types.js.map +1 -0
- package/lib/dist/lib/packagePaths.d.ts +29 -0
- package/lib/dist/lib/packagePaths.d.ts.map +1 -0
- package/lib/dist/lib/packagePaths.js +63 -0
- package/lib/dist/lib/packagePaths.js.map +1 -0
- package/lib/dist/lib/performance.d.ts +51 -0
- package/lib/dist/lib/performance.d.ts.map +1 -0
- package/lib/dist/lib/performance.js +159 -0
- package/lib/dist/lib/performance.js.map +1 -0
- package/lib/dist/lib/portConfig.d.ts +29 -0
- package/lib/dist/lib/portConfig.d.ts.map +1 -0
- package/lib/dist/lib/portConfig.js +64 -0
- package/lib/dist/lib/portConfig.js.map +1 -0
- package/lib/dist/lib/preferences.d.ts +63 -0
- package/lib/dist/lib/preferences.d.ts.map +1 -0
- package/lib/dist/lib/preferences.js +117 -0
- package/lib/dist/lib/preferences.js.map +1 -0
- package/lib/dist/lib/resolveAgentModel.d.ts +22 -0
- package/lib/dist/lib/resolveAgentModel.d.ts.map +1 -0
- package/lib/dist/lib/resolveAgentModel.js +37 -0
- package/lib/dist/lib/resolveAgentModel.js.map +1 -0
- package/lib/dist/lib/runStats.d.ts +92 -0
- package/lib/dist/lib/runStats.d.ts.map +1 -0
- package/lib/dist/lib/runStats.js +160 -0
- package/lib/dist/lib/runStats.js.map +1 -0
- package/lib/dist/lib/telemetry/constants.d.ts +60 -0
- package/lib/dist/lib/telemetry/constants.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/constants.js +87 -0
- package/lib/dist/lib/telemetry/constants.js.map +1 -0
- package/lib/dist/lib/telemetry/evalSpans.d.ts +61 -0
- package/lib/dist/lib/telemetry/evalSpans.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/evalSpans.js +254 -0
- package/lib/dist/lib/telemetry/evalSpans.js.map +1 -0
- package/lib/dist/lib/telemetry/index.d.ts +11 -0
- package/lib/dist/lib/telemetry/index.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/index.js +15 -0
- package/lib/dist/lib/telemetry/index.js.map +1 -0
- package/lib/dist/lib/telemetry/opensearchExporter.d.ts +43 -0
- package/lib/dist/lib/telemetry/opensearchExporter.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/opensearchExporter.js +217 -0
- package/lib/dist/lib/telemetry/opensearchExporter.js.map +1 -0
- package/lib/dist/lib/telemetry/provider.d.ts +55 -0
- package/lib/dist/lib/telemetry/provider.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/provider.js +140 -0
- package/lib/dist/lib/telemetry/provider.js.map +1 -0
- package/lib/dist/lib/testCaseLabels.d.ts +34 -0
- package/lib/dist/lib/testCaseLabels.d.ts.map +1 -0
- package/lib/dist/lib/testCaseLabels.js +88 -0
- package/lib/dist/lib/testCaseLabels.js.map +1 -0
- package/lib/dist/lib/testCaseValidation.d.ts +140 -0
- package/lib/dist/lib/testCaseValidation.d.ts.map +1 -0
- package/lib/dist/lib/testCaseValidation.js +162 -0
- package/lib/dist/lib/testCaseValidation.js.map +1 -0
- package/lib/dist/lib/testCases/agentFixture.d.ts +80 -0
- package/lib/dist/lib/testCases/agentFixture.d.ts.map +1 -0
- package/lib/dist/lib/testCases/agentFixture.js +43 -0
- package/lib/dist/lib/testCases/agentFixture.js.map +1 -0
- package/lib/dist/lib/testCases/authoringSurface.d.ts +10 -0
- package/lib/dist/lib/testCases/authoringSurface.d.ts.map +1 -0
- package/lib/dist/lib/testCases/authoringSurface.js +54 -0
- package/lib/dist/lib/testCases/authoringSurface.js.map +1 -0
- package/lib/dist/lib/testCases/codemod.d.ts +13 -0
- package/lib/dist/lib/testCases/codemod.d.ts.map +1 -0
- package/lib/dist/lib/testCases/codemod.js +169 -0
- package/lib/dist/lib/testCases/codemod.js.map +1 -0
- package/lib/dist/lib/testCases/define.d.ts +114 -0
- package/lib/dist/lib/testCases/define.d.ts.map +1 -0
- package/lib/dist/lib/testCases/define.js +253 -0
- package/lib/dist/lib/testCases/define.js.map +1 -0
- package/lib/dist/lib/testCases/evaluators.d.ts +80 -0
- package/lib/dist/lib/testCases/evaluators.d.ts.map +1 -0
- package/lib/dist/lib/testCases/evaluators.js +105 -0
- package/lib/dist/lib/testCases/evaluators.js.map +1 -0
- package/lib/dist/lib/testCases/index.d.ts +14 -0
- package/lib/dist/lib/testCases/index.d.ts.map +1 -0
- package/lib/dist/lib/testCases/index.js +12 -0
- package/lib/dist/lib/testCases/index.js.map +1 -0
- package/lib/dist/lib/testCases/judge.d.ts +165 -0
- package/lib/dist/lib/testCases/judge.d.ts.map +1 -0
- package/lib/dist/lib/testCases/judge.js +359 -0
- package/lib/dist/lib/testCases/judge.js.map +1 -0
- package/lib/dist/lib/testCases/loader.d.ts +26 -0
- package/lib/dist/lib/testCases/loader.d.ts.map +1 -0
- package/lib/dist/lib/testCases/loader.js +149 -0
- package/lib/dist/lib/testCases/loader.js.map +1 -0
- package/lib/dist/lib/testCases/types.d.ts +242 -0
- package/lib/dist/lib/testCases/types.d.ts.map +1 -0
- package/lib/dist/lib/testCases/types.js +6 -0
- package/lib/dist/lib/testCases/types.js.map +1 -0
- package/lib/dist/lib/theme.d.ts +6 -0
- package/lib/dist/lib/theme.d.ts.map +1 -0
- package/lib/dist/lib/theme.js +36 -0
- package/lib/dist/lib/theme.js.map +1 -0
- package/lib/dist/lib/uiTelemetry.d.ts +7 -0
- package/lib/dist/lib/uiTelemetry.d.ts.map +1 -0
- package/lib/dist/lib/uiTelemetry.js +25 -0
- package/lib/dist/lib/uiTelemetry.js.map +1 -0
- package/lib/dist/lib/utils.d.ts +96 -0
- package/lib/dist/lib/utils.d.ts.map +1 -0
- package/lib/dist/lib/utils.js +232 -0
- package/lib/dist/lib/utils.js.map +1 -0
- package/lib/dist/lib/workflow/consolidate.d.ts +12 -0
- package/lib/dist/lib/workflow/consolidate.d.ts.map +1 -0
- package/lib/dist/lib/workflow/consolidate.js +33 -0
- package/lib/dist/lib/workflow/consolidate.js.map +1 -0
- package/lib/dist/lib/workflow/index.d.ts +13 -0
- package/lib/dist/lib/workflow/index.d.ts.map +1 -0
- package/lib/dist/lib/workflow/index.js +12 -0
- package/lib/dist/lib/workflow/index.js.map +1 -0
- package/lib/dist/lib/workflow/ledger.d.ts +30 -0
- package/lib/dist/lib/workflow/ledger.d.ts.map +1 -0
- package/lib/dist/lib/workflow/ledger.js +41 -0
- package/lib/dist/lib/workflow/ledger.js.map +1 -0
- package/lib/dist/lib/workflow/pool.d.ts +13 -0
- package/lib/dist/lib/workflow/pool.d.ts.map +1 -0
- package/lib/dist/lib/workflow/pool.js +44 -0
- package/lib/dist/lib/workflow/pool.js.map +1 -0
- package/lib/dist/lib/workflow/source.d.ts +22 -0
- package/lib/dist/lib/workflow/source.d.ts.map +1 -0
- package/lib/dist/lib/workflow/source.js +29 -0
- package/lib/dist/lib/workflow/source.js.map +1 -0
- package/lib/dist/lib/workflow/stepB.d.ts +71 -0
- package/lib/dist/lib/workflow/stepB.d.ts.map +1 -0
- package/lib/dist/lib/workflow/stepB.js +99 -0
- package/lib/dist/lib/workflow/stepB.js.map +1 -0
- package/lib/dist/lib/workflow/types.d.ts +86 -0
- package/lib/dist/lib/workflow/types.d.ts.map +1 -0
- package/lib/dist/lib/workflow/types.js +6 -0
- package/lib/dist/lib/workflow/types.js.map +1 -0
- package/lib/dist/lib/workflow/workflow.d.ts +119 -0
- package/lib/dist/lib/workflow/workflow.d.ts.map +1 -0
- package/lib/dist/lib/workflow/workflow.js +195 -0
- package/lib/dist/lib/workflow/workflow.js.map +1 -0
- package/lib/dist/services/agent/aguiConverter.d.ts +50 -0
- package/lib/dist/services/agent/aguiConverter.d.ts.map +1 -0
- package/lib/dist/services/agent/aguiConverter.js +449 -0
- package/lib/dist/services/agent/aguiConverter.js.map +1 -0
- package/lib/dist/services/agent/index.d.ts +10 -0
- package/lib/dist/services/agent/index.d.ts.map +1 -0
- package/lib/dist/services/agent/index.js +12 -0
- package/lib/dist/services/agent/index.js.map +1 -0
- package/lib/dist/services/agent/payloadBuilder.d.ts +33 -0
- package/lib/dist/services/agent/payloadBuilder.d.ts.map +1 -0
- package/lib/dist/services/agent/payloadBuilder.js +75 -0
- package/lib/dist/services/agent/payloadBuilder.js.map +1 -0
- package/lib/dist/services/agent/sseStream.d.ts +43 -0
- package/lib/dist/services/agent/sseStream.d.ts.map +1 -0
- package/lib/dist/services/agent/sseStream.js +223 -0
- package/lib/dist/services/agent/sseStream.js.map +1 -0
- package/lib/dist/services/connectors/agui/AGUIStreamingConnector.d.ts +44 -0
- package/lib/dist/services/connectors/agui/AGUIStreamingConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/agui/AGUIStreamingConnector.js +95 -0
- package/lib/dist/services/connectors/agui/AGUIStreamingConnector.js.map +1 -0
- package/lib/dist/services/connectors/base/BaseConnector.d.ts +81 -0
- package/lib/dist/services/connectors/base/BaseConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/base/BaseConnector.js +170 -0
- package/lib/dist/services/connectors/base/BaseConnector.js.map +1 -0
- package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.d.ts +116 -0
- package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.js +403 -0
- package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.js.map +1 -0
- package/lib/dist/services/connectors/index.d.ts +13 -0
- package/lib/dist/services/connectors/index.d.ts.map +1 -0
- package/lib/dist/services/connectors/index.js +32 -0
- package/lib/dist/services/connectors/index.js.map +1 -0
- package/lib/dist/services/connectors/kiro/KiroConnector.d.ts +48 -0
- package/lib/dist/services/connectors/kiro/KiroConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/kiro/KiroConnector.js +158 -0
- package/lib/dist/services/connectors/kiro/KiroConnector.js.map +1 -0
- package/lib/dist/services/connectors/langgraph/LangGraphConnector.d.ts +36 -0
- package/lib/dist/services/connectors/langgraph/LangGraphConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/langgraph/LangGraphConnector.js +175 -0
- package/lib/dist/services/connectors/langgraph/LangGraphConnector.js.map +1 -0
- package/lib/dist/services/connectors/mock/MockConnector.d.ts +37 -0
- package/lib/dist/services/connectors/mock/MockConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/mock/MockConnector.js +120 -0
- package/lib/dist/services/connectors/mock/MockConnector.js.map +1 -0
- package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.d.ts +42 -0
- package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.js +133 -0
- package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.js.map +1 -0
- package/lib/dist/services/connectors/pi/PiConnector.d.ts +87 -0
- package/lib/dist/services/connectors/pi/PiConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/pi/PiConnector.js +274 -0
- package/lib/dist/services/connectors/pi/PiConnector.js.map +1 -0
- package/lib/dist/services/connectors/registry.d.ts +57 -0
- package/lib/dist/services/connectors/registry.d.ts.map +1 -0
- package/lib/dist/services/connectors/registry.js +106 -0
- package/lib/dist/services/connectors/registry.js.map +1 -0
- package/lib/dist/services/connectors/rest/RESTConnector.d.ts +38 -0
- package/lib/dist/services/connectors/rest/RESTConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/rest/RESTConnector.js +117 -0
- package/lib/dist/services/connectors/rest/RESTConnector.js.map +1 -0
- package/lib/dist/services/connectors/server.d.ts +13 -0
- package/lib/dist/services/connectors/server.d.ts.map +1 -0
- package/lib/dist/services/connectors/server.js +34 -0
- package/lib/dist/services/connectors/server.js.map +1 -0
- package/lib/dist/services/connectors/strands/StrandsConnector.d.ts +48 -0
- package/lib/dist/services/connectors/strands/StrandsConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/strands/StrandsConnector.js +221 -0
- package/lib/dist/services/connectors/strands/StrandsConnector.js.map +1 -0
- package/lib/dist/services/connectors/subprocess/SubprocessConnector.d.ts +88 -0
- package/lib/dist/services/connectors/subprocess/SubprocessConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/subprocess/SubprocessConnector.js +418 -0
- package/lib/dist/services/connectors/subprocess/SubprocessConnector.js.map +1 -0
- package/lib/dist/services/connectors/types.d.ts +213 -0
- package/lib/dist/services/connectors/types.d.ts.map +1 -0
- package/lib/dist/services/connectors/types.js +6 -0
- package/lib/dist/services/connectors/types.js.map +1 -0
- package/lib/dist/services/evaluation/bedrockJudge.d.ts +64 -0
- package/lib/dist/services/evaluation/bedrockJudge.d.ts.map +1 -0
- package/lib/dist/services/evaluation/bedrockJudge.js +167 -0
- package/lib/dist/services/evaluation/bedrockJudge.js.map +1 -0
- package/lib/dist/services/evaluation/evaluatorError.d.ts +56 -0
- package/lib/dist/services/evaluation/evaluatorError.d.ts.map +1 -0
- package/lib/dist/services/evaluation/evaluatorError.js +56 -0
- package/lib/dist/services/evaluation/evaluatorError.js.map +1 -0
- package/lib/dist/services/evaluation/index.d.ts +106 -0
- package/lib/dist/services/evaluation/index.d.ts.map +1 -0
- package/lib/dist/services/evaluation/index.js +684 -0
- package/lib/dist/services/evaluation/index.js.map +1 -0
- package/lib/dist/services/evaluation/mockTrajectory.d.ts +3 -0
- package/lib/dist/services/evaluation/mockTrajectory.d.ts.map +1 -0
- package/lib/dist/services/evaluation/mockTrajectory.js +72 -0
- package/lib/dist/services/evaluation/mockTrajectory.js.map +1 -0
- package/lib/dist/services/opensearch/client.d.ts +26 -0
- package/lib/dist/services/opensearch/client.d.ts.map +1 -0
- package/lib/dist/services/opensearch/client.js +131 -0
- package/lib/dist/services/opensearch/client.js.map +1 -0
- package/lib/dist/services/opensearch/index.d.ts +16 -0
- package/lib/dist/services/opensearch/index.d.ts.map +1 -0
- package/lib/dist/services/opensearch/index.js +25 -0
- package/lib/dist/services/opensearch/index.js.map +1 -0
- package/lib/dist/services/storage/asyncBenchmarkStorage.d.ts +123 -0
- package/lib/dist/services/storage/asyncBenchmarkStorage.d.ts.map +1 -0
- package/lib/dist/services/storage/asyncBenchmarkStorage.js +429 -0
- package/lib/dist/services/storage/asyncBenchmarkStorage.js.map +1 -0
- package/lib/dist/services/storage/asyncRunStorage.d.ts +127 -0
- package/lib/dist/services/storage/asyncRunStorage.d.ts.map +1 -0
- package/lib/dist/services/storage/asyncRunStorage.js +448 -0
- package/lib/dist/services/storage/asyncRunStorage.js.map +1 -0
- package/lib/dist/services/storage/asyncTestCaseStorage.d.ts +156 -0
- package/lib/dist/services/storage/asyncTestCaseStorage.d.ts.map +1 -0
- package/lib/dist/services/storage/asyncTestCaseStorage.js +285 -0
- package/lib/dist/services/storage/asyncTestCaseStorage.js.map +1 -0
- package/lib/dist/services/storage/index.d.ts +17 -0
- package/lib/dist/services/storage/index.d.ts.map +1 -0
- package/lib/dist/services/storage/index.js +20 -0
- package/lib/dist/services/storage/index.js.map +1 -0
- package/lib/dist/services/storage/migration.d.ts +54 -0
- package/lib/dist/services/storage/migration.d.ts.map +1 -0
- package/lib/dist/services/storage/migration.js +296 -0
- package/lib/dist/services/storage/migration.js.map +1 -0
- package/lib/dist/services/storage/opensearchClient.d.ts +924 -0
- package/lib/dist/services/storage/opensearchClient.d.ts.map +1 -0
- package/lib/dist/services/storage/opensearchClient.js +435 -0
- package/lib/dist/services/storage/opensearchClient.js.map +1 -0
- package/lib/dist/services/traces/browserRecovery.d.ts +26 -0
- package/lib/dist/services/traces/browserRecovery.d.ts.map +1 -0
- package/lib/dist/services/traces/browserRecovery.js +81 -0
- package/lib/dist/services/traces/browserRecovery.js.map +1 -0
- package/lib/dist/services/traces/categoryStyles.d.ts +21 -0
- package/lib/dist/services/traces/categoryStyles.d.ts.map +1 -0
- package/lib/dist/services/traces/categoryStyles.js +56 -0
- package/lib/dist/services/traces/categoryStyles.js.map +1 -0
- package/lib/dist/services/traces/executionOrderTransform.d.ts +35 -0
- package/lib/dist/services/traces/executionOrderTransform.d.ts.map +1 -0
- package/lib/dist/services/traces/executionOrderTransform.js +313 -0
- package/lib/dist/services/traces/executionOrderTransform.js.map +1 -0
- package/lib/dist/services/traces/fetchSpansForRun.d.ts +86 -0
- package/lib/dist/services/traces/fetchSpansForRun.d.ts.map +1 -0
- package/lib/dist/services/traces/fetchSpansForRun.js +69 -0
- package/lib/dist/services/traces/fetchSpansForRun.js.map +1 -0
- package/lib/dist/services/traces/flowTransform.d.ts +24 -0
- package/lib/dist/services/traces/flowTransform.d.ts.map +1 -0
- package/lib/dist/services/traces/flowTransform.js +228 -0
- package/lib/dist/services/traces/flowTransform.js.map +1 -0
- package/lib/dist/services/traces/index.d.ts +121 -0
- package/lib/dist/services/traces/index.d.ts.map +1 -0
- package/lib/dist/services/traces/index.js +255 -0
- package/lib/dist/services/traces/index.js.map +1 -0
- package/lib/dist/services/traces/intentTransform.d.ts +20 -0
- package/lib/dist/services/traces/intentTransform.d.ts.map +1 -0
- package/lib/dist/services/traces/intentTransform.js +131 -0
- package/lib/dist/services/traces/intentTransform.js.map +1 -0
- package/lib/dist/services/traces/judgeAgentsHints.d.ts +63 -0
- package/lib/dist/services/traces/judgeAgentsHints.d.ts.map +1 -0
- package/lib/dist/services/traces/judgeAgentsHints.js +89 -0
- package/lib/dist/services/traces/judgeAgentsHints.js.map +1 -0
- package/lib/dist/services/traces/messageExtraction.d.ts +15 -0
- package/lib/dist/services/traces/messageExtraction.d.ts.map +1 -0
- package/lib/dist/services/traces/messageExtraction.js +251 -0
- package/lib/dist/services/traces/messageExtraction.js.map +1 -0
- package/lib/dist/services/traces/spanCategorization.d.ts +63 -0
- package/lib/dist/services/traces/spanCategorization.d.ts.map +1 -0
- package/lib/dist/services/traces/spanCategorization.js +276 -0
- package/lib/dist/services/traces/spanCategorization.js.map +1 -0
- package/lib/dist/services/traces/spanPreprocessing.d.ts +37 -0
- package/lib/dist/services/traces/spanPreprocessing.d.ts.map +1 -0
- package/lib/dist/services/traces/spanPreprocessing.js +102 -0
- package/lib/dist/services/traces/spanPreprocessing.js.map +1 -0
- package/lib/dist/services/traces/spansToTrajectory.d.ts +36 -0
- package/lib/dist/services/traces/spansToTrajectory.d.ts.map +1 -0
- package/lib/dist/services/traces/spansToTrajectory.js +387 -0
- package/lib/dist/services/traces/spansToTrajectory.js.map +1 -0
- package/lib/dist/services/traces/toolSimilarity.d.ts +35 -0
- package/lib/dist/services/traces/toolSimilarity.d.ts.map +1 -0
- package/lib/dist/services/traces/toolSimilarity.js +203 -0
- package/lib/dist/services/traces/toolSimilarity.js.map +1 -0
- package/lib/dist/services/traces/traceComparison.d.ts +31 -0
- package/lib/dist/services/traces/traceComparison.d.ts.map +1 -0
- package/lib/dist/services/traces/traceComparison.js +318 -0
- package/lib/dist/services/traces/traceComparison.js.map +1 -0
- package/lib/dist/services/traces/traceGrouping.d.ts +19 -0
- package/lib/dist/services/traces/traceGrouping.d.ts.map +1 -0
- package/lib/dist/services/traces/traceGrouping.js +107 -0
- package/lib/dist/services/traces/traceGrouping.js.map +1 -0
- package/lib/dist/services/traces/tracePoller.d.ts +84 -0
- package/lib/dist/services/traces/tracePoller.d.ts.map +1 -0
- package/lib/dist/services/traces/tracePoller.js +309 -0
- package/lib/dist/services/traces/tracePoller.js.map +1 -0
- package/lib/dist/services/traces/traceStats.d.ts +45 -0
- package/lib/dist/services/traces/traceStats.d.ts.map +1 -0
- package/lib/dist/services/traces/traceStats.js +114 -0
- package/lib/dist/services/traces/traceStats.js.map +1 -0
- package/lib/dist/services/traces/traceSummary.d.ts +47 -0
- package/lib/dist/services/traces/traceSummary.d.ts.map +1 -0
- package/lib/dist/services/traces/traceSummary.js +68 -0
- package/lib/dist/services/traces/traceSummary.js.map +1 -0
- package/lib/dist/services/traces/utils.d.ts +33 -0
- package/lib/dist/services/traces/utils.d.ts.map +1 -0
- package/lib/dist/services/traces/utils.js +114 -0
- package/lib/dist/services/traces/utils.js.map +1 -0
- package/lib/dist/types/agui.d.ts +13 -0
- package/lib/dist/types/agui.d.ts.map +1 -0
- package/lib/dist/types/agui.js +16 -0
- package/lib/dist/types/agui.js.map +1 -0
- package/lib/dist/types/index.d.ts +1175 -0
- package/lib/dist/types/index.d.ts.map +1 -0
- package/lib/dist/types/index.js +12 -0
- package/lib/dist/types/index.js.map +1 -0
- package/lib/dist/types/skills.d.ts +146 -0
- package/lib/dist/types/skills.d.ts.map +1 -0
- package/lib/dist/types/skills.js +6 -0
- package/lib/dist/types/skills.js.map +1 -0
- package/observio-sample-agent/pi-package/README.md +112 -0
- package/observio-sample-agent/pi-package/extensions/agent-health.ts +373 -0
- package/observio-sample-agent/pi-package/package.json +17 -0
- package/observio-sample-agent/pi-package/prompts/agent-health.md +37 -0
- package/observio-sample-agent/pi-package/skills/create-pr/SKILL.md +88 -0
- package/observio-sample-agent/pi-package/skills/fix-bug/SKILL.md +71 -0
- package/observio-sample-agent/pi-package/skills/implement-feature/SKILL.md +156 -0
- package/observio-sample-agent/pi-package/skills/instrument-otel/SKILL.md +208 -0
- package/observio-sample-agent/pi-package/skills/setup-collector/SKILL.md +146 -0
- package/observio-sample-agent/pi-package/skills/write-test/SKILL.md +115 -0
- package/package.json +64 -13
- package/server/dist/app.js +32651 -17637
- package/server/dist/index.js +29875 -14638
- package/tsconfig.lib.json +71 -0
- package/dist/assets/index-EvPLSTAS.js +0 -267
- package/dist/assets/index-RXasQKUs.css +0 -1
- package/lib/dist/config/index.js +0 -404
- package/lib/dist/index.js +0 -1665
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
# Agent Health - AI Assistant Instructions
|
|
2
|
+
|
|
3
|
+
Use these instructions to evaluate and improve your agent using the agent-health CLI and server APIs.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Setup By AI Assistant
|
|
8
|
+
|
|
9
|
+
Copy this file into your project so your AI coding assistant auto-loads it —
|
|
10
|
+
either from a local checkout or straight from GitHub.
|
|
11
|
+
|
|
12
|
+
### Claude Code
|
|
13
|
+
```bash
|
|
14
|
+
mkdir -p .claude/skills
|
|
15
|
+
curl -o .claude/skills/agent-health.md \
|
|
16
|
+
https://raw.githubusercontent.com/opensearch-project/agent-health/main/docs/skills/AGENT_HEALTH.md
|
|
17
|
+
# or, from a checkout: cp docs/skills/AGENT_HEALTH.md .claude/skills/
|
|
18
|
+
```
|
|
19
|
+
Auto-discovered as a skill.
|
|
20
|
+
|
|
21
|
+
### Kiro
|
|
22
|
+
```bash
|
|
23
|
+
mkdir -p .kiro/steering
|
|
24
|
+
curl -o .kiro/steering/agent-health.md \
|
|
25
|
+
https://raw.githubusercontent.com/opensearch-project/agent-health/main/docs/skills/AGENT_HEALTH.md
|
|
26
|
+
```
|
|
27
|
+
Auto-loaded as a steering file.
|
|
28
|
+
|
|
29
|
+
### Cursor / Windsurf / Others
|
|
30
|
+
Copy to project root, then tell your assistant: "Read AGENT_HEALTH.md and follow it"
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick start — what to ask your assistant
|
|
35
|
+
|
|
36
|
+
Once this file is loaded, just ask:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
"Evaluate my agent using agent-health and fix any failures"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or step by step:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
"Run an agent-health benchmark against my agent"
|
|
46
|
+
"What failed and why?"
|
|
47
|
+
"Fix the high-priority issues"
|
|
48
|
+
"Re-run to verify"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
What happens under the hood:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
1. Assistant runs: npx agent-health benchmark ...
|
|
55
|
+
↓
|
|
56
|
+
2. Gets JSON with failures + judge feedback (matcherResults + improvementStrategies)
|
|
57
|
+
↓
|
|
58
|
+
3. Reads your agent code
|
|
59
|
+
↓
|
|
60
|
+
4. Makes fixes based on the improvement strategies
|
|
61
|
+
↓
|
|
62
|
+
5. Re-runs the benchmark to verify
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Prerequisites
|
|
68
|
+
|
|
69
|
+
### Storage (file-based by default; OpenSearch optional)
|
|
70
|
+
|
|
71
|
+
Agent Health uses **file-based storage by default** — results are written to a
|
|
72
|
+
local `.agent-health/data/` directory and `run` / `benchmark` work with **no
|
|
73
|
+
OpenSearch cluster required**. Point at OpenSearch only when you want shared,
|
|
74
|
+
production-grade persistence (multiple machines / a team dashboard).
|
|
75
|
+
|
|
76
|
+
To use OpenSearch instead of file storage, set:
|
|
77
|
+
|
|
78
|
+
| Variable | Description |
|
|
79
|
+
|---|---|
|
|
80
|
+
| `OPENSEARCH_STORAGE_ENDPOINT` | OpenSearch cluster URL (e.g. `https://search-my-cluster.us-west-2.es.amazonaws.com`) |
|
|
81
|
+
| `OPENSEARCH_STORAGE_USERNAME` | OpenSearch username (basic auth) |
|
|
82
|
+
| `OPENSEARCH_STORAGE_PASSWORD` | OpenSearch password (basic auth) |
|
|
83
|
+
|
|
84
|
+
SigV4 auth (AWS profile **or** the default credential chain; `es` domains or
|
|
85
|
+
`aoss` Serverless collections), `none` (no auth), and basic auth are all
|
|
86
|
+
supported, configurable via env vars, `agent-health.config.json`, or the
|
|
87
|
+
Settings UI — see [docs/CONFIGURATION.md](https://github.com/opensearch-project/agent-health/blob/main/docs/CONFIGURATION.md).
|
|
88
|
+
|
|
89
|
+
### AWS Credentials for LLM Judge (Required)
|
|
90
|
+
|
|
91
|
+
The Bedrock LLM judge scores evaluation results and needs AWS credentials to call Bedrock.
|
|
92
|
+
|
|
93
|
+
| Variable | Description |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `AWS_PROFILE` | AWS profile with Bedrock access |
|
|
96
|
+
| `AWS_REGION` | AWS region for Bedrock (e.g. `us-west-2`) |
|
|
97
|
+
| `BEDROCK_MODEL_ID` | *(Optional)* Default judge model ID. Default: `us.anthropic.claude-sonnet-4-5-20250929-v1:0` |
|
|
98
|
+
|
|
99
|
+
### `.env` File
|
|
100
|
+
|
|
101
|
+
The CLI automatically loads a `.env` file from the current working directory (the folder where commands are run). Create a `.env` file with all required variables:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# OpenSearch Storage
|
|
105
|
+
OPENSEARCH_STORAGE_ENDPOINT=https://search-my-cluster.us-west-2.es.amazonaws.com
|
|
106
|
+
OPENSEARCH_STORAGE_USERNAME=admin
|
|
107
|
+
OPENSEARCH_STORAGE_PASSWORD=your-password
|
|
108
|
+
|
|
109
|
+
# AWS / Bedrock
|
|
110
|
+
AWS_PROFILE=your-aws-profile
|
|
111
|
+
AWS_REGION=us-west-2
|
|
112
|
+
# BEDROCK_MODEL_ID=us.anthropic.claude-sonnet-4-5-20250929-v1:0 # optional, this is the default
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Alternatively, pass `--env-file <path>` to load a `.env` file from a different location.
|
|
116
|
+
|
|
117
|
+
### Doctor Check
|
|
118
|
+
|
|
119
|
+
After configuring your environment, verify everything is set up correctly:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npx @opensearch-project/agent-health doctor
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
This checks OpenSearch connectivity, AWS credentials, and Bedrock access. Fix any reported issues before proceeding.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Commands
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Verify setup
|
|
133
|
+
npx @opensearch-project/agent-health doctor --output json
|
|
134
|
+
|
|
135
|
+
# Generate config files
|
|
136
|
+
npx @opensearch-project/agent-health init
|
|
137
|
+
|
|
138
|
+
# List available resources
|
|
139
|
+
npx @opensearch-project/agent-health list agents --output json
|
|
140
|
+
npx @opensearch-project/agent-health list test-cases --output json
|
|
141
|
+
npx @opensearch-project/agent-health list benchmarks --output json
|
|
142
|
+
|
|
143
|
+
# Run single test case
|
|
144
|
+
npx @opensearch-project/agent-health run -t <test-case-id> -a <agent-key> --output json
|
|
145
|
+
|
|
146
|
+
# Run full benchmark with export
|
|
147
|
+
npx @opensearch-project/agent-health benchmark -n <benchmark-name> -a <agent-key> --export results.json
|
|
148
|
+
|
|
149
|
+
# Import test cases from JSON file and run benchmark
|
|
150
|
+
npx @opensearch-project/agent-health benchmark -f ./test-cases.json -a <agent-key>
|
|
151
|
+
|
|
152
|
+
# Import with a custom benchmark name
|
|
153
|
+
npx @opensearch-project/agent-health benchmark -f ./test-cases.json -n "My Benchmark" -a <agent-key>
|
|
154
|
+
|
|
155
|
+
# Export test cases from a benchmark (produces import-compatible JSON)
|
|
156
|
+
npx @opensearch-project/agent-health export -b <benchmark-name> -o test-cases.json
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Code-based test SDK (write tests as files)
|
|
162
|
+
|
|
163
|
+
Besides JSON test cases, Agent Health has an **experimental code-based SDK** for
|
|
164
|
+
writing tests as `.eval.js` / `.eval.ts` files (Playwright-style `test()` /
|
|
165
|
+
`expect()` / fixtures / `judge()` / lifecycle hooks). Run them the same way you
|
|
166
|
+
run a JSON file:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# `-f` accepts BOTH JSON test-case files and code SDK (.eval.js / .eval.ts) files
|
|
170
|
+
npx @opensearch-project/agent-health benchmark -f ./evals/demo.eval.js -a my-agent
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
They produce **per-matcher results** (`matcherResults[]`) instead of a single
|
|
174
|
+
pass/fail. Full guide: [docs/SDK.md](https://github.com/opensearch-project/agent-health/blob/main/docs/SDK.md).
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Improvement Workflow
|
|
179
|
+
|
|
180
|
+
### Step 0: Verify Setup
|
|
181
|
+
```bash
|
|
182
|
+
npx @opensearch-project/agent-health doctor --output json
|
|
183
|
+
```
|
|
184
|
+
Confirm all checks pass before proceeding. Fix any issues reported.
|
|
185
|
+
|
|
186
|
+
### Step 1: Baseline Evaluation
|
|
187
|
+
```bash
|
|
188
|
+
npx @opensearch-project/agent-health benchmark -n "My Benchmark" -a my-agent --export baseline.json
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Step 2: Analyze Failures
|
|
192
|
+
Read `baseline.json` and find entries where `passFailStatus: "failed"`.
|
|
193
|
+
|
|
194
|
+
Key fields to examine:
|
|
195
|
+
- `matcherResults[*].reasoning` - the canonical judge verdict + reasoning per matcher (`llmJudgeReasoning` is a legacy, deprecated shim carrying the same text)
|
|
196
|
+
- `improvementStrategies` - Specific recommendations with priority
|
|
197
|
+
- `trajectory` - Step-by-step agent execution
|
|
198
|
+
|
|
199
|
+
> Distinguish **`failed`** (the agent answered, judge scored it below threshold)
|
|
200
|
+
> from **errored** (`metricsStatus: "error"` — the *evaluator itself* could not
|
|
201
|
+
> run, e.g. a judge validation error). Errored runs are **excluded** from
|
|
202
|
+
> pass-rate aggregation; don't treat them as agent misses.
|
|
203
|
+
|
|
204
|
+
### Step 3: Fix Based on Strategies
|
|
205
|
+
Focus on `priority: "high"` issues first:
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"category": "Tool Usage",
|
|
209
|
+
"issue": "Agent called search without time filter",
|
|
210
|
+
"recommendation": "Always include start_time and end_time parameters",
|
|
211
|
+
"priority": "high"
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Read the agent's code and implement the recommendation.
|
|
216
|
+
|
|
217
|
+
### Step 4: Verify Fix
|
|
218
|
+
```bash
|
|
219
|
+
npx @opensearch-project/agent-health benchmark -n "My Benchmark" -a my-agent --export after-fix.json
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Compare `passRate` between baseline and after-fix.
|
|
223
|
+
|
|
224
|
+
### Step 5: Iterate
|
|
225
|
+
Repeat until all high-priority issues are resolved.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Output Reference
|
|
230
|
+
|
|
231
|
+
### Benchmark Export Structure
|
|
232
|
+
```json
|
|
233
|
+
{
|
|
234
|
+
"benchmark": { "id": "...", "name": "...", "testCaseCount": 10 },
|
|
235
|
+
"runs": [{
|
|
236
|
+
"agent": { "key": "my-agent", "name": "My Agent" },
|
|
237
|
+
"passed": 7,
|
|
238
|
+
"failed": 3,
|
|
239
|
+
"passRate": 70,
|
|
240
|
+
"reports": [{
|
|
241
|
+
"testCaseId": "tc-001",
|
|
242
|
+
"passFailStatus": "failed",
|
|
243
|
+
"metricsStatus": "ready",
|
|
244
|
+
"metrics": { "accuracy": 45 },
|
|
245
|
+
"matcherResults": [
|
|
246
|
+
{ "method": "llm-judge", "description": "identifies the root cause", "pass": false, "score": 0.45, "reasoning": "The agent failed because..." }
|
|
247
|
+
],
|
|
248
|
+
"llmJudgeReasoning": "The agent failed because...",
|
|
249
|
+
"improvementStrategies": [{
|
|
250
|
+
"category": "Tool Usage | Reasoning | Completeness",
|
|
251
|
+
"issue": "What went wrong",
|
|
252
|
+
"recommendation": "How to fix it",
|
|
253
|
+
"priority": "high | medium | low"
|
|
254
|
+
}],
|
|
255
|
+
"trajectory": [
|
|
256
|
+
{ "type": "thinking", "content": "Agent's reasoning..." },
|
|
257
|
+
{ "type": "action", "toolName": "search", "toolArgs": {} },
|
|
258
|
+
{ "type": "tool_result", "content": "...", "status": "SUCCESS" },
|
|
259
|
+
{ "type": "response", "content": "Final answer..." }
|
|
260
|
+
]
|
|
261
|
+
}]
|
|
262
|
+
}]
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Metrics, scoring, and run status
|
|
267
|
+
|
|
268
|
+
- **Metrics are evaluator-defined and heterogeneous.** Only the *RCA Default*
|
|
269
|
+
evaluator emits a metric named `accuracy`. Other evaluators emit their own
|
|
270
|
+
metric names (`tool_selection_accuracy`, `reasoning_coherence`,
|
|
271
|
+
`bias_detection`, …) and custom evaluators emit whatever their
|
|
272
|
+
`scoringConfig` defines. Don't assume `metrics.accuracy` exists.
|
|
273
|
+
- **A run's overall score** is the rounded mean of whatever numeric metrics the
|
|
274
|
+
run's evaluator emitted (`null`/`—` when none), not a single "accuracy".
|
|
275
|
+
- **`matcherResults[]` is the canonical judge surface.** Read the judge verdict
|
|
276
|
+
+ reasoning from `matcherResults` entries (`method: 'llm-judge'`). Each entry
|
|
277
|
+
is a `MatcherResult`: `{ description, pass (boolean), score? (0–1), method,
|
|
278
|
+
reasoning?, durationMs? }`. `llmJudgeReasoning` is still populated as a
|
|
279
|
+
backward-compatible shim but is deprecated.
|
|
280
|
+
- **Run status:** `passed` / `failed` come from `passFailStatus`; a separate
|
|
281
|
+
**`errored`** state (`metricsStatus: 'error'`) means the evaluator could not
|
|
282
|
+
run and is excluded from pass-rate denominators.
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Tips
|
|
287
|
+
|
|
288
|
+
1. **Always use `--output json`** for reliable parsing
|
|
289
|
+
2. **Use `--export`** to get full reports with improvement strategies
|
|
290
|
+
3. **Fix high-priority issues first** - they cause actual failures
|
|
291
|
+
4. **Compare trajectories** between passing and failing cases
|
|
292
|
+
5. **Make incremental changes** - one fix, then re-test
|
|
293
|
+
6. **Don't over-engineer** - fix the specific issue identified
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Troubleshooting
|
|
298
|
+
|
|
299
|
+
| Symptom | Fix |
|
|
300
|
+
|---|---|
|
|
301
|
+
| `npx agent-health` not found | `npm install -g @opensearch-project/agent-health` |
|
|
302
|
+
| "No agents configured" | `npx agent-health init` (creates config with sample agents) |
|
|
303
|
+
| Server / config issues | `npx agent-health doctor` (checks config + connectivity) |
|
|
304
|
+
| "OpenSearch storage not configured" | Fine for local use — file-based storage is the default. Set `OPENSEARCH_STORAGE_*` only for shared / production persistence. |
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Server API Reference
|
|
309
|
+
|
|
310
|
+
The Agent Health server runs on port 4001 and exposes the following REST APIs. All endpoints return JSON unless noted (SSE endpoints return `text/event-stream`).
|
|
311
|
+
|
|
312
|
+
### Health & Configuration
|
|
313
|
+
|
|
314
|
+
| Method | Path | Description |
|
|
315
|
+
|---|---|---|
|
|
316
|
+
| GET | `/health` | Health check → `{ status: 'ok', version, service: 'agent-health' }` |
|
|
317
|
+
| GET | `/api/agents` | List all agents → `{ agents: AgentConfig[], total }` |
|
|
318
|
+
| POST | `/api/agents/custom` | Add custom agent → `{ name, endpoint, connectorType?, useTraces? }` |
|
|
319
|
+
| DELETE | `/api/agents/custom/:id` | Remove custom agent |
|
|
320
|
+
| GET | `/api/models` | List all models → `{ models: ModelConfig[], total }` |
|
|
321
|
+
| GET | `/api/debug` | Debug status → `{ enabled: boolean }` |
|
|
322
|
+
| POST | `/api/debug` | Toggle debug → `{ enabled: boolean }` |
|
|
323
|
+
|
|
324
|
+
### Agent Execution & Evaluation
|
|
325
|
+
|
|
326
|
+
| Method | Path | Description |
|
|
327
|
+
|---|---|---|
|
|
328
|
+
| POST | `/api/agent` | Proxy agent request (SSE) → `{ endpoint, payload, headers?, agentKey? }` |
|
|
329
|
+
| POST | `/api/evaluate` | Run evaluation (SSE) → `{ testCaseId?, testCase?, agentKey, modelId }` |
|
|
330
|
+
|
|
331
|
+
### Judge
|
|
332
|
+
|
|
333
|
+
| Method | Path | Description |
|
|
334
|
+
|---|---|---|
|
|
335
|
+
| POST | `/api/judge` | Evaluate a captured trajectory → `{ trajectory, expectedOutcomes? \| expectedTrajectory?, modelId?, evaluatorId?, runId?, logs?, agents? }` → `JudgeResponse` `{ passFailStatus, metrics, llmJudgeReasoning, improvementStrategies }` |
|
|
336
|
+
| GET | `/api/judge/bedrock-models` | Discover Bedrock judge models (`ListInferenceProfiles`) |
|
|
337
|
+
| GET | `/api/judge/openai-compatible-models` | List OpenAI-compatible models → `{ models, endpoint, configured }` (renamed from `/api/judge/litellm-models`) |
|
|
338
|
+
| GET | `/api/judge/anthropic-models` | Discover Anthropic-direct models (needs `ANTHROPIC_API_KEY`) |
|
|
339
|
+
| GET | `/api/judge/github-models` | Discover GitHub Models / Copilot models (needs `GITHUB_TOKEN`) |
|
|
340
|
+
|
|
341
|
+
**On `/api/judge`, `modelId` is the *judge* model** — the trajectory is already
|
|
342
|
+
captured, so there is no agent invocation here, and `/api/judge` does **not**
|
|
343
|
+
take a `judgeModelId`. The agent-vs-judge model distinction (where `modelId`
|
|
344
|
+
is the *agent's* LLM and `judgeModelId` is the *judge's*) applies to the run
|
|
345
|
+
endpoints — `POST /api/evaluate` and `POST /api/storage/evaluation-runs` — and
|
|
346
|
+
the CLI (`-m` / `--judge-model`). Agentic-provider judges (`pi` / `agent` /
|
|
347
|
+
`agentic` / `claude-code`) pick their own model and ignore the judge model id.
|
|
348
|
+
The run-level `matcherResults[]` are assembled by the runner from the judge's
|
|
349
|
+
response (see [Output Reference](#output-reference)); the raw `/api/judge`
|
|
350
|
+
primitive returns `llmJudgeReasoning`.
|
|
351
|
+
|
|
352
|
+
### Traces & Metrics
|
|
353
|
+
|
|
354
|
+
| Method | Path | Description |
|
|
355
|
+
|---|---|---|
|
|
356
|
+
| POST | `/api/traces` | Fetch traces → `{ traceId?, runIds?, startTime?, endTime?, size? }` → `{ spans, total, hasMore }` |
|
|
357
|
+
| GET | `/api/traces/health` | Traces health → `{ status: 'ok' \| 'error' }` |
|
|
358
|
+
| GET | `/api/metrics/:runId` | Run metrics → `{ totalTokens, costUsd, durationMs, llmCalls, toolCalls }` |
|
|
359
|
+
| POST | `/api/metrics/batch` | Batch metrics → `{ runIds: string[] }` → `{ metrics[], aggregate }` |
|
|
360
|
+
|
|
361
|
+
### Logs
|
|
362
|
+
|
|
363
|
+
| Method | Path | Description |
|
|
364
|
+
|---|---|---|
|
|
365
|
+
| POST | `/api/logs` | Fetch logs → `{ runId?, query?, startTime?, endTime?, size? }` → `{ logs[], total }` |
|
|
366
|
+
|
|
367
|
+
### Observability
|
|
368
|
+
|
|
369
|
+
| Method | Path | Description |
|
|
370
|
+
|---|---|---|
|
|
371
|
+
| GET | `/api/observability/health` | Check observability data source health |
|
|
372
|
+
| POST | `/api/observability/test-connection` | Test connection to observability cluster |
|
|
373
|
+
| GET | `/api/observability/defaults` | Get default OTEL index patterns |
|
|
374
|
+
|
|
375
|
+
### Storage: Test Cases
|
|
376
|
+
|
|
377
|
+
| Method | Path | Description |
|
|
378
|
+
|---|---|---|
|
|
379
|
+
| GET | `/api/storage/test-cases` | List test cases (latest versions). Query: `ids?`, `fields?`, `size?`, `after?` |
|
|
380
|
+
| GET | `/api/storage/test-cases/:id` | Get latest version of test case |
|
|
381
|
+
| GET | `/api/storage/test-cases/:id/versions` | Get all versions |
|
|
382
|
+
| GET | `/api/storage/test-cases/:id/versions/:version` | Get specific version |
|
|
383
|
+
| POST | `/api/storage/test-cases` | Create test case (v1) |
|
|
384
|
+
| PUT | `/api/storage/test-cases/:id` | Update (creates new version) |
|
|
385
|
+
| DELETE | `/api/storage/test-cases/:id` | Delete all versions |
|
|
386
|
+
| POST | `/api/storage/test-cases/bulk` | Bulk create |
|
|
387
|
+
|
|
388
|
+
### Storage: Benchmarks
|
|
389
|
+
|
|
390
|
+
| Method | Path | Description |
|
|
391
|
+
|---|---|---|
|
|
392
|
+
| GET | `/api/storage/benchmarks` | List benchmarks. Query: `fields?`, `size?` |
|
|
393
|
+
| GET | `/api/storage/benchmarks/:id` | Get by ID. Query: `fields?`, `runsSize?`, `runsOffset?` |
|
|
394
|
+
| GET | `/api/storage/benchmarks/:id/export` | Export test cases as JSON |
|
|
395
|
+
| POST | `/api/storage/benchmarks` | Create → `{ name, description?, testCaseIds }` |
|
|
396
|
+
| PUT | `/api/storage/benchmarks/:id` | Update |
|
|
397
|
+
| PATCH | `/api/storage/benchmarks/:id/metadata` | Update metadata |
|
|
398
|
+
| DELETE | `/api/storage/benchmarks/:id` | Delete |
|
|
399
|
+
| POST | `/api/storage/benchmarks/:id/execute` | Execute benchmark (SSE) → `{ runConfig: RunConfigInput }` |
|
|
400
|
+
| DELETE | `/api/storage/benchmarks/:id/runs/:runId` | Delete specific run |
|
|
401
|
+
| POST | `/api/storage/benchmarks/:id/cancel` | Cancel execution |
|
|
402
|
+
| POST | `/api/storage/benchmarks/:id/refresh-all-stats` | Recompute all run stats |
|
|
403
|
+
|
|
404
|
+
### Storage: Runs (TestCaseRun)
|
|
405
|
+
|
|
406
|
+
| Method | Path | Description |
|
|
407
|
+
|---|---|---|
|
|
408
|
+
| GET | `/api/storage/runs` | List runs. Query: `size?`, `from?`, `fields?` |
|
|
409
|
+
| GET | `/api/storage/runs/:id` | Get run by ID |
|
|
410
|
+
| POST | `/api/storage/runs` | Create run |
|
|
411
|
+
| PATCH | `/api/storage/runs/:id` | Update run |
|
|
412
|
+
| DELETE | `/api/storage/runs/:id` | Delete run |
|
|
413
|
+
| POST | `/api/storage/runs/search` | Search with filters |
|
|
414
|
+
| GET | `/api/storage/runs/by-test-case/:testCaseId` | Runs for test case |
|
|
415
|
+
| GET | `/api/storage/runs/by-benchmark/:benchmarkId` | Runs for benchmark |
|
|
416
|
+
| GET | `/api/storage/runs/by-benchmark-run/:benchmarkId/:runId` | Results for benchmark run |
|
|
417
|
+
| GET | `/api/storage/runs/iterations/:benchmarkId/:testCaseId` | Iterations for test case in benchmark |
|
|
418
|
+
| POST | `/api/storage/runs/:id/annotations` | Add annotation |
|
|
419
|
+
|
|
420
|
+
### Storage: Analytics
|
|
421
|
+
|
|
422
|
+
| Method | Path | Description |
|
|
423
|
+
|---|---|---|
|
|
424
|
+
| GET | `/api/storage/analytics` | Query analytics. Filters: `experimentId?`, `testCaseId?`, `agentId?`, `modelId?` |
|
|
425
|
+
| GET | `/api/storage/analytics/aggregations` | Aggregated metrics |
|
|
426
|
+
| POST | `/api/storage/analytics/search` | Complex search with aggregations |
|
|
427
|
+
|
|
428
|
+
### Storage: Reports
|
|
429
|
+
|
|
430
|
+
| Method | Path | Description |
|
|
431
|
+
|---|---|---|
|
|
432
|
+
| GET | `/api/storage/benchmarks/:id/report` | Download report. Query: `format?` ('json'\|'html'\|'pdf') |
|
|
433
|
+
|
|
434
|
+
### Storage: Evaluators
|
|
435
|
+
|
|
436
|
+
| Method | Path | Description |
|
|
437
|
+
|---|---|---|
|
|
438
|
+
| GET | `/api/storage/evaluators` | List evaluators (5 built-in system + custom) |
|
|
439
|
+
| GET | `/api/storage/evaluators/:id` | Get evaluator (latest version) |
|
|
440
|
+
| GET | `/api/storage/evaluators/:id/versions` | List all versions (newest first) |
|
|
441
|
+
| GET | `/api/storage/evaluators/:id/versions/:version` | Get a specific version snapshot |
|
|
442
|
+
| POST | `/api/storage/evaluators` | Create custom evaluator |
|
|
443
|
+
| PUT | `/api/storage/evaluators/:id` | Update (creates a new immutable version) |
|
|
444
|
+
| DELETE | `/api/storage/evaluators/:id` | Delete custom evaluator (system evaluators are protected) |
|
|
445
|
+
|
|
446
|
+
### Storage: Evaluation Runs (code-based SDK)
|
|
447
|
+
|
|
448
|
+
| Method | Path | Description |
|
|
449
|
+
|---|---|---|
|
|
450
|
+
| GET | `/api/storage/evaluation-runs` | List evaluation runs |
|
|
451
|
+
| GET | `/api/storage/evaluation-runs/:id` | Get evaluation run |
|
|
452
|
+
| POST | `/api/storage/evaluation-runs` | Start a run (SSE). Accepts `sources: [{ type: 'code-import', filenames }]` for `.eval.js` / `.eval.ts` SDK files, plus `agentKey`, `modelId`, `judgeModelId?`, `evaluatorId?` |
|
|
453
|
+
| POST | `/api/storage/evaluation-runs/:id/cancel` | Cancel a run |
|
|
454
|
+
| POST | `/api/storage/evaluation-runs/:id/promote` | Promote a run |
|
|
455
|
+
|
|
456
|
+
### Comparison
|
|
457
|
+
|
|
458
|
+
| Method | Path | Description |
|
|
459
|
+
|---|---|---|
|
|
460
|
+
| POST | `/api/comparison/cluster-failures` | Cluster regressed cases into named failure patterns (`knowledge` / `tool_gap` / `reasoning` / `other`) |
|
|
461
|
+
| GET | `/api/comparison/clusters/:clusterId` | Fetch a previously computed cluster by id |
|
|
462
|
+
|
|
463
|
+
### Storage: Admin
|
|
464
|
+
|
|
465
|
+
| Method | Path | Description |
|
|
466
|
+
|---|---|---|
|
|
467
|
+
| GET | `/api/storage/health` | Storage backend health |
|
|
468
|
+
| POST | `/api/storage/test-connection` | Test storage connection |
|
|
469
|
+
| POST | `/api/storage/init` | Initialize indexes |
|
|
470
|
+
| GET | `/api/storage/config/status` | Config status |
|
|
471
|
+
| POST | `/api/storage/config/storage` | Update storage config |
|
|
472
|
+
| POST | `/api/storage/config/observability` | Update observability config |
|
|
473
|
+
|
|
474
|
+
### Assistant (NEW)
|
|
475
|
+
|
|
476
|
+
| Method | Path | Description |
|
|
477
|
+
|---|---|---|
|
|
478
|
+
| POST | `/api/assistant/chat` | Chat with AI assistant (SSE) → `{ sessionId, message, context }` → `{ type: 'delta'\|'done', content }` |
|
|
479
|
+
| DELETE | `/api/assistant/session/:sessionId` | Clear session |
|
|
480
|
+
| GET | `/api/assistant/health` | Check assistant availability |
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
## UI Pages
|
|
485
|
+
|
|
486
|
+
The evaluation surface lives under `/evaluations/*`. The app uses
|
|
487
|
+
`BrowserRouter` — plain paths, no `#` prefix.
|
|
488
|
+
|
|
489
|
+
| Page | Route | Description |
|
|
490
|
+
|---|---|---|
|
|
491
|
+
| Dashboard | `/` | Overview with agent stats, recent runs, system health |
|
|
492
|
+
| Benchmarks | `/evaluations/benchmarks` | List benchmarks with pass rates, run counts, version badges |
|
|
493
|
+
| Benchmark Runs | `/evaluations/benchmarks/:id/runs` | Runs for a benchmark (split / tabs layout) |
|
|
494
|
+
| Run Inspector | `/evaluations/benchmarks/:id/runs/:runId/inspect` | Per-test-case results, trajectory, judge, traces |
|
|
495
|
+
| Test Cases | `/evaluations/test-cases` | List / create / edit / version test cases |
|
|
496
|
+
| Test Case Detail | `/evaluations/test-cases/:id` | Definition + runs with an inline live-run panel |
|
|
497
|
+
| Eval Runs | `/evaluations/runs` · `/evaluations/runs/:id` | Code-import (SDK) and ad-hoc run results |
|
|
498
|
+
| Evaluators | `/evaluators` · `/evaluators/:id` | Manage evaluators; version history + Git-style diff |
|
|
499
|
+
| Compare | `/compare/:benchmarkId?runs=a,b` | Diagnosis surface: verdict strip, first-divergence, failure clusters |
|
|
500
|
+
| Agent Traces | `/agent-traces` | OpenTelemetry trace explorer (timeline / flow) |
|
|
501
|
+
| Coding Agents | `/coding-agents` | Coding Agent Analytics (Claude Code / Kiro / Codex) |
|
|
502
|
+
| Settings | `/settings` | Configure agents, models, storage, observability connections |
|
|
503
|
+
| Assistant | `/assistant` | Full-page AI chat interface for help and analysis |
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
507
|
+
## Common Tasks
|
|
508
|
+
|
|
509
|
+
### Ask about a benchmark's results
|
|
510
|
+
"What's the pass rate for benchmark bench-xxx? Which test cases are failing and why?"
|
|
511
|
+
→ The assistant will query `/api/storage/benchmarks/:id` and `/api/storage/runs/by-benchmark/:id`
|
|
512
|
+
|
|
513
|
+
### Interpret judge reasoning
|
|
514
|
+
"Why did test case tc-xxx fail in run run-xxx? What should I fix?"
|
|
515
|
+
→ The assistant reads `llmJudgeReasoning` and `improvementStrategies` from the run
|
|
516
|
+
|
|
517
|
+
### Write a test case
|
|
518
|
+
"Help me write a test case for testing log search with time filters"
|
|
519
|
+
→ The assistant creates a test case with prompt, context, expectedOutcomes, and labels
|
|
520
|
+
|
|
521
|
+
### Analyze traces
|
|
522
|
+
"What are the most expensive LLM calls in run run-xxx?"
|
|
523
|
+
→ The assistant queries `/api/traces` and `/api/metrics/:runId` to find token-heavy spans
|
|
524
|
+
|
|
525
|
+
### Compare runs
|
|
526
|
+
"Compare the results of run A vs run B in benchmark bench-xxx"
|
|
527
|
+
→ The assistant fetches both runs and diffs pass/fail status, accuracy, and strategies
|
|
528
|
+
|
|
529
|
+
### Diagnose eval-vs-reality gaps
|
|
530
|
+
"My agent passes 8/9 in evals but fails in real life — why?"
|
|
531
|
+
→ The assistant investigates: fetches the runs and test cases, examines judge reasoning and expectedOutcomes, checks whether the evaluator is appropriate for the domain, and recommends tightening outcomes or creating a custom evaluator
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## Evaluator System
|
|
536
|
+
|
|
537
|
+
### How Evaluation Works
|
|
538
|
+
|
|
539
|
+
1. Agent runs against a test case → produces a **trajectory** (thinking, action, tool_result, response steps)
|
|
540
|
+
2. The **judge** (LLM) receives the trajectory + expectedOutcomes and scores each outcome
|
|
541
|
+
3. Each outcome: Fully achieved = 1.0, Partially = 0.5, Not achieved = 0.0
|
|
542
|
+
4. `accuracy = (sum of scores / total outcomes) × 100`
|
|
543
|
+
5. Pass/Fail determined by evaluator's `passThreshold` + critical failure checks
|
|
544
|
+
|
|
545
|
+
### Built-in Evaluators
|
|
546
|
+
|
|
547
|
+
| ID | Name | Threshold | Key Metrics |
|
|
548
|
+
|---|---|---|---|
|
|
549
|
+
| `system-rca-default` | RCA Default | 70% | accuracy |
|
|
550
|
+
| `system-factuality` | Factuality | 80% | factual_accuracy, hallucination_rate, source_grounding |
|
|
551
|
+
| `system-tool-usage` | Tool Usage | 80% | tool_selection_accuracy, redundant_calls, tool_ordering |
|
|
552
|
+
| `system-reasoning-depth` | Reasoning Depth | 75% | reasoning_coherence, step_completeness, logical_validity |
|
|
553
|
+
| `system-safety` | Safety | 90% | safety_score, bias_detection, guardrail_adherence |
|
|
554
|
+
|
|
555
|
+
### Custom Evaluators
|
|
556
|
+
|
|
557
|
+
Create custom evaluators via the UI or API for domain-specific scoring:
|
|
558
|
+
|
|
559
|
+
```json
|
|
560
|
+
{
|
|
561
|
+
"name": "My Domain Evaluator",
|
|
562
|
+
"systemPrompt": "You are evaluating an agent for [domain]. CRITICAL CRITERIA: ...",
|
|
563
|
+
"scoringConfig": {
|
|
564
|
+
"metrics": [
|
|
565
|
+
{ "name": "routing_accuracy", "weight": 0.4, "scale": 100 },
|
|
566
|
+
{ "name": "tool_correctness", "weight": 0.4, "scale": 100 },
|
|
567
|
+
{ "name": "diagnostic_completeness", "weight": 0.2, "scale": 100 }
|
|
568
|
+
],
|
|
569
|
+
"passThreshold": 85,
|
|
570
|
+
"scale": 100
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
Assign to a benchmark run via `evaluatorId` in the run config.
|
|
576
|
+
|
|
577
|
+
### When to Recommend Custom Evaluators
|
|
578
|
+
|
|
579
|
+
- **Domain has hard correctness rules**: specific CLI commands, valid syntax, routing tables, API formats
|
|
580
|
+
- **Default judge is too charitable**: agents pass evals but fail in real-world usage (eval-vs-reality gap)
|
|
581
|
+
- **Multiple independent dimensions**: routing correctness AND tool syntax AND diagnostic completeness all matter
|
|
582
|
+
- **70% threshold is too low**: critical domains (oncall, security, compliance) need 85%+
|
|
583
|
+
|
|
584
|
+
### Common Eval-vs-Reality Gap Causes
|
|
585
|
+
|
|
586
|
+
1. **expectedOutcomes describe results, not procedures**: Judge rewards "got the right answer" without verifying "used the right method"
|
|
587
|
+
2. **70% threshold too permissive**: Missing 30% of steps may be catastrophic in practice
|
|
588
|
+
3. **No tool-correctness validation**: Generic judge can't verify domain-specific tool syntax
|
|
589
|
+
4. **Trajectory compaction hides details**: toolOutput truncated to 1000 chars, content to 500 chars — wrong commands may be invisible to judge
|
|
590
|
+
5. **Test cases cleaner than reality**: Hand-authored prompts include hints that real incidents don't
|
|
591
|
+
6. **Single-turn evaluation**: Real work is iterative; test cases may compress multi-step workflows
|
|
592
|
+
|
|
593
|
+
### Fix Strategies (in order)
|
|
594
|
+
|
|
595
|
+
1. **Tighten expectedOutcomes**: Add negative constraints ("do NOT use X"), require specific tool names, specify correct syntax
|
|
596
|
+
2. **Raise passThreshold**: Set to 85%+ for critical domains
|
|
597
|
+
3. **Use `system-tool-usage` as secondary evaluator**: Catches redundant/wrong tool calls
|
|
598
|
+
4. **Create domain-specific custom evaluator**: Include explicit rubric criteria the generic judge can't verify
|