MemoryLayer
Semantic memory infrastructure for AI agents that actually scales.
Features
- - 95% Token Savings - Retrieve only relevant memories
- Semantic Search - Find memories by meaning, not keywords
- Sub-200ms - Lightning-fast memory retrieval
- Multi-tenant - Isolated memory per agent instance
Setup
1. Sign up for FREE account
Visit https://memorylayer.clawbot.hk and sign up with Google. You'll get:
- - 10,000 operations/month
- 1GB storage
- Community support
2. Configure credentials
CODEBLOCK0
3. Install Python SDK (if not using skill wrapper)
CODEBLOCK1
Usage
Basic Example
CODEBLOCK2
Python Example
CODEBLOCK3
Token Savings
Before MemoryLayer:
CODEBLOCK4
After MemoryLayer:
CODEBLOCK5
Result: 95% token reduction, $900/month savings at scale
API Reference
memory.remember(content, options)
Store a new memory.
Parameters:
- -
content (string): Memory content - INLINECODE2 (string): 'episodic' | 'semantic' | 'procedural'
- INLINECODE3 (number): 0.0 to 1.0
- INLINECODE4 (object): Additional tags/data
Returns: Memory object with INLINECODE5
memory.search(query, limit)
Search memories semantically.
Parameters:
- -
query (string): Search query (natural language) - INLINECODE8 (number): Max results (default: 10)
Returns: Array of SearchResult objects
memory.get_context(query, limit)
Get formatted context for prompt injection.
Parameters:
- -
query (string): What context do you need? - INLINECODE11 (number): Max memories (default: 5)
Returns: Formatted string ready for prompt
memory.stats()
Get usage statistics.
Returns: Object with total_memories, memory_types, INLINECODE15
Advanced
Memory Types
Episodic - Events and experiences
CODEBLOCK6
Semantic - Facts and knowledge
CODEBLOCK7
Procedural - How-to and processes
CODEBLOCK8
Metadata Tagging
CODEBLOCK9
Usage Tracking
CODEBLOCK10
Pricing
FREE Plan (Current)
- - 10,000 operations/month
- 1GB storage
- Community support
Pro Plan ($99/mo)
- - 1M operations/month
- 10GB storage
- Email support
- 99.9% SLA
Enterprise (Custom)
- - Unlimited operations
- Unlimited storage
- Dedicated support
- Self-hosted option
- Custom SLA
Support
- - Documentation: https://memorylayer.clawbot.hk/docs
- API Reference: https://memorylayer.clawbot.hk/api
- Community: Discord (link in docs)
- Issues: GitHub (link in docs)
Links
- - Homepage: https://memorylayer.clawbot.hk
- Dashboard: https://dashboard.memorylayer.clawbot.hk
- API Docs: https://memorylayer.clawbot.hk/docs
- Python SDK: https://pypi.org/project/memorylayer (when published)
MemoryLayer
为AI智能体设计的语义记忆基础设施,真正实现可扩展。
功能特性
- - 节省95%的Token - 仅检索相关记忆
- 语义搜索 - 通过含义而非关键词查找记忆
- 低于200毫秒 - 闪电般快速的记忆检索
- 多租户 - 每个智能体实例拥有独立隔离的记忆空间
设置指南
1. 免费注册账号
访问 https://memorylayer.clawbot.hk 并使用Google账号注册。您将获得:
2. 配置凭证
bash
选项1:邮箱/密码
export MEMORYLAYER_EMAIL=your@email.com
export MEMORYLAYER
PASSWORD=yourpassword
选项2:API密钥(生产环境推荐)
export MEMORYLAYER
APIKEY=ml
yourapi
keyhere
3. 安装Python SDK(如不使用技能封装器)
bash
pip install memorylayer
使用示例
基础示例
javascript
// 在您的Clawdbot智能体中
const memory = require(memorylayer);
// 存储一条记忆
await memory.remember(
用户偏好深色模式界面,
{ type: semantic, importance: 0.8 }
);
// 搜索记忆
const results = await memory.search(界面偏好);
console.log(results[0].content); // 用户偏好深色模式界面
Python示例
python
from plugins.memorylayer import memory
存储
memory.remember(
老板喜欢直接汇报,不要废话,
memory_type=semantic,
importance=0.9
)
搜索
results = memory.recall(老板的偏好是什么?)
for r in results:
print(f{r.relevance_score:.2f}: {r.memory.content})
Token节省效果
使用MemoryLayer之前:
python
注入整个记忆文件
context = open(MEMORY.md).read() # 10,500个token
prompt = f{context}\n\n用户:我的偏好是什么?
使用MemoryLayer之后:
python
仅注入相关记忆
context = memory.get_context(用户偏好, limit=5) # 约500个token
prompt = f{context}\n\n用户:我的偏好是什么?
结果: Token减少95%,规模化后每月节省900美元
API参考
memory.remember(content, options)
存储一条新记忆。
参数:
- - content(字符串):记忆内容
- options.type(字符串):episodic | semantic | procedural
- options.importance(数字):0.0到1.0
- options.metadata(对象):附加标签/数据
返回: 包含id的记忆对象
memory.search(query, limit)
语义搜索记忆。
参数:
- - query(字符串):搜索查询(自然语言)
- limit(数字):最大结果数(默认:10)
返回: SearchResult对象数组
memory.get_context(query, limit)
获取格式化上下文,用于提示注入。
参数:
- - query(字符串):您需要什么上下文?
- limit(数字):最大记忆数(默认:5)
返回: 可直接用于提示的格式化字符串
memory.stats()
获取使用统计信息。
返回: 包含totalmemories、memorytypes、operationsthismonth的对象
高级功能
记忆类型
情景记忆 - 事件和经历
javascript
memory.remember(于2026年2月3日部署MemoryLayer, { type: episodic });
语义记忆 - 事实和知识
javascript
memory.remember(老板喜欢简洁的报告, { type: semantic });
程序记忆 - 操作指南和流程
javascript
memory.remember(重启服务器:ssh root@... && systemctl restart..., { type: procedural });
元数据标记
javascript
memory.remember(用户喜欢蓝色, {
type: semantic,
metadata: {
category: preferences,
subcategory: colors,
source: user_profile
}
});
使用量追踪
javascript
const stats = await memory.stats();
console.log(总记忆数:${stats.total_memories});
console.log(本月操作数:${stats.operationsthismonth});
console.log(套餐:${stats.plan}(每月${stats.operations_limit}次操作));
定价方案
免费套餐(当前)
专业套餐(99美元/月)
- - 每月100万次操作
- 10GB存储空间
- 邮件支持
- 99.9%服务等级协议
企业套餐(定制)
- - 无限操作次数
- 无限存储空间
- 专属支持
- 自托管选项
- 定制服务等级协议
支持渠道
- - 文档: https://memorylayer.clawbot.hk/docs
- API参考: https://memorylayer.clawbot.hk/api
- 社区: Discord(链接见文档)
- 问题反馈: GitHub(链接见文档)
相关链接
- - 官网: https://memorylayer.clawbot.hk
- 控制面板: https://dashboard.memorylayer.clawbot.hk
- API文档: https://memorylayer.clawbot.hk/docs
- Python SDK: https://pypi.org/project/memorylayer(发布后可用)