← 返回
未分类 中文

Judgment_Enhancement_Engine

AI Agent judgment enhancement via Monte Carlo lookahead, risk-adjusted utility, and historical reflection. Use when an agent needs to evaluate multi-step act...
通过蒙特卡洛前瞻、风险调整效用和历史反思提升AI Agent的判断能力。适用于需要评估多步骤行为的场景。
chen-feng123
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 305
下载
💾 0
安装
1
版本
#latest

概述

Judgment Enhancement Engine

Enhance AI agent decision-making under uncertainty through recursive Monte Carlo lookahead simulation, risk-adjusted utility, and historical reflection.

Quick Start

# Run built-in GridWorld demo
python skills/judgment-enhancement-engine/engine.py

# One-click setup
bash skills/judgment-enhancement-engine/scripts/setup.sh      # Linux/macOS/WSL
skills\judgment-enhancement-engine\scripts\setup.bat          # Windows

Core Usage

from engine import JudgmentEnhancementEngine, JudgmentResult

# 1. Define your world model (must implement WorldModel protocol)
class MyWorldModel:
    def get_possible_outcomes(self, state, action):
        # Returns [(next_state, probability, reward), ...]
        ...

    def is_terminal(self, state):
        ...

    def get_legal_actions(self, state):
        ...

# 2. Define objective function
class MyObjective:
    def evaluate(self, state):
        return float_score  # higher = better

# 3. Create engine
engine = JudgmentEnhancementEngine(
    world_model=MyWorldModel(),
    objective=MyObjective(),
    risk_tolerance=0.5,      # 0=extreme risk-averse, 1=risk-neutral
    lookahead_depth=3,       # recursion depth
    simulation_breadth=4,    # max actions evaluated per level
    use_greedy_rollout=True, # True=greedy (accurate), False=uniform (fast)
    max_compute_time_sec=2.0 # timeout protection
)

# 4. Make a judgment
result = engine.enhance_judgment(current_state)
print(f"Best action: {result.best_action}")
print(f"Confidence: {result.confidence:.2f}")
print(f"Reasoning: {result.reasoning}")

# 5. Record actual outcome (for historical correction)
engine.record_outcome(state, action, actual_utility)

# 6. Optional: clear history
engine.clear_history()

Configuration

ParameterDefaultDescription
---------------------------------
risk_tolerance0.50=extreme risk-averse, 1=risk-neutral
lookahead_depth2Recursive lookahead levels
simulation_breadth3Max actions evaluated per level
history_size100Historical records kept
max_compute_time_sec1.0Timeout protection (seconds)
use_greedy_rolloutTrueTrue=greedy (accurate), False=uniform (fast)

JudgmentResult Fields

FieldTypeDescription
--------------------------
best_actionActionSelected best action
scoresdictRisk-adjusted utility per action
raw_utilitiesdictRaw expected utility per action
risk_metricsdictExpectation/variance/std/VaR95 per action
reasoningstrHuman-readable decision reasoning
confidencefloat0~1 confidence score

Example: GridWorld

Built-in demo() shows a 5x5 grid world with obstacles and a goal. Run python engine.py to see it in action.

Installation

MethodCommand
-----------------
One-click (Linux/macOS)bash scripts/setup.sh
One-click (Windows)scripts\setup.bat
Copy-onlyCopy engine.py to your project
ClawHubclawhub install judgment-enhancement-engine

File Structure

judgment-enhancement-engine/
├── SKILL.md
├── engine.py              # Core engine (~10KB)
├── index.js               # Node.js bridge
├── package.json
├── assets/
│   └── icon.svg
├── references/
│   ├── API_SPEC.md
│   └── USE_GUIDE.md
└── scripts/
    ├── setup.sh
    ├── setup.bat
    ├── test-basic.py
    └── test-client.js

License

MIT

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-08 01:44 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-diabetes-coach

chen-feng123
AI 糖尿病康复管理助手:血糖记录、风险分级、个性化饮食/运动建议、胰岛素参考计算,基于 ADA 2025 指南,安全增强设计。
★ 0 📥 336

cognitive-enhancement-engine

chen-feng123
AI Agent 认知增强引擎,具备工作记忆、TF‑IDF 向量记忆、规划、推理、反思和元认知监控,零外部依赖。
★ 0 📥 365

QuickRecall - Zero-Dependency Memory Engine. 常用记忆优先出现。零依赖 AI 记忆引擎,纯 Node.js。/ Prioritizes frequently used memories. Zero deps.

chen-feng123
面向AI代理的持久记忆引擎,支持语义召回、热优先级排序、重要度加权、时间衰减和自动压缩,零外部依赖
★ 0 📥 556