Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计通过

agent-tiered-memoryAgent 分层内存

Agent Skill

agent-tiered-memory 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,387

周安装

144

GitHub Stars

公开资料未说明

下载量

1,187
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:agent-tiered-memory(Agent 分层内存)
来源仓库:https://github.com/jpmoregain-eth/agent-tiered-memory
安装命令:
openclaw skills install agent-tiered-memory
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install agent-tiered-memory

简介

Agent Tiered Memory 实现 OpenClaw 代理的两层内存架构:近期语义搜索与长期 SQLite 存档。

  • 适用于需要兼顾快速检索与持久化存储的记忆系统场景。
  • 第 0 层处理近 7–14 天记忆,第 1 层负责长期知识沉淀。
  • 使用前应配置存储路径与索引策略,避免磁盘空间耗尽。
  • 建议定期清理过期条目以维持查询效率。

SKILL.md

name
tiered-memory
version
1.0.1
description
Two-tier memory system for OpenClaw agents. Tier 0 = QMD semantic search for recent memories (7-14 days). Tier 1 = SQLite archive for long-term storage. Auto-archives old sessions with LLM summarization. Use when building agents that need efficient, scalable memory management.
metadata
openclaw
requires
bins
install
kind
manual
label
Install Ollama (https://ollama.com/download) — used for LLM summarization during archiving. Optional: use --skip-llm flag to archive without it.

Tiered Memory Skill

Two-tier memory system combining OpenClaw's QMD semantic search with SQLite archival. Keeps recent memories fast and searchable while compressing old sessions for long-term storage.

Architecture

┌─────────────────────────────────────────┐
│  TIER 0: QMD Semantic Search            │
│  ├── Hot memory (7-14 days)             │
│  ├── GPU-accelerated vector search      │
│  └── Searches: MEMORY.md, memory/*.md   │
├─────────────────────────────────────────┤
│  TIER 1: SQLite Archive                 │
│  ├── Cold storage (14+ days)            │
│  ├── Compressed summaries + key facts   │
│  └── Structured queries via SQL         │
└─────────────────────────────────────────┘

Quick Start

1. Ensure QMD is Enabled

QMD comes with OpenClaw. Check status:

openclaw doctor

Should show QMD as available. If not, check ~/.openclaw/openclaw.json:

{
  "memory": {
    "qmd": {
      "enabled": true,
      "device": "cuda"
    }
  }
}

2. Set Up Archive Directory

mkdir -p ~/.openclaw/workspace/memory/archive

3. Install Cron Job (Auto-archive)

# Add to crontab
crontab -e

# Add this line for daily 2 AM archive
0 2 * * * /usr/bin/python3 ~/.openclaw/skills/tiered-memory/scripts/memory_archiver.py --days 14 >> ~/.openclaw/workspace/memory/archive.log 2>&1

4. Use in Your Agent

import sys
sys.path.insert(0, '~/.openclaw/skills/tiered-memory/scripts')
from tiered_memory import TieredMemory

mem = TieredMemory()

# Query across both tiers
results = mem.search("AgentBear project")

Manual Archive

# See what would be archived
python3 ~/.openclaw/skills/tiered-memory/scripts/memory_archiver.py --dry-run

# Archive files older than 14 days
python3 ~/.openclaw/skills/tiered-memory/scripts/memory_archiver.py

# Archive with custom threshold
python3 ~/.openclaw/skills/tiered-memory/scripts/memory_archiver.py --days 7

# Skip LLM (faster, basic summaries)
python3 ~/.openclaw/skills/tiered-memory/scripts/memory_archiver.py --skip-llm

Query Archives

# List all archived sessions
python3 ~/.openclaw/skills/tiered-memory/scripts/memory_archiver.py --list

# Search archived summaries
python3 ~/.openclaw/skills/tiered-memory/scripts/memory_archiver.py --search "AgentBear"

How It Works

Daily Flow

  1. During Day: Agent writes to memory/YYYY-MM-DD.md
  2. QMD Indexes: Real-time semantic indexing
  3. At 2 AM: Cron runs archiver
  4. Old Files: Summarized → SQLite → moved to archive/

Search Priority

When an agent searches memory:

  1. QMD search (Tier 0) - semantic, fuzzy, fast
  2. If not found or need history: Query SQLite (Tier 1)

Archive Format

FieldTypeDescription
session_dateDATEOriginal file date
summaryTEXTLLM-generated summary
key_factsJSONImportant facts extracted
topicsJSONTags/categories
message_countINTLines in original file

Database Schema

CREATE TABLE archived_sessions (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    source_file TEXT NOT NULL,
    session_date DATE NOT NULL,
    summary TEXT NOT NULL,
    key_facts TEXT,  -- JSON array
    topics TEXT,     -- JSON array
    message_count INTEGER,
    archived_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX idx_date ON archived_sessions(session_date);
CREATE INDEX idx_topics ON archived_sessions(topics);

Scripts

  • scripts/memory_archiver.py - Archive old files to SQLite
  • scripts/tiered_memory.py - Unified search across both tiers

Files

  • references/qmd-setup.md - QMD configuration details
  • references/archiver-api.md - Archiver script API reference

Notes

  • QMD requires CUDA GPU for best performance (falls back to CPU)
  • Archive uses Ollama for summarization (qwen2.5-coder:14b default)
  • Original files are preserved in archive/ folder
  • SQLite DB at ~/.openclaw/memory_archive.db

Troubleshooting

QMD not working? See references/qmd-setup.md

Archive failing? Check Ollama is running: ollama list

Want to restore archived file? Just move it back from memory/archive/ to memory/

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

97.69%
按下载量换算1,160

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills