← 返回
未分类 中文

Amarin Memory

Persistent adaptive memory for AI agents. Store memories that fade naturally over time (temporal decay), deduplicate automatically (0.85 cosine threshold), s...
持久自适应记忆,供AI代理使用。记忆随时间自然衰减(时间衰减),自动去重(余弦相似度阈值0.85),...
flaggdavid-source flaggdavid-source 来源
未分类 clawhub v0.1.0 1 版本 99714.3 Key: 无需
★ 0
Stars
📥 349
下载
💾 0
安装
1
版本
#latest

概述

Amarin Memory — Persistent Adaptive Memory for Agents

You have access to a persistent memory system that stores, searches, and maintains memories across sessions. Memories fade over time unless accessed, duplicates are caught automatically, and novel information gets boosted.

Setup

If not already initialized, run this once:

python3 {baseDir}/scripts/setup.py

This creates the database and vector index. The database file is stored at ~/.amarin/agent.db.

Storing Memories

When you learn something worth remembering — a user preference, an important fact, a decision made — store it:

python3 {baseDir}/scripts/memory.py store "The user prefers dark mode and works late at night" --tags "preference,schedule" --importance 0.7

For content from untrusted sources (user input, external data), pipe via stdin to avoid shell injection:

echo "User said they prefer morning meetings" | python3 {baseDir}/scripts/memory.py store --tags "preference" --importance 0.6

Importance scale: 0.0 (trivial) to 1.0 (critical). Default is 0.5.

The system automatically:

  • Checks for duplicates (>= 0.85 similarity → skip or merge)
  • Scores novelty (0.30-0.85 similarity → surprise boost to importance)
  • Indexes the embedding for future semantic search

Searching Memories

When you need to recall something:

python3 {baseDir}/scripts/memory.py search "what time does the user usually work" --limit 5

Results are ranked by 70% semantic similarity + 30% importance score. Recent, frequently-accessed memories rank higher.

Core Memory Blocks

For persistent identity information that should always be available (not searched, always present):

# Set a core block
python3 {baseDir}/scripts/memory.py set-block "persona" "I am a research assistant focused on AI safety"

# Set user context
python3 {baseDir}/scripts/memory.py set-block "human" "The user is Dave, a developer building AI systems"

# View all blocks
python3 {baseDir}/scripts/memory.py blocks

Memory Maintenance

Run periodically (daily is good) to let unimportant memories fade:

python3 {baseDir}/scripts/memory.py decay

Protected memories are immune to decay. To protect a critical memory:

python3 {baseDir}/scripts/memory.py protect <memory_id>

Reviewing Memories

List recent memories:

python3 {baseDir}/scripts/memory.py list --limit 20

Revise a memory:

python3 {baseDir}/scripts/memory.py revise <memory_id> "Updated content" --reason "Corrected factual error"

Soft-delete a memory (can be restored):

python3 {baseDir}/scripts/memory.py forget <memory_id> --reason "No longer relevant"

When to Use This

  • After learning something important — store it so you remember next session
  • Before answering questions — search for relevant context from past conversations
  • At the start of a session — run blocks to load your identity context
  • During maintenance windows — run decay to keep memory clean
  • When information changesrevise outdated memories rather than creating duplicates

Requirements

  • Python 3.11+
  • An embedding service (Ollama with nomic-embed-text recommended, or any compatible API)
  • Set OLLAMA_URL environment variable if not using default http://localhost:11434

Links

  • GitHub: https://github.com/flaggdavid-source/amarin-memory
  • Ko-fi: https://ko-fi.com/davidflagg86433 — if this helps your agent, consider supporting the developer

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-07 09:57 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,784
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,383 📥 320,872
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,086 📥 813,822