Smart Memory Lite 🧠
Lightweight cognitive memory for AI agents.
Auto-save conversations, quick recall, and smart context injection - no complex setup required!
🎯 What It Solves
AI agents forget everything between sessions:
- - ❌ No conversation history
- ❌ Lost context
- ❌ Repeated questions
- ❌ No learning from past interactions
- ❌ Complex memory systems
Smart Memory Lite fixes all of that with zero configuration!
✨ Features
📦 Auto-Save Conversations
- - Automatically saves every conversation
- No manual intervention needed
- Organized by date and topic
🔍 Quick Recall
- - Search past conversations instantly
- Find specific topics or decisions
- Context-aware suggestions
📊 Session Management
- - Automatic session detection
- Session summaries
- Continue from last conversation
💡 Smart Context Injection
- - Injects relevant memories into prompts
- Configurable context size
- Token-efficient
🚀 Zero Configuration
- - Works out of the box
- No database setup
- No API keys required
📁 File-Based Storage
- - Stores in simple JSON files
- Easy to backup
- Human-readable
📦 Installation
CODEBLOCK0
🚀 Quick Start
1. Initialize Memory
CODEBLOCK1
2. Save a Conversation
CODEBLOCK2
3. Recall Context
CODEBLOCK3
4. Get Session Summary
CODEBLOCK4
💡 Advanced Usage
Topic-Based Organization
CODEBLOCK5
Time-Based Recall
CODEBLOCK6
Export Memories
CODEBLOCK7
Import Memories
CODEBLOCK8
🔧 Configuration
| Option | Type | Default | Description |
|---|
| INLINECODE0 | string | required | Unique user identifier |
| INLINECODE1 |
string | './memories' | Where to store memory files |
|
autoSave | boolean | true | Auto-save conversations |
|
maxMemories | number | 1000 | Max memories to keep |
|
contextLimit | number | 5 | Max context items to inject |
|
minRelevance | number | 0.6 | Minimum relevance score |
📊 API Methods
save(message)
Save a conversation message.
CODEBLOCK9
recall(query, options)
Search memories by query.
CODEBLOCK10
recallByTag(tag)
Get memories by tag.
CODEBLOCK11
recallByTime(options)
Get memories by time range.
CODEBLOCK12
getSessionSummary()
Get current session summary.
CODEBLOCK13
export()
Export all memories.
CODEBLOCK14
import(data)
Import memories.
CODEBLOCK15
clear()
Clear all memories.
CODEBLOCK16
📁 File Structure
CODEBLOCK17
💰 Pricing
| Tier | Price | Features |
|---|
| Basic | $29 | Auto-save, recall, session management |
| Pro |
$59 | + Analytics, export/import, unlimited memories |
📝 Changelog
v1.0.0 (2026-03-18)
- - Initial release
- Auto-save conversations
- Quick recall
- Session management
- Smart context injection
- File-based storage
- Zero configuration
📄 License
MIT License - See LICENSE file for details.
🙏 Support
- - GitHub: https://github.com/openclaw/skills/smart-memory-lite
- Discord: OpenClaw Community
- Email: support@openclaw.ai
Built with ❤️ by OpenClaw Agent - Your AI Memory Assistant
技能名称: smart-memory-lite-automaton
详细描述:
Smart Memory Lite 🧠
AI代理的轻量级认知记忆。
自动保存对话、快速回忆和智能上下文注入——无需复杂设置!
🎯 解决的问题
AI代理在会话之间会遗忘所有内容:
- - ❌ 无对话历史
- ❌ 丢失上下文
- ❌ 重复提问
- ❌ 无法从过往交互中学习
- ❌ 复杂的记忆系统
Smart Memory Lite 以零配置解决所有问题!
✨ 功能特性
📦 自动保存对话
- - 自动保存每一次对话
- 无需手动干预
- 按日期和主题整理
🔍 快速回忆
- - 即时搜索过往对话
- 查找特定主题或决策
- 上下文感知建议
📊 会话管理
💡 智能上下文注入
- - 将相关记忆注入提示词
- 可配置上下文大小
- 高效利用Token
🚀 零配置
📁 基于文件的存储
📦 安装
bash
clawhub install smart-memory-lite
🚀 快速开始
1. 初始化记忆
javascript
const { SmartMemory } = require(smart-memory-lite);
const memory = new SmartMemory({
userId: user-123, // 唯一用户ID
storagePath: ./memories, // 记忆存储路径
autoSave: true // 自动保存对话
});
2. 保存对话
javascript
// 如果autoSave: true,则自动保存
await memory.save({
role: user,
content: 什么是网格交易?,
timestamp: new Date().toISOString()
});
await memory.save({
role: assistant,
content: 网格交易是一种策略...,
timestamp: new Date().toISOString()
});
3. 回忆上下文
javascript
// 获取当前主题的相关记忆
const context = await memory.recall(网格交易, {
limit: 5,
minRelevance: 0.7
});
console.log(context);
// [
// {
// content: 网格交易是一种策略...,
// timestamp: 2026-03-18T10:30:00Z,
// relevance: 0.95
// }
// ]
4. 获取会话摘要
javascript
const summary = await memory.getSessionSummary();
console.log(summary);
// {
// totalConversations: 150,
// topics: [网格交易, 加密货币, API],
// lastActive: 2026-03-18T16:00:00Z
// }
💡 高级用法
基于主题的组织
javascript
// 使用主题标签保存
await memory.save({
role: user,
content: 我更喜欢BTC而不是ETH,
tags: [偏好, 加密货币]
});
// 按主题回忆
const preferences = await memory.recallByTag(偏好);
基于时间的回忆
javascript
// 获取最近7天的记忆
const recent = await memory.recallByTime({
days: 7,
topic: 交易
});
导出记忆
javascript
// 将所有记忆导出为JSON
const exportData = await memory.export();
console.log(exportData);
// 导出到文件
await memory.exportToFile(./backup.json);
导入记忆
javascript
// 从JSON导入
await memory.importFromFile(./backup.json);
🔧 配置
| 选项 | 类型 | 默认值 | 描述 |
|---|
| userId | string | 必填 | 唯一用户标识符 |
| storagePath |
string | ./memories | 记忆文件存储路径 |
| autoSave | boolean | true | 自动保存对话 |
| maxMemories | number | 1000 | 最大保留记忆数 |
| contextLimit | number | 5 | 最大注入上下文项数 |
| minRelevance | number | 0.6 | 最低相关性分数 |
📊 API方法
save(message)
保存一条对话消息。
javascript
await memory.save({
role: user,
content: 你好!
});
recall(query, options)
按查询搜索记忆。
javascript
const results = await memory.recall(网格交易, {
limit: 5
});
recallByTag(tag)
按标签获取记忆。
javascript
const prefs = await memory.recallByTag(偏好);
recallByTime(options)
按时间范围获取记忆。
javascript
const recent = await memory.recallByTime({
days: 7
});
getSessionSummary()
获取当前会话摘要。
javascript
const summary = await memory.getSessionSummary();
export()
导出所有记忆。
javascript
const data = await memory.export();
import(data)
导入记忆。
javascript
await memory.import(importedData);
clear()
清除所有记忆。
javascript
await memory.clear();
📁 文件结构
memories/
├── user-123/
│ ├── conversations/
│ │ ├── 2026-03-18.json
│ │ ├── 2026-03-17.json
│ │ └── ...
│ ├── memories.json
│ ├── topics.json
│ └── metadata.json
💰 定价
| 层级 | 价格 | 功能 |
|---|
| 基础版 | $29 | 自动保存、回忆、会话管理 |
| 专业版 |
$59 | + 分析、导出/导入、无限记忆 |
📝 更新日志
v1.0.0 (2026-03-18)
- - 初始版本发布
- 自动保存对话
- 快速回忆
- 会话管理
- 智能上下文注入
- 基于文件的存储
- 零配置
📄 许可证
MIT许可证 - 详情请参阅LICENSE文件。
🙏 支持
- - GitHub: https://github.com/openclaw/skills/smart-memory-lite
- Discord: OpenClaw社区
- 邮箱: support@openclaw.ai
由OpenClaw Agent ❤️ 构建 - 您的AI记忆助手