← 返回
未分类 中文

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

Persistent memory engine for AI agents with semantic recall, hotness prioritization, importance weighting, time decay, and auto-compaction. Zero external dep...
面向AI代理的持久记忆引擎,支持语义召回、热优先级排序、重要度加权、时间衰减和自动压缩,零外部依赖
chen-feng123
未分类 clawhub v1.0.5 1 版本 100000 Key: 无需
★ 0
Stars
📥 521
下载
💾 0
安装
1
版本
#latest#zero-dependency

概述

Memory Enhancement Engine

记忆增加引擎 — Persistent memory engine with hotness-prioritized semantic recall.

Memories that are recalled more often appear first — not just keyword matches.

Quick Start

# Node.js API
const { MemorySystem } = require('./memory-enhancement-engine/memory.js');
const mem = new MemorySystem();

# CLI tool (view / search / compact)
node memory-enhancement-engine/memo.cjs status
node memory-enhancement-engine/memo.cjs query "something to find"

Core Usage

const { MemorySystem } = require('./memory-enhancement-engine/memory.js');

// Create engine (stores to MEMORY_STORE.json automatically)
const mem = new MemorySystem({ decayHalfLifeHours: 2 });

// Write a memory
mem.add({
  content: "Paris is the capital of France.",
  importance: 1.5,
  metadata: { tags: ["geography", "fact"] }
});

// Semantic search
const results = mem.query("France capital");
console.log(results);

// Get recent memories
const recent = mem.recent(10);

// Compact old memories (summarize low-importance clusters)
mem.compact(5, 0.3);

API

MethodDescription
---------------------
add(content, importance, metadata)Write a memory
retrieve(query, k)Semantic search (returns sorted by score)
getRecent(n)Get N most recent memories
remove(predicate)Remove memories matching predicate
compact(groupSize, minImportance)Compact old memories into summaries
getStatus()Get engine stats (count, size, etc.)

Scoring Formula

score = similarity × 0.5 + recency × 0.3 + hotness × 0.2

Where hotness = log(1 + access_count) × exp(-time_delta / 86400)

Features

  • Hotness-Prioritized Recall — Frequently accessed memories get boosted scores
  • Semantic Search — Bigram overlap + character-level similarity
  • Importance Weighting — 0.0 (trivial) to 2.0 (critical)
  • Time Decay — Half-life configurable (default 2 hours)
  • Auto-Prune — Beyond 1000 entries, least important are pruned
  • Auto-Compaction — Merge low-importance groups into summaries
  • No Server Needed — Direct Node.js require, stores to local JSON

Installation

MethodCommand
-----------------
CopyCopy memory.js + memo.cjs to your project
ClawHubclawhub install memory-enhancement-engine

File Structure

memory-enhancement-engine/
├── SKILL.md
├── memory.js            # Core engine
├── memo.cjs             # CLI tool
├── package.json
├── assets/
│   └── icon.svg
├── references/
│   ├── API_SPEC.md
│   └── USE_GUIDE.md
└── scripts/
    ├── init-memory.mjs  # One-time migration
    └── test-client.js

License

MIT

版本历史

共 1 个版本

  • v1.0.5 当前
    2026-05-07 04:12 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-diabetes-coach

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

AI-Cardiac-Rehab

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

cognitive-enhancement-engine

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