ai-runtime-memory
AI Runtime分层记忆系统,支持SQL风格的事件查询、时间线管理,以及记忆的智能固化和检索,用于项目历史追踪和经验传承
Best use case
ai-runtime-memory is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
AI Runtime分层记忆系统,支持SQL风格的事件查询、时间线管理,以及记忆的智能固化和检索,用于项目历史追踪和经验传承
Teams using ai-runtime-memory should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ai-runtime-memory/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ai-runtime-memory Compares
| Feature / Agent | ai-runtime-memory | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/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
helix-memory
Long-term memory system for Claude Code using HelixDB graph-vector database. Store and retrieve facts, preferences, context, and relationships across sessions using semantic search, reasoning chains, and time-window filtering.
agentMemory
A hybrid memory system that provides persistent, searchable knowledge management for AI agents.
agent-memory-systems
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-skills
Self-improving agent architecture using ChromaDB for continuous learning, self-evaluation, and improvement storage. Agents maintain separate memory collections for learned patterns, performance metrics, and self-assessments without modifying their static .md configuration.
agent-memory-mcp
A hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).
agent-memory
Long-term memory store for AI agents - save, search, and manage persistent memories across sessions. Load this skill for complete command reference.
Advanced Deterministic Runtime Container
Build deterministic IoC containers with proper lifecycle management, scoping, and disposal patterns. Use when implementing DI containers, managing service lifetimes, or designing runtime systems.
memorylane
Zero-config persistent memory for Claude with automatic cost savings. Use when you need to remember project context, reduce API token costs, track learned patterns, manage memories across sessions, or curate/clean up memories. Automatically compresses context 6x and saves 84% on API costs. Keywords: memory, remember, recall, context, cost savings, reduce tokens, learn, patterns, insights, curate, clean up memories, review memories.
agentuity-cli-cloud-sandbox-runtime-list
List available sandbox runtimes. Requires authentication. Use for Agentuity cloud platform operations
qdrant-memory
Intelligent token optimization through Qdrant-powered semantic caching and long-term memory. Use for (1) Semantic Cache - avoid LLM calls entirely for semantically similar queries with 100% token savings, (2) Long-Term Memory - retrieve only relevant context chunks instead of full conversation history with 80-95% context reduction, (3) Hybrid Search - combine vector similarity with keyword filtering for technical queries, (4) Memory Management - store and retrieve conversation memories, decisions, and code patterns with metadata filtering. Triggers when needing to cache responses, remember past interactions, optimize context windows, or implement RAG patterns.
project-memory
Set up and maintain a structured project memory system in docs/project_notes/ that tracks bugs with solutions, architectural decisions, key project facts, and work history. Use this skill when asked to "set up project memory", "track our decisions", "log a bug fix", "update project memory", or "initialize memory system". Configures both CLAUDE.md and AGENTS.md to maintain memory awareness across different AI coding tools.
memory-systems
Design short-term, long-term, and graph-based memory architectures