📦 cognitive-enhancement-engine
v1.0.0AI 代理 cognitive enhancement engine with working memory, TF-IDF vector memory, planning, reasoning, reflection, and metacognitive 监控ing. Zero external...
运行时依赖
安装命令
点击复制技能文档
Cognitive Enhancement Engine (认知力增强引擎)
Lightweight AI 代理 cognitive engine with working memory, TF-IDF vector memory, planning, reasoning, reflection, and metacognitive 监控ing. Zero external dependencies — pure Python standard 库.
Quick 启动 # 运行 built-in demo python 技能s/cognitive-enhancement-engine/engine.py
# Or one-命令行工具ck 设置up bash 技能s/cognitive-enhancement-engine/scripts/设置up.sh # Linux/macOS/WSL 技能s\cognitive-enhancement-engine\scripts\设置up.bat # Windows
Core Usage from engine 导入 CognitiveEnhancer
# 创建 engine brAIn = CognitiveEnhancer(long_term_capacity=1000)
# Learn brAIn.memorize("Paris is the cAPItal of France.", 导入ance=0.9) brAIn.perceive("User asked about French cAPItal")
# Retrieve 结果s = brAIn.recall("cAPItal of France", top_k=3)
# Plan plan = brAIn.plan("Build a 网页 应用")
# Reason answer = brAIn.reason("What is the cAPItal of France?")
# Reflect suggestions = brAIn.reflect()
# Full task execution 结果 = brAIn.执行_task("Calculate 15% tip on $200 bill") print(结果)
# 状态 状态 = brAIn.获取_状态()
API Overview Method Description perceive(observation) Store perception into working memory recall(查询, top_k) 搜索 long-term memory memorize(content, 导入ance) Store into long-term memory plan(goal) Decompose goal into actionable steps reason(problem) Memory-based reasoning reflect() Discover 失败 patterns, suggest improvements 执行_task(goal, executor) End-to-end task execution 获取_状态() Return engine 运行time 状态 Configuration Parameter Default Description long_term_capacity 1000 Max long-term memories working_memory_size 10 Working memory FIFO size similarity_threshold 0.15 Recall similarity threshold Features TF-IDF Vector Memory — Inverted-索引 fast similarity 搜索 Working Memory — FIFO short-term 上下文 缓存 Planner — Goal decomposition + automatic task type 检测ion (calculate/搜索/summarize/translate/write) Reasoner — Memory-retrieval based Q&A Reflector — 失败 pattern 追踪ing and root cause mining Metacognitive 监控 — Task duration & error rate 追踪ing, dynamic adjustment 安装ation Method Command One-命令行工具ck (Linux/macOS) bash scripts/设置up.sh One-命令行工具ck (Windows) scripts\设置up.bat Copy-only Copy engine.py to your project ClawHub ClawHub 安装 cognitive-enhancement-engine File Structure cognitive-enhancement-engine/ ├── 技能.md ├── engine.py # Core engine (~17KB) ├── 索引.js # Node.js bridge ├── package.json ├── as设置s/ │ └── icon.svg ├── references/ │ ├── API_SPEC.md │ └── USE_图形界面DE.md └── scripts/ ├── 设置up.sh ├── 设置up.bat ├── test-basic.py └── test-命令行工具ent.js
License
MIT