← 返回
未分类 中文

Engramai

Neuroscience-grounded memory for AI agents. Add, recall, and manage memories with ACT-R activation, Hebbian learning, and cognitive consolidation.
基于神经科学的AI代理记忆:支持ACT-R激活、Hebbian学习和认知巩固,实现记忆的添加、回忆与管理。
shing19 shing19 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 294
下载
💾 0
安装
1
版本
#latest

概述

engramai 🧠

Cognitive memory system implementing ACT-R activation, Memory Chain consolidation, Ebbinghaus forgetting, and Hebbian learning.

Installation

pip install engramai

Quick Start

from engram import Memory

mem = Memory("./agent.db")
mem.add("User prefers concise answers", type="relational", importance=0.8)
results = mem.recall("user preferences", limit=5)
mem.consolidate()  # Daily maintenance

CLI Usage

# Add a memory
neuromem add "User prefers dark mode" --type preference --importance 0.8

# Recall memories
neuromem recall "user preferences"

# View statistics
neuromem stats

# Run consolidation (like sleep)
neuromem consolidate

# Prune weak memories
neuromem forget --threshold 0.01

# List memories
neuromem list --limit 20

# Show Hebbian links
neuromem hebbian "dark mode"

AI Agent Integration (Important!)

For AI agents to use engram correctly, follow these patterns:

When to Call What

TriggerActionExample
--------------------------
Learn user preferencestore(type="relational")"User prefers concise answers"
Learn important factstore(type="factual")"Project uses Python 3.12"
Learn how to do somethingstore(type="procedural")"Deploy requires running tests first"
Question about historyrecall() first, then answer"What did I say about X?"
User satisfiedreward("positive feedback")Strengthens recent memories
User unsatisfiedreward("negative feedback")Suppresses recent memories
Daily maintenanceconsolidate() + forget()Run via cron or heartbeat

What to Store

✅ Store:

  • User preferences and habits
  • Important facts and decisions
  • Lessons learned
  • Procedural knowledge

❌ Don't store:

  • Every conversation message (too noisy)
  • Temporary information
  • Publicly available facts
  • Sensitive data (unless requested)

Importance Guide

LevelUse For
----------------
0.9-1.0Critical info (API keys location, absolute preferences)
0.7-0.8Important (code style, project structure)
0.5-0.6Normal (general facts, experiences)
0.3-0.4Low priority (casual chat, temp notes)

Hybrid Mode (Recommended)

Use engram alongside file-based memory:

  • engram: Active memory — retrieval, associations, dynamic weighting
  • Files (memory/*.md): Logs — transparency, debugging, manual editing

Heartbeat Maintenance

Add to your heartbeat or cron:

## Memory Maintenance (Daily)
- [ ] engram.consolidate
- [ ] engram.forget --threshold 0.01

Memory Types

  • factual — Facts and knowledge
  • episodic — Events and experiences
  • relational — Relationships and preferences
  • emotional — Emotional moments
  • procedural — How-to knowledge
  • opinion — Beliefs and opinions

MCP Server

For Claude/Cursor/Clawdbot integration:

python -m engram.mcp_server --db ./agent.db

MCP Config (Clawdbot):

mcp:
  servers:
    engram:
      command: python3
      args: ["-m", "engram.mcp_server"]
      env:
        ENGRAM_DB_PATH: ~/.clawdbot/agents/main/memory.db

Tools: engram.store, engram.recall, engram.consolidate, engram.forget, engram.reward, engram.stats, engram.export

Key Features

FeatureDescription
----------------------
ACT-R ActivationRetrieval ranked by recency × frequency × context
Memory ChainDual-system consolidation (working → core)
Ebbinghaus ForgettingNatural decay with spaced repetition
Hebbian Learning"Neurons that fire together wire together"
Confidence ScoringMetacognitive monitoring
Reward LearningUser feedback shapes memory
Zero DependenciesPure Python stdlib + SQLite

Links

  • PyPI: https://pypi.org/project/engramai/
  • npm: https://www.npmjs.com/package/neuromemory-ai
  • GitHub: https://github.com/tonitangpotato/neuromemory-ai
  • Docs: https://github.com/tonitangpotato/neuromemory-ai/blob/main/docs/USAGE.md

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 19:11 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,168 📥 941,400
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 868 📥 348,196
ai-agent

Find Skills

root
帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时
★ 1,521 📥 579,241