Skip to main content
Glama

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_delete

  • on_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())

Конфигурация

Переменные окружения

Переменная

Обязательно

Описание

MCP_CLOUDFLARE_API_KEY

Да

Cloudflare API-токен с разрешением Agent Memory

CF_ACCOUNT_ID

Нет

Cloudflare Account ID (по умолчанию — Iceberg Media)

CF_MEMORY_NAMESPACE

Нет

Имя пространства имён (по умолчанию: hermes)

CF_MEMORY_PROFILE

Нет

Имя профиля (по умолчанию: default)

Получение Cloudflare API-токена

  1. Перейдите в Cloudflare Dashboard → API Tokens

  2. Создайте токен с разрешением Agent Memory

  3. Вам потребуется платная подписка Workers и бета-доступ к Agent Memory

Ограничения (официальные)

Параметр

Лимит

Сообщений на ingest()

500

Содержимое сообщения

32 KB UTF-8

Запрос recall

1 KB UTF-8

Идентификатор сессии

64 символа

Имя профиля

100 символов

Имя пространства имён

32 символа


Производительность

Спроектирован так, чтобы никогда не добавлять задержку к ходам вашего агента:

Операция

Задержка

Блокирует?

prefetch()

0ms

Нет — кэшируется + фон

sync_turn()

0ms

Нет — фоновый поток-демон

remember

1.3–3.8s

По запросу пользователя

recall

~5s

По запросу пользователя

list

~0.4s

По запросу пользователя

summary

~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

-
license - not tested
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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.

View all MCP Connectors

Latest Blog Posts

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