← 返回
未分类 中文

cognitive-enhancement-engine

AI Agent cognitive enhancement engine with working memory, TF-IDF vector memory, planning, reasoning, reflection, and metacognitive monitoring. Zero external...
AI Agent 认知增强引擎,具备工作记忆、TF‑IDF 向量记忆、规划、推理、反思和元认知监控,零外部依赖。
chen-feng123
未分类 clawhub v1.0.2 1 版本 100000 Key: 无需
★ 0
Stars
📥 342
下载
💾 0
安装
1
版本
#latest

概述

Cognitive Enhancement Engine (认知力增强引擎)

Lightweight AI Agent cognitive engine with working memory, TF-IDF vector memory, planning, reasoning, reflection, and metacognitive monitoring. Zero external dependencies — pure Python standard library.

Quick Start

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

# Or one-click setup
bash skills/cognitive-enhancement-engine/scripts/setup.sh     # Linux/macOS/WSL
skills\cognitive-enhancement-engine\scripts\setup.bat         # Windows

Core Usage

from engine import CognitiveEnhancer

# Create engine
brain = CognitiveEnhancer(long_term_capacity=1000)

# Learn
brain.memorize("Paris is the capital of France.", importance=0.9)
brain.perceive("User asked about French capital")

# Retrieve
results = brain.recall("capital of France", top_k=3)

# Plan
plan = brain.plan("Build a web application")

# Reason
answer = brain.reason("What is the capital of France?")

# Reflect
suggestions = brain.reflect()

# Full task execution
result = brain.execute_task("Calculate 15% tip on $200 bill")
print(result)

# Status
status = brain.get_status()

API Overview

MethodDescription
---------------------
perceive(observation)Store perception into working memory
recall(query, top_k)Search long-term memory
memorize(content, importance)Store into long-term memory
plan(goal)Decompose goal into actionable steps
reason(problem)Memory-based reasoning
reflect()Discover failure patterns, suggest improvements
execute_task(goal, executor)End-to-end task execution
get_status()Return engine runtime status

Configuration

ParameterDefaultDescription
---------------------------------
long_term_capacity1000Max long-term memories
working_memory_size10Working memory FIFO size
similarity_threshold0.15Recall similarity threshold

Features

  • TF-IDF Vector Memory — Inverted-index fast similarity search
  • Working Memory — FIFO short-term context cache
  • Planner — Goal decomposition + automatic task type detection (calculate/search/summarize/translate/write)
  • Reasoner — Memory-retrieval based Q&A
  • Reflector — Failure pattern tracking and root cause mining
  • Metacognitive Monitor — Task duration & error rate tracking, dynamic adjustment

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 cognitive-enhancement-engine

File Structure

cognitive-enhancement-engine/
├── SKILL.md
├── engine.py              # Core engine (~17KB)
├── 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.2 当前
    2026-05-08 00:14 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

AI-Cardiac-Rehab

chen-feng123
AI心脏康复管理系统——基于ACC/AHA指南的安全增强型康复管理Web应用,提供症状预警、风险分层、个体化运动处方和药物依从性提醒。
★ 0 📥 326

ai-diabetes-coach

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

Judgment_Enhancement_Engine

chen-feng123
通过蒙特卡洛前瞻、风险调整效用和历史反思提升AI Agent的判断能力。适用于需要评估多步骤行为的场景。
★ 0 📥 325