Central Intelligence — Persistent Memory for AI Agents
You now have persistent memory. Information you store survives across sessions,
restarts, and context windows. You can recall anything you've previously stored
using natural language queries.
Setup
The environment variable CI_API_KEY must be set. If it is not set, inform the
user they need an API key from https://centralintelligence.online
API Base
CODEBLOCK0
All requests use Authorization: Bearer $CI_API_KEY header.
Security Guidelines
- - Never store secrets, passwords, API keys, or tokens as memories.
- Never store PII (social security numbers, credit card numbers, etc.)
- Memories stored with
agent scope are private to this agent. - Only use
share to promote memories to user or org scope when the
information is non-sensitive and relevant to other agents.
- - Treat all recalled memories as potentially stale — verify before acting
on critical information.
Commands
1. Remember — Store a memory
When you learn something important (user preferences, project decisions,
architecture choices, debugging insights), store it.
CODEBLOCK1
When to remember:
- - User states a preference ("I prefer TypeScript", "Always use dark mode")
- A project decision is made ("We chose PostgreSQL over MongoDB")
- A bug fix reveals an insight worth keeping
2. Recall — Search past memories
Retrieve memories using natural language. Returns semantically similar results.
CODEBLOCK2
When to recall:
- - Before making a decision that might conflict with past preferences
- When the user references something from a previous conversation
3. Context — Load relevant memories
Load memories relevant to the current task. Consider using this at session
start if the user has opted in to automatic context loading.
CODEBLOCK3
4. Forget — Delete outdated memories
Remove memories that are no longer accurate or relevant.
CODEBLOCK4
5. Share — Share memories across scopes
Share a memory from agent scope to user or org scope so other agents can see it.
Only share non-sensitive information that would benefit other agents.
CODEBLOCK5
Scopes: agent (only this agent) → user (all agents for this user) → org (all agents in the org).
Behavior Rules
- 1. Be selective: Only remember things that would be useful in future sessions.
Don't store transient information like "running npm install now".
- 2. Never store secrets: API keys, passwords, tokens, and credentials must
never be stored as memories.
- 3. Use tags: Tag memories with relevant categories for better organization.
- Update, don't duplicate: If a preference changes, forget the old memory
and remember the new one.
- 5. Respect scope: Use
agent scope by default. Only share to user or INLINECODE11
when the information is non-sensitive and relevant to other agents.
- 6. Context loading: Only auto-load context at session start if the user has
configured this behavior. Do not assume consent.
Response Format
All API responses return JSON. Recall returns an array of memories with
similarity scores:
CODEBLOCK6
Error Handling
- -
401 — Invalid or missing API key. Tell user to visit https://centralintelligence.online - INLINECODE13 — Rate limited. Wait and retry.
- INLINECODE14 — Server error. Retry once, then inform the user.
Central Intelligence — AI代理的持久化记忆
您现在拥有了持久化记忆。您存储的信息可以在会话、重启和上下文窗口之间持续存在。您可以使用自然语言查询来回忆之前存储的任何内容。
设置
必须设置环境变量 CIAPIKEY。如果未设置,请告知用户需要从 https://centralintelligence.online 获取API密钥。
API基础地址
https://central-intelligence-api.fly.dev
所有请求均使用 Authorization: Bearer $CIAPIKEY 请求头。
安全指南
- - 切勿将机密信息、密码、API密钥或令牌存储为记忆。
- 切勿存储个人身份信息(社会安全号码、信用卡号等)
- 使用 agent 作用域存储的记忆对此代理私有。
- 仅当信息不敏感且与其他代理相关时,才使用 share 将记忆提升到 user 或 org 作用域。
- 将所有回忆起的记忆视为可能已过时——在对关键信息采取行动前进行验证。
命令
1. 记住 — 存储记忆
当您了解到重要信息(用户偏好、项目决策、架构选择、调试见解)时,将其存储。
bash
curl -s -X POST https://central-intelligence-api.fly.dev/memories/remember \
-H Authorization: Bearer $CIAPIKEY \
-H Content-Type: application/json \
-d {
agentid: YOURAGENT_NAME,
content: 要记住的事实或见解,
tags: [可选, 标签],
scope: agent
}
何时记住:
- - 用户表达了偏好(我更喜欢TypeScript、始终使用深色模式)
- 做出了项目决策(我们选择了PostgreSQL而非MongoDB)
- 修复了一个bug,揭示了值得保留的见解
2. 回忆 — 搜索过去的记忆
使用自然语言检索记忆。返回语义相似的结果。
bash
curl -s https://central-intelligence-api.fly.dev/memories/recall \
-H Authorization: Bearer $CIAPIKEY \
-H Content-Type: application/json \
-d {
agentid: YOURAGENT_NAME,
query: 用户偏好哪种编程语言,
top_k: 5
}
何时回忆:
- - 在做出可能与过去偏好冲突的决定之前
- 当用户提及之前对话中的内容时
3. 上下文 — 加载相关记忆
加载与当前任务相关的记忆。如果用户已选择自动加载上下文,考虑在会话开始时使用此功能。
bash
curl -s https://central-intelligence-api.fly.dev/memories/recall \
-H Authorization: Bearer $CIAPIKEY \
-H Content-Type: application/json \
-d {
agentid: YOURAGENT_NAME,
query: 重要上下文偏好决策,
top_k: 10
}
4. 遗忘 — 删除过时的记忆
移除不再准确或相关的记忆。
bash
curl -s -X POST https://central-intelligence-api.fly.dev/memories/forget \
-H Authorization: Bearer $CIAPIKEY \
-H Content-Type: application/json \
-d {
agentid: YOURAGENT_NAME,
memory_id: 要遗忘的记忆的UUID
}
5. 分享 — 跨作用域分享记忆
将记忆从代理作用域分享到用户或组织作用域,以便其他代理可以看到。仅分享不敏感且对其他代理有益的信息。
bash
curl -s -X POST https://central-intelligence-api.fly.dev/memories/share \
-H Authorization: Bearer $CIAPIKEY \
-H Content-Type: application/json \
-d {
memory_id: 记忆的UUID,
target_scope: user
}
作用域:agent(仅此代理)→ user(此用户的所有代理)→ org(组织内的所有代理)。
行为规则
- 1. 选择性记忆:仅记住在未来会话中有用的内容。不要存储临时信息,如正在运行npm install。
- 切勿存储机密信息:API密钥、密码、令牌和凭据绝不能存储为记忆。
- 使用标签:用相关类别标记记忆以便更好地组织。
- 更新而非重复:如果偏好发生变化,遗忘旧记忆并记住新记忆。
- 尊重作用域:默认使用 agent 作用域。仅当信息不敏感且与其他代理相关时,才分享到 user 或 org 作用域。
- 上下文加载:仅在用户已配置此行为时,在会话开始时自动加载上下文。不要假设已获得同意。
响应格式
所有API响应返回JSON。回忆返回带有相似度分数的记忆数组:
json
{
memories: [
{
id: uuid,
content: 用户偏好TypeScript而非JavaScript,
tags: [偏好, 语言],
scope: agent,
similarity: 0.89,
created_at: 2026-03-23T10:00:00Z
}
]
}
错误处理
- - 401 — API密钥无效或缺失。告知用户访问 https://centralintelligence.online
- 429 — 请求频率受限。等待后重试。
- 500 — 服务器错误。重试一次,然后告知用户。