我构建了一个 cognitive layer,供 AI agents 使用,能够在不调用 LLM 的情况下学习
Source: Dev.to
问题
每次你的代理开始对话时,都是从零开始。
当然,你可以把摘要塞进系统提示,使用 RAG,或调用 Mem0 或 Zep。
但这些方法都有同一个问题:它们需要 LLM 调用来学习。要提取事实、构建用户画像或理解重要信息时,你要为每个 token 付费,增加延迟,并依赖云服务。
如果学习可以在本地自动进行,且不需要任何 LLM 参与呢?
AuraSDK 与众不同之处
AuraSDK 是一个认知层,能够与任何 LLM 并行运行。它观察交互——在不调用 LLM的情况下,构建出结构化的模式、因果和行为规则的理解。
from aura import Aura, Level
brain = Aura("./agent_memory")
brain.enable_full_cognitive_stack()
# store what happens
brain.store(
"User always deploys to staging first",
level=Level.Domain,
tags=["workflow"]
)
brain.store(
"Staging deploy prevented 3 production incidents",
level=Level.Domain,
tags=["workflow"]
)
# sub-millisecond recall — inject into any LLM prompt
context = brain.recall("deployment decision")
# after enough interactions, the system derives this on its own:
hints = brain.get_surfaced_policy_hints()
# [{"action": "Prefer", "domain": "workflow", "description": "deploy to staging first"}]
没有人写过那条策略规则;系统是从存储的观察模式中自行推导出来的。
认知流水线
AuraSDK 通过五个确定性层处理每条存储记录:
Record → Belief → Concept → Causal → Policy
- Belief – 将相关观察分组,解决冲突
- Concept – 在 Belief 中发现稳定的话题簇
- Causal – 从时间和显式关联中找出因果模式
- Policy – 根据因果模式推导行为提示(Prefer / Avoid / Warn)
整个流水线在毫秒级完成——无需 LLM、无需云、也不需要嵌入向量。
60 秒快速上手
pip install aura-memory
python examples/demo.py
示例输出
Phase 4 - Recall in action
Query: "deployment decision" [0.29ms]
1. Staging deploy prevented database migration failure
2. Direct prod deploy skipped staging -- caused data loss
Query: "code review" [0.18ms]
1. Code review caught SQL injection before merge
2. Code review found performance regression early
5 次学习循环在 16 ms 内完成。召回耗时 0.29 ms。
对比
| 功能 | AuraSDK | Mem0 | Zep | Letta |
|---|---|---|---|---|
| 学习是否需要 LLM | 否 | 是 | 是 | 是 |
| 是否支持离线使用 | 完全 | 部分 | 否 | 使用本地 LLM |
| 召回延迟 |
- 安装方式:
pip install aura-memory - 网站:(原文未提供链接)
如果你在构建 AI 代理,并且希望拥有确定性、可解释、离线可用的记忆功能——不妨试一试,并告诉我你的使用感受。