Persistent Agent Memory
Memory storage and retrieval powered by Coral Bricks. Store facts, preferences, and context; retrieve them later by meaning. All memories are stored in the default collection.
Use when: (1) remembering facts or preferences for later, (2) recalling stored memories by topic or intent, (3) forgetting/removing memories matching a query.
NOT for: web search, file system search, or code search — use other tools for those.
Setup
Set your API key (get one at https://coralbricks.ai):
CODEBLOCK0
Requests are sent to the Coral Bricks Memory API at https://search-api.coralbricks.ai.
Tools
coral_store — Store a memory
Store text with optional metadata for later retrieval by meaning.
CODEBLOCK1
- -
text (required): Content to remember - INLINECODE2 (optional): JSON string of metadata, e.g. INLINECODE3
Output: JSON with status (e.g. {"status": "success"}).
Example:
CODEBLOCK2
coral_retrieve — Retrieve memories by meaning
Retrieve stored memories by semantic similarity. Returns matching content ranked by relevance.
CODEBLOCK3
- -
query (required): Natural language query describing what to recall - INLINECODE7 (optional, default 10): Number of results to return
Output: JSON with results array, each containing text and score.
Example:
CODEBLOCK4
coraldeletematching — Forget memories by query
Remove memories that match a semantic query. Specify what to forget by meaning.
CODEBLOCK5
- -
query (required): Natural language query describing memories to remove
Output: JSON confirming the operation completed.
Example:
CODEBLOCK6
Privacy
Privacy Policy
Notes
- - All memories are stored in the default collection; collections are not exposed to the agent
- All text is embedded into 1024-dimensional vectors for semantic matching
- Results are ranked by cosine similarity (higher score = more relevant)
- Stored memories persist across sessions
- The
metadata field is free-form JSON; use it to tag memories for easier filtering - For more details and examples, see Persistent Agent Memory for AI Agents
Indexing delay (store then retrieve)
In rare cases, memories can take up to 1 second to become retrievable right after storage.
持久化智能体记忆
由 Coral Bricks 驱动的记忆存储与检索。存储事实、偏好和上下文;通过语义含义进行后续检索。所有记忆均存储在默认集合中。
适用场景: (1) 记住后续需要的事实或偏好,(2) 按主题或意图检索已存储的记忆,(3) 遗忘/删除与查询匹配的记忆。
不适用于: 网络搜索、文件系统搜索或代码搜索——这些请使用其他工具。
配置
设置您的 API 密钥(在 https://coralbricks.ai 获取):
bash
export CORALAPIKEY=ak_...
请求将发送至 Coral Bricks 记忆 API,地址为 https://search-api.coralbricks.ai。
工具
coral_store — 存储记忆
存储文本及可选的元数据,以便后续通过语义含义进行检索。
bash
scripts/coralstore.sh 要存储的文本 [元数据json]
- - text(必填):需要记住的内容
- metadata_json(可选):元数据的 JSON 字符串,例如 {source:chat,topic:fitness}
输出:包含 status 的 JSON(例如 {status: success})。
示例:
bash
scripts/coral_store.sh 用户偏好具有降噪功能的头戴式耳机
scripts/coral_store.sh 第三季度营收为210万美元 {source:report}
coral_retrieve — 按语义检索记忆
通过语义相似度检索已存储的记忆。返回按相关性排序的匹配内容。
bash
scripts/coral_retrieve.sh 查询 [k]
- - query(必填):描述需要回忆内容的自然语言查询
- k(可选,默认10):返回的结果数量
输出:包含 results 数组的 JSON,每个结果包含 text 和 score。
示例:
bash
scripts/coral_retrieve.sh 无线耳机偏好 5
scripts/coral_retrieve.sh 季度营收 10
coraldeletematching — 按查询遗忘记忆
删除与语义查询匹配的记忆。通过含义指定需要遗忘的内容。
bash
scripts/coraldeletematching.sh 查询
- - query(必填):描述需要删除记忆的自然语言查询
输出:确认操作完成的 JSON。
示例:
bash
scripts/coraldeletematching.sh 深色模式偏好
scripts/coraldeletematching.sh 忘记我的健身笔记
隐私
隐私政策
说明
- - 所有记忆均存储在默认集合中;集合不对智能体暴露
- 所有文本均嵌入为1024维向量,用于语义匹配
- 结果按余弦相似度排序(分数越高表示相关性越强)
- 已存储的记忆在会话间持久保留
- metadata 字段为自由格式 JSON;可用于标记记忆以便于筛选
- 更多详情和示例,请参阅 面向AI智能体的持久化记忆
索引延迟(存储后检索)
在极少数情况下,记忆在存储后可能需要最多1秒才能被检索到。