Agent Memory
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:
-
Open the plugin installer
In your WordPress admin, go to Plugins โ Add New Plugin.
-
Search for BotCreds Agent Memory
Type
botcreds-agent-memoryin the search box and click Install Now. -
Activate
Click Activate. The plugin creates its database table automatically on first activation.
Manual install (GitHub)
# 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
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.
// 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).
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
-
Open your user profile
In WordPress admin, go to Users โ Profile.
-
Add an Application Password
Scroll to the Application Passwords section. Enter a name (e.g.,
my-agent) and click Add New Application Password. -
Copy the generated password
It’s shown once. Store it securely.
Using the credentials
curl -u "username:app-password" \
-H "Content-Type: application/json" \
https://yoursite.com/wp-json/botcreds-memory/v1/entries
Authorization: Basic <base64(username:password)>
REST API Reference
Base URL: https://yoursite.com/wp-json/botcreds-memory/v1
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 |
GET /wp-json/botcreds-memory/v1/entries?namespace=project:clawpress&per_page=10
[
{
"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"
}
]
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 |
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"
}
{
"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"
}
Fetch a single memory entry by its numeric ID.
GET /wp-json/botcreds-memory/v1/entries/42
{
"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"
}
Permanently removes a memory entry and its stored embedding. Requires authentication.
DELETE /wp-json/botcreds-memory/v1/entries/42
Authorization: Basic <credentials>
{
"deleted": true,
"id": 42
}
Performs semantic search across memory entries using cosine similarity. Requires Vector Mode (OpenAI key configured). The plugin embeds the query internally โ just pass plain-language text.
LIKE full-text search on the value field.
Request Body
| Parameter | Type | Description |
|---|---|---|
| query required | string | Natural-language search query |
| limit optional | integer | Max results to return. Default: 5. Max: 20 |
| namespace optional | string | Restrict search to a specific namespace |
| threshold optional | float | Minimum cosine similarity score (0โ1). Default: 0.7 |
POST /wp-json/botcreds-memory/v1/search
Content-Type: application/json
Authorization: Basic <credentials>
{
"query": "how do I deploy the plugin?",
"limit": 3,
"namespace": "project:clawpress"
}
{
"results": [
{
"id": 42,
"key": "deploy-checklist",
"value": "Run plugin check, activate, test REST API, update changelog",
"namespace": "project:clawpress",
"similarity": 0.924
}
],
"mode": "vector",
"query": "how do I deploy the plugin?"
}
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:
{
"mcpServers": {
"agent-memory": {
"command": "npx",
"args": [
"-y",
"@botcreds/mcp-bridge",
"--url",
"https://yoursite.com/wp-json/botcreds-memory/v1/mcp",
"--auth",
"username:app-password"
]
}
}
}
@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:
{
"servers": {
"agent-memory": {
"type": "http",
"url": "https://yoursite.com/wp-json/botcreds-memory/v1/mcp",
"headers": {
"Authorization": "Basic <base64(username:password)>"
}
}
}
}
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:
Stores a value under a key, optionally in a namespace. Creates or updates.
| Parameter | Type | Description |
|---|---|---|
| key required | string | Memory key |
| value required | string | Content to store |
| namespace optional | string | Logical group. Default: default |
Performs semantic or keyword search. Returns ranked entries with similarity scores.
| Parameter | Type | Description |
|---|---|---|
| query required | string | What you’re looking for, in plain language |
| limit optional | integer | Max results. Default: 5 |
| namespace optional | string | Restrict to namespace |
| Parameter | Type | Description |
|---|---|---|
| key required | string | Entry key |
| namespace optional | string | Namespace to search within |
| Parameter | Type | Description |
|---|---|---|
| key required | string | Entry key to delete |
| namespace optional | string | Namespace the entry belongs to |
Data Model
Entries are stored in the wp_botcreds_memory custom table.
| Column | Type | Description |
|---|---|---|
| id | bigint | Auto-increment primary key |
| entry_key | varchar(255) | Entry key (unique per namespace) |
| entry_value | longtext | Stored content |
| namespace | varchar(255) | Logical group. Default: default |
| embedding | longblob | Serialized float32 vector (1,536 dims). NULL in KV mode. |
| embedding_model | varchar(100) | Model used to generate embedding, e.g. text-embedding-3-small |
| created_at | datetime UTC | Row creation time |
| updated_at | datetime UTC | Last modification time |
Error Codes
| HTTP Status | Code | Meaning |
|---|---|---|
| 400 | missing_key | The key field is required but was not provided |
| 400 | missing_value | The value field is required but was not provided |
| 401 | rest_forbidden | Authentication required for this operation |
| 404 | entry_not_found | No entry found with the given ID |
| 500 | embedding_failed | OpenAI embedding request failed. Entry was saved without embedding. |
| 503 | vector_unavailable | Semantic search requested but no OpenAI key is configured |
Changelog
- Added
jboydstonto 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
- 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
- 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)
- Added semantic search via
text-embedding-3-smallembeddings - 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
- 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+