Install
openclaw skills install yuyonghao-agent-reliabilityProvides error monitoring, automatic fallback, confidence evaluation, and multi-agent voting to maintain accuracy in multi-step workflows.
openclaw skills install yuyonghao-agent-reliabilityAgent 可靠性框架,解决多步工作流中准确率递减问题。
npm install
const { ReliabilityMonitor } = require('./src');
const monitor = new ReliabilityMonitor({
errorThreshold: 0.15,
confidenceThreshold: 0.85,
historyWindow: 100
});
// 记录执行结果
monitor.record({
stepId: 'step-1',
success: true,
confidence: 0.92,
duration: 1500
});
// 获取可靠性评分
const score = monitor.getReliabilityScore();
console.log(score); // { overall: 0.87, byStep: {...}, trend: 'improving' }
const { FallbackManager } = require('./src');
const fallback = new FallbackManager({
maxRetries: 3,
backoffStrategy: 'exponential'
});
const result = await fallback.execute(async () => {
return await riskyOperation();
}, {
fallback: async () => await safeOperation()
});
const { VotingConsensus } = require('./src');
const consensus = new VotingConsensus({
strategy: 'weighted-majority',
minAgreement: 0.7
});
consensus.vote('agent-1', { decision: 'approve', confidence: 0.9, weight: 2 });
consensus.vote('agent-2', { decision: 'approve', confidence: 0.8, weight: 1 });
const result = consensus.resolve();
console.log(result); // { decision: 'approve', confidence: 0.87, agreement: 0.75 }
npm test
MIT