Agent Memory

v2.0.8 WordPress 6.0+ GPL-2.0+ โ— WP.org Pending

A portable memory store for AI agents. Store, retrieve, and semantically search knowledge entries via REST API or MCP โ€” directly from your WordPress site.

“The memory is the constant. The model is the variable.”


Overview

BotCreds Agent Memory gives AI agents a persistent memory layer backed by WordPress. Instead of rebuilding context from scratch on every session, agents can write to and read from a shared, durable knowledge store.

It runs in two modes depending on whether you supply an OpenAI API key:

๐Ÿ—‚ KV Mode

Default. Simple key/value store with namespace support. Fast, no external dependencies. Best for structured facts, preferences, and state.

๐Ÿ” Vector Mode

Unlocked when an OpenAI key is configured. Generates text-embedding-3-small embeddings (1,536 dimensions) and enables semantic search via cosine similarity.

Agents interact through a standard REST API or a built-in MCP JSON-RPC endpoint โ€” compatible with Claude Desktop, Claude Code, and any MCP-capable client. The agent never needs to know about embeddings; it just queries in plain language and gets ranked results back.

Requirements

  • WordPress 6.0 or later
  • PHP 7.4 or later
  • MySQL 5.7+ or MariaDB 10.3+
  • HTTPS recommended for REST API access
  • Vector mode only: OpenAI API key with access to text-embedding-3-small

Installation

From WordPress.org (recommended)

Once approved on WP.org, install directly from your WordPress dashboard:

  1. Open the plugin installer

    In your WordPress admin, go to Plugins โ†’ Add New Plugin.

  2. Search for BotCreds Agent Memory

    Type botcreds-agent-memory in the search box and click Install Now.

  3. Activate

    Click Activate. The plugin creates its database table automatically on first activation.

Manual install (GitHub)

Terminal
# Download and unzip
curl -L https://github.com/joesbobclaw/botcreds-agent-memory/archive/refs/heads/main.zip -o agent-memory.zip
unzip agent-memory.zip -d wp-content/plugins/botcreds-agent-memory

# Or via WP-CLI
wp plugin install https://github.com/joesbobclaw/botcreds-agent-memory/archive/main.zip --activate
Note The plugin creates a custom table (wp_botcreds_memory) on activation. Deactivating and reactivating is safe โ€” the table is preserved. Data is only removed on uninstall if the BOTCREDS_MEMORY_REMOVE_DATA constant is set to true.

Configuration

After activation, go to Settings โ†’ Agent Memory in your WordPress admin.

KV Mode (no API key)

Works out of the box. No configuration required. All entries are stored as plain text with optional namespace tagging. Retrieval is exact-match or filtered-list โ€” no semantic search.

Vector Mode (OpenAI)

Add your OpenAI API key to enable semantic search.

wp-config.php (alternative)
// Optional: define in wp-config.php instead of the settings UI
define('BOTCREDS_OPENAI_KEY', 'sk-...');

Once the key is saved, new entries are automatically embedded on write. To embed existing entries, use the Re-index all button in the settings page or call the /reindex endpoint (admin only).

Tip Embeddings are generated via text-embedding-3-small at $0.02 per 1M tokens. For most agent workloads (<10,000 entries), embedding costs are negligible.

Authentication

The REST API uses WordPress Application Passwords for authentication. All write operations (POST, DELETE) require authentication. GET requests are public by default but can be restricted via the settings page.

Generate credentials

  1. Open your user profile

    In WordPress admin, go to Users โ†’ Profile.

  2. Add an Application Password

    Scroll to the Application Passwords section. Enter a name (e.g., my-agent) and click Add New Application Password.

  3. Copy the generated password

    It’s shown once. Store it securely.

Using the credentials

curl (Basic Auth)
curl -u "username:app-password" \
     -H "Content-Type: application/json" \
     https://yoursite.com/wp-json/botcreds-memory/v1/entries
HTTP Header
Authorization: Basic <base64(username:password)>
Warning Application Passwords require HTTPS. They will not work over plain HTTP connections.

REST API Reference

Base URL: https://yoursite.com/wp-json/botcreds-memory/v1

GET /entries List all memory entries

Returns a paginated list of memory entries. Optionally filter by namespace.

Query Parameters

Parameter Type Description
namespace optional string Filter entries by namespace (e.g. project:clawpress)
per_page optional integer Results per page. Default: 20. Max: 100
page optional integer Page number. Default: 1
Request
GET /wp-json/botcreds-memory/v1/entries?namespace=project:clawpress&per_page=10
Response 200
[
  {
    "id": 42,
    "key": "deploy-checklist",
    "value": "Run plugin check, activate, test REST API, update changelog",
    "namespace": "project:clawpress",
    "embedding_model": "text-embedding-3-small",
    "created_at": "2026-06-04T22:14:33Z",
    "updated_at": "2026-06-04T22:14:33Z"
  }
]
POST /entries Create or update an entry

Creates a new memory entry. If a key already exists within the same namespace, the entry is updated in place. If an OpenAI key is configured, an embedding is generated automatically.

Request Body

Parameter Type Description
key required string Unique identifier within the namespace
value required string Content to store. Arbitrary text; this is what gets embedded.
namespace optional string Logical grouping. Default: default
Request
POST /wp-json/botcreds-memory/v1/entries
Content-Type: application/json
Authorization: Basic <credentials>

{
  "key": "deploy-checklist",
  "value": "Run plugin check, activate, test REST API, update changelog",
  "namespace": "project:clawpress"
}
Response 201
{
  "id": 42,
  "key": "deploy-checklist",
  "value": "Run plugin check, activate, test REST API, update changelog",
  "namespace": "project:clawpress",
  "embedding_model": "text-embedding-3-small",
  "created_at": "2026-06-04T22:14:33Z",
  "updated_at": "2026-06-04T22:14:33Z"
}
GET /entries/{id} Retrieve a single entry

Fetch a single memory entry by its numeric ID.

Request
GET /wp-json/botcreds-memory/v1/entries/42
Response 200
{
  "id": 42,
  "key": "deploy-checklist",
  "value": "Run plugin check, activate, test REST API, update changelog",
  "namespace": "project:clawpress",
  "embedding_model": "text-embedding-3-small",
  "created_at": "2026-06-04T22:14:33Z",
  "updated_at": "2026-06-04T22:14:33Z"
}
DELETE /entries/{id} Delete an entry

Permanently removes a memory entry and its stored embedding. Requires authentication.

Request
DELETE /wp-json/botcreds-memory/v1/entries/42
Authorization: Basic <credentials>
Response 200
{
  "deleted": true,
  "id": 42
}

MCP Integration

BotCreds Agent Memory exposes a JSON-RPC 2.0 endpoint that is fully compatible with the Model Context Protocol (MCP). This lets Claude Desktop, Claude Code, and other MCP-capable clients call memory tools natively โ€” no REST knowledge required on the agent side.

MCP endpoint URL:

https://yoursite.com/wp-json/botcreds-memory/v1/mcp

Claude Desktop Setup

Add the following to your Claude Desktop MCP config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "agent-memory": {
      "command": "npx",
      "args": [
        "-y",
        "@botcreds/mcp-bridge",
        "--url",
        "https://yoursite.com/wp-json/botcreds-memory/v1/mcp",
        "--auth",
        "username:app-password"
      ]
    }
  }
}
Note The @botcreds/mcp-bridge package acts as a thin stdio-to-REST proxy. It handles auth and translates MCP tool calls into REST API requests on the agent’s behalf.

Restart Claude Desktop after saving the config file. The memory tools will appear in Claude’s tool list automatically.

Claude Code Setup

Add to your project’s .mcp.json or run via the CLI:

.mcp.json
{
  "servers": {
    "agent-memory": {
      "type": "http",
      "url": "https://yoursite.com/wp-json/botcreds-memory/v1/mcp",
      "headers": {
        "Authorization": "Basic <base64(username:password)>"
      }
    }
  }
}
CLI (one-off)
claude --mcp-server "agent-memory=https://yoursite.com/wp-json/botcreds-memory/v1/mcp"

MCP Tools Reference

Once connected, the following tools are available to the agent:

store_memory Save a fact or note

Stores a value under a key, optionally in a namespace. Creates or updates.

ParameterTypeDescription
key requiredstringMemory key
value requiredstringContent to store
namespace optionalstringLogical group. Default: default
search_memory Find relevant entries by meaning

Performs semantic or keyword search. Returns ranked entries with similarity scores.

ParameterTypeDescription
query requiredstringWhat you’re looking for, in plain language
limit optionalintegerMax results. Default: 5
namespace optionalstringRestrict to namespace
get_memory Retrieve a specific entry by key
ParameterTypeDescription
key requiredstringEntry key
namespace optionalstringNamespace to search within
delete_memory Remove an entry
ParameterTypeDescription
key requiredstringEntry key to delete
namespace optionalstringNamespace the entry belongs to

Data Model

Entries are stored in the wp_botcreds_memory custom table.

ColumnTypeDescription
idbigintAuto-increment primary key
entry_keyvarchar(255)Entry key (unique per namespace)
entry_valuelongtextStored content
namespacevarchar(255)Logical group. Default: default
embeddinglongblobSerialized float32 vector (1,536 dims). NULL in KV mode.
embedding_modelvarchar(100)Model used to generate embedding, e.g. text-embedding-3-small
created_atdatetime UTCRow creation time
updated_atdatetime UTCLast modification time

Error Codes

HTTP StatusCodeMeaning
400missing_keyThe key field is required but was not provided
400missing_valueThe value field is required but was not provided
401rest_forbiddenAuthentication required for this operation
404entry_not_foundNo entry found with the given ID
500embedding_failedOpenAI embedding request failed. Entry was saved without embedding.
503vector_unavailableSemantic search requested but no OpenAI key is configured

Changelog

2.0.8 June 2026 current
  • Added jboydston to plugin contributors list
  • Added == External services == section to readme (OpenAI ToS + privacy links)
  • Filled complete changelog for 2.0.2 โ†’ 2.0.8
  • Added upgrade notices
  • Confirmed tested up to WordPress 7.0
  • Added domain TXT verification record for botcreds.com ownership proof
2.0.4 โ€“ 2.0.7 June 2026
  • Hardening: rate limiting, capability checks on all write endpoints
  • REST settings endpoint fixes (admin only)
  • Improved error handling for failed OpenAI embedding calls (degrade gracefully, store without embedding)
  • Readme and metadata cleanup for WP.org submission
2.0.2 โ€“ 2.0.3 June 2026
  • Initial WP.org submission version (2.0.2)
  • MCP JSON-RPC endpoint stable
  • KV + Vector mode both functional
  • Plugin Check clean (no errors or warnings)
2.0.0 June 2026
  • Added semantic search via text-embedding-3-small embeddings
  • New class-embeddings.php โ€” handles embedding generation + cosine similarity
  • Stores 1,536-dimensional float32 vectors per entry
  • MCP JSON-RPC endpoint introduced
  • Claude Desktop + Claude Code integration confirmed working
1.4.0 May 2026
  • Initial KV store implementation
  • REST API: list, create, get, delete endpoints
  • Namespace support
  • Application Password authentication

BotCreds Agent Memory ยท botcreds.com ยท GitHub ยท GPL-2.0+