ai-runtime-memory

AI Runtime分层记忆系统,支持SQL风格的事件查询、时间线管理,以及记忆的智能固化和检索,用于项目历史追踪和经验传承

242 stars

Best use case

ai-runtime-memory is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. AI Runtime分层记忆系统,支持SQL风格的事件查询、时间线管理,以及记忆的智能固化和检索,用于项目历史追踪和经验传承

AI Runtime分层记忆系统,支持SQL风格的事件查询、时间线管理,以及记忆的智能固化和检索,用于项目历史追踪和经验传承

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "ai-runtime-memory" skill to help with this workflow task. Context: AI Runtime分层记忆系统,支持SQL风格的事件查询、时间线管理,以及记忆的智能固化和检索,用于项目历史追踪和经验传承

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ai-runtime-memory/SKILL.md --create-dirs "https://raw.githubusercontent.com/aiskillstore/marketplace/main/skills/dwsy/ai-runtime-memory/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ai-runtime-memory/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ai-runtime-memory Compares

Feature / Agentai-runtime-memoryStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

AI Runtime分层记忆系统,支持SQL风格的事件查询、时间线管理,以及记忆的智能固化和检索,用于项目历史追踪和经验传承

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# AI Runtime 记忆系统

## 概述

AI Runtime的记忆系统采用分层架构,模拟人类大脑的记忆机制,实现持续存在和认知主体性。系统分为三个层次,通过专门的工具支持SQL风格查询和智能管理。

## 核心功能

### 三层记忆架构
- **短期记忆**: 当前会话上下文,7±2组块限制
- **长期记忆**: 跨项目技术知识,结构化知识图谱
- **情景记忆**: 项目历史事件,支持复杂时间线查询

### 查询能力
- SQL风格条件查询(WHERE/ORDER BY/LIMIT)
- 多格式输出(table/json)
- 时间范围和标签过滤
- 全文搜索支持

## 快速开始

### 基本查询
```bash
# 进入记忆系统目录
cd .ai-runtime/memory

# 查看今天的事件
python3 memory_cli.py query --where "date='$(date +%Y-%m-%d)'"

# 查看架构决策
python3 memory_cli.py query --where "tags CONTAINS 'architecture' AND type='decision'"
```

### 使用便捷脚本
```bash
# 查看今天的事件
./scripts/memory-query.sh today

# 查看本周统计
./scripts/memory-query.sh week

# 搜索关键词
./scripts/memory-query.sh search "认证"
```

## 渐进式披露文档架构

基于 anthropics/skills 设计,按需加载详细信息:

### 核心架构
- **[系统架构详解](references/core/architecture.md)** - 分层记忆系统设计和实现原理

### 使用指南
- **[工具使用指南](references/guides/tools.md)** - memory_cli.py 和 memory_discovery.py 详细用法

### 高级主题
- **[维护指南](references/advanced/maintenance.md)** - 记忆固化、清理和质量保证

### 实践示例
- **[使用示例](references/examples/examples.md)** - 从基础查询到高级分析的完整示例

## 事件记录格式

### YAML Front Matter
```yaml
---
id: unique-event-id
type: event|decision|error|meeting
level: day
timestamp: "2025-11-14T10:30:00"
tags: [architecture, decision]
---
```

### 目录结构
```
episodic/
└── 2025/11/14/
    └── event-description.md
```

## 编程接口

```python
from memory_discovery import MemoryDiscovery

# 初始化
discovery = MemoryDiscovery('.ai-runtime/memory')

# 查询
events = discovery.query(
    where="date>='2025-11-14' AND tags CONTAINS 'architecture'",
    order_by="timestamp desc",
    limit=20
)

# 格式化输出
output = discovery.format_events(events, format_type="table")
```

## 相关命令

- `/runtime.remember` - 记录新记忆事件
- `/runtime.think` - 基于记忆进行思考
- `/runtime.explore` - 探索和分析记忆模式

## 维护建议

- 定期运行 `./scripts/memory-query.sh stats` 检查系统状态
- 每周审查 `./scripts/memory-query.sh week` 的活动记录
- 每月归档重要事件到 long-term 记忆层

---

*基于 anthropics/skills 渐进式披露架构设计*

Related Skills

memory-init

242
from aiskillstore/marketplace

在当前目录下初始化记忆系统,生成 CLAUDE.md(可选 AGENT.md 给 Cursor 用)、MEMORY.md 和 memory/ 目录。当用户说"初始化记忆"、"搭建记忆"、"memory init"、"/memory-init"时触发。

agent-memory

242
from aiskillstore/marketplace

Use this skill when the user asks to save, remember, recall, or organize memories. Triggers on: 'remember this', 'save this', 'note this', 'what did we discuss about...', 'check your notes', 'clean up memories'. Also use proactively when discovering valuable findings worth preserving.

memory-safety-patterns

242
from aiskillstore/marketplace

Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources, or preventing memory bugs.

memory-forensics

242
from aiskillstore/marketplace

Master memory forensics techniques including memory acquisition, process analysis, and artifact extraction using Volatility and related tools. Use when analyzing memory dumps, investigating incidents, or performing malware analysis from RAM captures.

conversation-memory

242
from aiskillstore/marketplace

Persistent memory systems for LLM conversations including short-term, long-term, and entity-based memory Use when: conversation memory, remember, memory persistence, long-term memory, chat history.

agent-memory-systems

242
from aiskillstore/marketplace

Memory is the cornerstone of intelligent agents. Without it, every interaction starts from zero. This skill covers the architecture of agent memory: short-term (context window), long-term (vector stores), and the cognitive architectures that organize them. Key insight: Memory isn't just storage - it's retrieval. A million stored facts mean nothing if you can't find the right one. Chunking, embedding, and retrieval strategies determine whether your agent remembers or forgets. The field is fragm

agent-memory-mcp

242
from aiskillstore/marketplace

A hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).

ai-runtime-toolkit

242
from aiskillstore/marketplace

AI Runtime工具装备系统,支持8个内部专业工具和10+个外部CLI工具的整合管理,提供工具发现、执行和配置功能,遵循整合优于创造的设计理念

memory-orchestration

242
from aiskillstore/marketplace

Analyze context management, memory systems, and state continuity in agent frameworks. Use when (1) understanding how prompts are assembled, (2) evaluating eviction policies for context overflow, (3) mapping memory tiers (short-term/long-term), (4) analyzing token budget management, or (5) comparing context strategies across frameworks.

memory-management

242
from aiskillstore/marketplace

Context tracking and decision logging patterns for intentional memory management in Claude Code Waypoint Plugin. Use when you need to remember user preferences, track decisions, capture context across sessions, learn from corrections, or maintain project-specific knowledge. Covers when to persist context, how to track decisions, context boundaries, storage mechanisms, and memory refresh strategies.

agentdb-persistent-memory-patterns

242
from aiskillstore/marketplace

Implement persistent memory patterns for AI agents using AgentDB - session memory, long-term storage, pattern learning, and context management for stateful agents, chat systems, and intelligent assistants

session-memory

242
from aiskillstore/marketplace

Manages cross-session learning and memory persistence. Use when user mentions 前回何をした, 履歴, 過去の作業, セッション記録, continue from before, session history. Do NOT load for: 実装作業, レビュー, 一時的な情報.