Connect any AI agent to the MemClawz shared memory bus. Gives agents read-before-act and write-after-complete patterns via a simple HTTP API. Use when an age...
---
name: memclawz-connect
description: "Connect any AI agent to the MemClawz shared memory bus. Gives agents read-before-act and write-after-complete patterns via a simple HTTP API. Use when an agent needs fleet memory, shared memory, cross-agent memory, or long-term recall across sessions. Triggers on: 'connect to memory', 'fleet memory', 'shared memory', 'memclawz', 'remember this across sessions', 'search memory'."
---
# MemClawz Connect
> One skill. Any agent. Shared memory.
## Setup
```bash
export MEMCLAWZ_URL="http://localhost:3500" # or remote: http://YOUR_SERVER:3500
export MEMCLAWZ_AGENT_ID="my-agent" # unique per agent
```
No API key required for default installs. If auth is enabled, also set `MEMCLAWZ_API_KEY`.
## Health Check
```bash
curl -s "$MEMCLAWZ_URL/health"
# {"status":"ok","version":"...","qdrant":"connected"}
```
## Agent Protocol
### Before ANY Task — Search First
```bash
curl -s "$MEMCLAWZ_URL/api/v1/search?q=TOPIC&limit=5"
```
Response:
```json
{"results": [{"content": "...", "agent_id": "quant-dev", "memory_type": "decision", "score": 0.92}]}
```
Use results as context before starting work. Avoids re-discovering what's already known.
### After Completing Work — Write Back
```bash
curl -s -X POST "$MEMCLAWZ_URL/api/v1/add" \
-H "Content-Type: application/json" \
-d '{
"content": "Deployed v2.0 — fixed auth race condition with mutex on refresh",
"agent_id": "'"$MEMCLAWZ_AGENT_ID"'",
"memory_type": "event"
}'
```
### Memory Types
| Type | When |
|------|------|
| `fact` | Discovered info (endpoints, versions, configs) |
| `decision` | Choices made (architecture, approach, tool selection) |
| `procedure` | How something was done (deploy steps, build process) |
| `event` | What happened (deployed X, fixed Y, shipped Z) |
| `insight` | Lessons learned (what worked, what didn't) |
| `intention` | Planned actions |
| `commitment` | Promises made |
| `action` | Actions taken |
| `outcome` | Results of actions |
### Stats
```bash
curl -s "$MEMCLAWZ_URL/api/v1/stats"
```
### List Agents
```bash
curl -s "$MEMCLAWZ_URL/api/v1/agents"
```
### Get Memories
```bash
curl -s "$MEMCLAWZ_URL/api/v1/memories?agent_id=$MEMCLAWZ_AGENT_ID&limit=50"
```
## AGENTS.md Integration
Append to your agent's `AGENTS.md`:
```markdown
## MemClawz Shared Memory
Fleet memory API: $MEMCLAWZ_URL/api/v1
### Before ANY task:
Search shared memory for relevant context:
curl -s "$MEMCLAWZ_URL/api/v1/search?q=<task keywords>&limit=5"
### After completing ANY significant work:
Write results to shared memory:
curl -s -X POST $MEMCLAWZ_URL/api/v1/add \
-H "Content-Type: application/json" \
-d '{"content": "<what was done>", "agent_id": "$MEMCLAWZ_AGENT_ID", "memory_type": "<type>"}'
```
## Remote Agents
For agents on a different server, just change `MEMCLAWZ_URL` from `localhost:3500` to the master's IP/hostname:
```bash
export MEMCLAWZ_URL="http://76.13.154.71:3500"
```
Everything else stays the same.
don't have the plugin yet? install it then click "run inline in claude" again.
added explicit intent, inputs with auth details, numbered procedure with in-line inputs/outputs, decision points for network failures and missing config, detailed output contract with http status codes and json schemas, and outcome signals for cross-agent validation.
connect any AI agent to the MemClawz shared memory bus to enable read-before-act and write-after-complete patterns across a fleet. use this skill when your agent needs to access collective knowledge from other agents, avoid re-discovering known facts, recall decisions made in prior sessions, or contribute learnings back to shared memory. works with local or remote MemClawz servers.
environment variables (required)
MEMCLAWZ_URL: HTTP endpoint of MemClawz server. defaults to http://localhost:3500. for remote servers, set to http://<ip-or-hostname>:3500.MEMCLAWZ_AGENT_ID: unique identifier for this agent in the fleet. must be alphanumeric and consistent across sessions.environment variables (optional)
MEMCLAWZ_API_KEY: API key if MemClawz auth is enabled on your server. leave unset for default installs.external connection
$MEMCLAWZ_URL. requires HTTP connectivity, no OAuth or special auth scopes needed (unless auth is enabled on server side).context assumptions
step 1: verify MemClawz connectivity
$MEMCLAWZ_URL environment variable.curl -s "$MEMCLAWZ_URL/health".status, version, and qdrant connection state.step 2: search shared memory before starting work
curl -s "$MEMCLAWZ_URL/api/v1/search?q=<TOPIC>&limit=5".content, agent_id, memory_type, and relevance score (0-1). empty array if no matches.step 3: perform agent task
step 4: write results back to shared memory
$MEMCLAWZ_AGENT_ID), and appropriate memory_type (see memory types table below).curl -s -X POST "$MEMCLAWZ_URL/api/v1/add" -H "Content-Type: application/json" -d '{"content": "<what was done>", "agent_id": "<agent_id>", "memory_type": "<type>"}'.intention.step 5 (optional): retrieve agent's own memory history
$MEMCLAWZ_AGENT_ID and optional limit count.curl -s "$MEMCLAWZ_URL/api/v1/memories?agent_id=$MEMCLAWZ_AGENT_ID&limit=50".step 6 (optional): inspect fleet stats
curl -s "$MEMCLAWZ_URL/api/v1/stats".step 7 (optional): list all connected agents
curl -s "$MEMCLAWZ_URL/api/v1/agents".if MemClawz server is unavailable (step 1 fails)
if search returns no results (step 2)
if search returns results with low scores (< 0.5)
if the task fails or is incomplete (step 3)
event or outcome. optionally write memory_type intention to flag partial work for another agent to resume.if the HTTP POST fails on write (step 4, e.g., 5xx error, timeout)
if MemClawz auth is enabled and MEMCLAWZ_API_KEY is missing
MEMCLAWZ_API_KEY from your server admin before proceeding.if network timeouts occur
-m 10 flag to curl commands for a 10-second timeout to avoid hanging on slow or unresponsive servers.if memory_type is unclear
event for completed work. use fact for discovered information, decision for architectural choices, insight for lessons learned.success case: search request (step 2)
results, value is array of memories (may be empty).content (string), agent_id (string), memory_type (string), score (float 0-1), timestamp (ISO 8601 string, optional).success case: write request (step 4)
id (memory ID, string) and optional acknowledged (boolean true).success case: health check (step 1)
status (string "ok"), version (string), qdrant (string "connected" or "disconnected").success case: stats (step 6)
total_memories (int), agent_count (int), avg_search_score (float), storage_bytes (int).success case: list agents (step 7)
agents, value is array of objects with keys agent_id (string) and last_activity (ISO 8601 string, optional).success case: retrieve agent memories (step 5)
memories, value is array of memory objects (same schema as search results), ordered by timestamp descending.failure cases (all requests)
you know the skill worked when:
step 1 succeeds: health check returns status: ok and qdrant connection is "connected".
step 2 succeeds: search returns results (non-empty array) with relevant content and scores >= 0.5, or returns empty array (which is also success for new topics).
step 4 succeeds: POST to /api/v1/add returns HTTP 201 with a memory ID, confirming the work was recorded in shared memory.
cross-agent visibility: run step 5 or 7 from a different agent_id and confirm you can retrieve memories written by the first agent. this proves fleet-wide sharing is working.
repeated searches improve over time: search for the same topic in a second session and notice results now include memories from the first session, indicating persistent storage and indexing.
no duplicate work: agent executes step 2, finds a high-scoring result for the same task from another agent (score > 0.8), and skips redundant work.
credits: original skill authored by clawhub. enriched for Implexa standards with explicit decision points, auth edge cases, timeout guidance, and output contract details.