Memorylayer

Hosted memory runtime for agents

SDK patterns

Copy the wire format.

Memorylayer does not need a heavy client library to be useful. These snippets show the exact calls agents, scripts, and custom dashboards need.

6

ready-to-copy snippets for common clients

5

operator and agent workflows

0

required vendor SDKs; HTTP is enough

fetch python curl manifest
HeadersAuthorization: Bearer or X-API-Key
Body{ tool, args } for bridge calls
DiscoveryUse manifests to render clients without hardcoding

Snippets

These are deliberately plain. They match the service contract exactly.

JavaScript fetch

Call the hosted bridge from a Node or browser-side tool runner.

javascript
const response = await fetch(`${MEMORYLAYER_URL}/api/workspaces/${SLUG}/mcp`, { method: "POST", headers: { "Authorization": `Bearer ${MEMORYLAYER_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ tool: "recall_context", args: { query: "current project state", max_tokens: 1200 } }) }); const payload = await response.json(); console.log(payload.result);

Python requests

Use Memorylayer from scripts, workers, or custom agent harnesses.

python
import os import requests base = os.environ["MEMORYLAYER_URL"] slug = os.environ["SLUG"] key = os.environ["MEMORYLAYER_KEY"] response = requests.post( f"{base}/api/workspaces/{slug}/mcp", headers={"Authorization": f"Bearer {key}"}, json={"tool": "session_checkpoint", "args": {"note": "handoff saved", "limit": 8}}, timeout=30, ) response.raise_for_status() print(response.json()["result"])

Shell recall

Small curl call for debugging keys and tool output.

shell
curl -X POST \ -H "Authorization: Bearer $MEMORYLAYER_KEY" \ -H "Content-Type: application/json" \ -d '{"tool":"recall_hints","args":{"query":"billing work","top_k":5}}' \ "$MEMORYLAYER_URL/api/workspaces/$SLUG/mcp"

Agent bootstrap

Fetch workspace-specific URLs, skills, headers, and tool discovery.

shell
curl -H "Authorization: Bearer $MEMORYLAYER_KEY" \ "$MEMORYLAYER_URL/api/workspaces/$SLUG/bootstrap"

Batch ingest

Push a small handoff or imported dataset into workspace memory.

shell
curl -X POST \ -H "Authorization: Bearer $MEMORYLAYER_KEY" \ -H "Content-Type: application/json" \ -d '{"source_name":"handoff.md","source_type":"handoff","items":["Shipped manifest endpoints","Next: test onboarding"],"memory_type":"fact"}' \ "$MEMORYLAYER_URL/api/workspaces/$SLUG/ingest"

MCP manifest client

Build a tool picker from the public MCP manifest.

javascript
const manifest = await fetch(`${MEMORYLAYER_URL}/api/mcp/manifest`).then((r) => r.json()); for (const group of manifest.tool_groups) { console.log(group.name, group.tools.map((tool) => tool.name)); }

Playbooks

Use these as implementation checklists for agent clients and workspace operators.

New agent session

The agent starts with useful state and leaves a handoff behind.

Fetch bootstrap Load resume_context Call get_skills Use recall_context Save session_checkpoint

Repository handoff

A repo can be picked up by another session without reading stale chat logs.

Ingest summary remember_project remember_decision session_handoff export recent

Memory cleanup

Operators can keep the workspace useful instead of letting memories rot.

quality_metrics dedup batch_tag promote/demote status_history

Investigation pivot

A single entity becomes a navigable map of prior work.

search_entities entity_graph recall_related backlinks focus_brief

Client onboarding

A custom client can wire itself without hardcoded docs.

service manifest MCP manifest capability JSON copy SDK snippet test status