cf-memory
CF Memory Plugin
Cloudflare Agent Memory for every AI coding agent and LLM framework.
Даёт вашему агенту постоянную межсессионную память на базе Cloudflare Agent Memory — управляемого сервиса, который берёт на себя recall, извлечение фактов и сводки профилей. Не нужно поднимать векторную БД, управлять эмбеддингами или развёртывать Worker.
Для кого это
ИИ-кодинг-агенты (Claude Code, Codex, Cursor, Hermes, OpenClaw, TRAE, OpenCode, pi), которым нужно помнить контекст между сессиями
LLM-фреймворки (LangChain, LangGraph), создающие агентов с постоянной памятью
MCP-клиенты (любой инструмент, поддерживающий Model Context Protocol)
Системы агент-агентного взаимодействия, использующие протокол A2A
Все, кому нужен простой размещённый бэкенд памяти для ИИ-агента
Что умеет
Возможность | Описание |
Запоминание | Сохраняет факты, инструкции, события — CF классифицирует их автоматически |
Поиск | Семантический поиск с синтезированными ответами (не просто сырые совпадения) |
Приём | Принимает реплики диалога — CF извлекает факты/события/инструкции/задачи |
Сводка | Автоматически генерируемый Markdown-профиль всех сохранённых данных |
Пространства имён | Изолирует память по приложению, пользователю или окружению |
Быстрый старт (для любого агента)
pip install git+https://github.com/hansakoch/cf-memory-plugin.git
# Set credentials
export MCP_CLOUDFLARE_API_KEY="your-cf-api-token"
export CF_ACCOUNT_ID="your-account-id"
# Test it works
cf-memory testИнтеграции с агентами
MCP-клиенты (универсально)
Работает с любым MCP-совместимым клиентом: Claude Desktop, Cursor, Windsurf, Continue, Zed и другими.
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}Доступные инструменты: remember, recall, list_memories, get_memory, delete_memory, ingest, summary, list_namespaces, create_namespace, delete_namespace
Hermes
Автоматически обнаруживается через точку входа pip. Файлы копировать не нужно.
# Install
pip install git+https://github.com/hansakoch/cf-memory-plugin.git
# Activate
hermes config set memory.provider cloudflare-memory
# Verify
hermes memory status
# Management
hermes cloudflare-memory status
hermes cloudflare-memory test
hermes cloudflare-memory namespaces
hermes cloudflare-memory cardЧто получает Hermes:
prefetch()— 0ms (кэшируется + фоновый recall)sync_turn()— 0ms (приём в фоновом потоке)6 агентских инструментов:
cf_remember,cf_recall,cf_list,cf_get,cf_summary,cf_deleteon_session_end— автоматически принимает всю сессию для извлечения фактовИнъекция в системный промпт со статусом провайдера
Claude Code
Добавьте в .claude/mcp.json в вашем проекте:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}Или добавьте глобально: claude mcp add cf-memory -- cf-memory serve
Codex (OpenAI)
Добавьте в ~/.codex/config.toml:
[mcp_servers.cf-memory]
command = "cf-memory"
args = ["serve"]
env = { MCP_CLOUDFLARE_API_KEY = "your-token", CF_ACCOUNT_ID = "your-account-id" }Cursor
Добавьте в .cursor/mcp.json в вашем проекте:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}OpenClaw
Добавьте в конфигурацию OpenClaw:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}TRAE / TRAE CN / TraeCode CLI 2.0
Добавьте MCP-сервер в настройки TRAE или в .trae/mcp.json:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}OpenCode
Добавьте в ~/.opencode/config.json:
{
"mcp": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}pi
Добавьте MCP-сервер в конфигурацию pi:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID = "your-account-id"
}
}
}
}Agent Plugins 1.0
Установите как плагин:
pip install git+https://github.com/hansakoch/cf-memory-plugin.gitПакет регистрируется через точку входа hermes_agent.memory_providers. Любой хост, совместимый с Agent Plugins 1.0, обнаружит его автоматически.
LangChain / LangGraph
import asyncio
from cloudflare_memory import CloudflareMemoryClient
# Use as a memory backend in your LangChain/LangGraph agent
client = CloudflareMemoryClient(
account_id="your-account-id",
api_token="your-token",
namespace="my-agent",
profile="user-123",
)
# Store a fact
entry = asyncio.run(client.remember("User prefers Python over JavaScript."))
# Recall
result = asyncio.run(client.recall("What programming language does the user prefer?"))
print(result.answer) # "Python"
# Ingest a conversation
asyncio.run(client.ingest([
{"role": "user", "content": "I'm building a RAG pipeline."},
{"role": "assistant", "content": "Great! Let me help with that."},
]))
# Get summary
summary = asyncio.run(client.get_summary())A2A (Agent-to-Agent)
Запустите A2A-сервер, чтобы другие агенты могли его находить и подключаться к нему:
cf-memory a2a --port 9120Карточка агента: http://localhost:9120/.well-known/agent.json
Навыки: remember, recall, ingest, list, get, summary
Python (автономно)
import asyncio
from cloudflare_memory import CloudflareMemoryClient
async def main():
async with CloudflareMemoryClient(
account_id="your-account-id",
api_token="your-token",
namespace="my-app",
profile="default",
) as client:
# Remember
entry = await client.remember("User is based in London.")
print(f"[{entry.type}] {entry.summary}")
# Recall
result = await client.recall("Where is the user based?")
print(result.answer)
# Ingest conversation (async — memories appear 3-8s later)
await client.ingest([
{"role": "user", "content": "I prefer dark mode."},
{"role": "assistant", "content": "Noted!"},
])
# Summary
print(await client.get_summary())
asyncio.run(main())Конфигурация
Переменные окружения
Переменная | Обязательно | Описание |
| Да | Cloudflare API-токен с разрешением Agent Memory |
| Нет | Cloudflare Account ID (по умолчанию — Iceberg Media) |
| Нет | Имя пространства имён (по умолчанию: |
| Нет | Имя профиля (по умолчанию: |
Получение Cloudflare API-токена
Перейдите в Cloudflare Dashboard → API Tokens
Создайте токен с разрешением Agent Memory
Вам потребуется платная подписка Workers и бета-доступ к Agent Memory
Ограничения (официальные)
Параметр | Лимит |
Сообщений на ingest() | 500 |
Содержимое сообщения | 32 KB UTF-8 |
Запрос recall | 1 KB UTF-8 |
Идентификатор сессии | 64 символа |
Имя профиля | 100 символов |
Имя пространства имён | 32 символа |
Производительность
Спроектирован так, чтобы никогда не добавлять задержку к ходам вашего агента:
Операция | Задержка | Блокирует? |
| 0ms | Нет — кэшируется + фон |
| 0ms | Нет — фоновый поток-демон |
| 1.3–3.8s | По запросу пользователя |
| ~5s | По запросу пользователя |
| ~0.4s | По запросу пользователя |
| ~0.8s | По запросу пользователя |
Справка по CLI
# Standalone
cf-memory test # Connectivity check
cf-memory serve [--transport stdio|sse] # MCP server
cf-memory a2a [--port 9120] # A2A agent server
cf-memory card # Print agent card JSON
# Hermes plugin
hermes cloudflare-memory status # Provider status
hermes cloudflare-memory test # Full connectivity test
hermes cloudflare-memory namespaces # List namespaces
hermes cloudflare-memory create-ns NAME # Create namespace
hermes cloudflare-memory delete-ns NAME # Delete namespace
hermes cloudflare-memory card # Print agent cardРазработка
git clone https://github.com/hansakoch/cf-memory-plugin.git
cd cloudflare-memory
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/ -vЛицензия
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Shared long-term memory vault for AI agents with 20 MCP tools.
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hansakoch/cf-memory-plugin'
If you have feedback or need assistance with the MCP directory API, please join our Discord server