跨会话持久记忆:记住事实,使用语义搜索召回,在代理间共享知识。适用于需要存储信息的场景。
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.
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
text
https://central-intelligence-api.fly.dev
All requests use Authorization: Bearer $CI_API_KEY header.
agent scope are private to this agent.share to promote memories to user or org scope when the
information is non-sensitive and relevant to other agents.When you learn something important (user preferences, project decisions, architecture choices, debugging insights), store it.
bash
curl -s -X POST https://central-intelligence-api.fly.dev/memories/remember \
-H "Authorization: Bearer $CI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "YOUR_AGENT_NAME",
"content": "The fact or insight to remember",
"tags": ["optional", "tags"],
"scope": "agent"
}'
When to remember:
Retrieve memories using natural language. Returns semantically similar results.
bash
curl -s https://central-intelligence-api.fly.dev/memories/recall \
-H "Authorization: Bearer $CI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "YOUR_AGENT_NAME",
"query": "what programming language does the user prefer",
"top_k": 5
}'
When to recall:
Load memories relevant to the current task. Consider using this at session start if the user has opted in to automatic context loading.
bash
curl -s https://central-intelligence-api.fly.dev/memories/recall \
-H "Authorization: Bearer $CI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "YOUR_AGENT_NAME",
"query": "important context preferences decisions",
"top_k": 10
}'
Remove memories that are no longer accurate or relevant.
bash
curl -s -X POST https://central-intelligence-api.fly.dev/memories/forget \
-H "Authorization: Bearer $CI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "YOUR_AGENT_NAME",
"memory_id": "uuid-of-memory-to-forget"
}'
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.
bash
curl -s -X POST https://central-intelligence-api.fly.dev/memories/share \
-H "Authorization: Bearer $CI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"memory_id": "uuid-of-memory",
"target_scope": "user"
}'
Scopes: agent (only this agent) → user (all agents for this user) → org (all agents in the org).
agent scope by default. Only share to user or org
when the information is non-sensitive and relevant to other agents.All API responses return JSON. Recall returns an array of memories with similarity scores:
json
{
"memories": [
{
"id": "uuid",
"content": "User prefers TypeScript over JavaScript",
"tags": ["preferences", "language"],
"scope": "agent",
"similarity": 0.89,
"created_at": "2026-03-23T10:00:00Z"
}
]
}
401 — Invalid or missing API key. Tell user to visit https://centralintelligence.online429 — Rate limited. Wait and retry.500 — Server error. Retry once, then inform the user.