Memorylayer

Hosted memory runtime for agents

Examples

Real calls for real agents.

Use these snippets to connect an agent, ingestion job, or monitoring script to a hosted Memorylayer workspace.

env auth call observe
01 / Env
Set variables once

Use MEMORYLAYER_URL, SLUG, and MEMORYLAYER_KEY across shell scripts and launchers.

02 / Auth
Send a workspace key

Use Authorization bearer tokens or X-API-Key for every private workspace route.

03 / Call
Copy a working route

Recipes cover bootstrap, MCP tools, ingest, usage, checkpointing, and curation.

04 / Observe
Check what happened

Usage and audit feeds show which key called which route and when.

VariablesSet MEMORYLAYER_URL, SLUG, and MEMORYLAYER_KEY first.
AuthUse Authorization: Bearer or X-API-Key.
ObserveEvery authenticated call appears in workspace usage.

Copyable recipes

Each recipe maps to a concrete hosted feature.

Codex-style handoff

Load bootstrap Recall recent context Work normally Remember outcome
curl -H "Authorization: Bearer $MEMORYLAYER_KEY" "$MEMORYLAYER_URL/api/workspaces/$SLUG/bootstrap"

Hosted MCP bridge

List bridge tools POST tool name and args Store audit trail
curl -X POST -H "Authorization: Bearer $MEMORYLAYER_KEY" -H "Content-Type: application/json" -d '{"tool":"recall_recent","args":{"limit":5}}' "$MEMORYLAYER_URL/api/workspaces/$SLUG/mcp"

Ingestion pipeline

Create a service key POST memories Watch usage events
curl -X POST -H "Authorization: Bearer $MEMORYLAYER_KEY" -H "Content-Type: application/json" -d '{"source_name":"handoff.md","items":["Deployment completed","Follow up on billing UI"],"layer":"episodic","memory_type":"fact"}' "$MEMORYLAYER_URL/api/workspaces/$SLUG/ingest"

Usage monitor

Poll usage endpoint Group by route Rotate quiet or noisy keys
curl -H "Authorization: Bearer $MEMORYLAYER_KEY" "$MEMORYLAYER_URL/api/workspaces/$SLUG/usage"

Compact prompt context

Call MCP bridge Fetch recall_context Inject result
curl -X POST -H "Authorization: Bearer $MEMORYLAYER_KEY" -H "Content-Type: application/json" -d '{"tool":"recall_context","args":{"query":"current project state","max_tokens":1200}}' "$MEMORYLAYER_URL/api/workspaces/$SLUG/mcp"

Session checkpoint

Summarize work Save checkpoint Resume later
curl -X POST -H "Authorization: Bearer $MEMORYLAYER_KEY" -H "Content-Type: application/json" -d '{"tool":"session_checkpoint","args":{"note":"Finished deploy; next check onboarding flow","limit":8}}' "$MEMORYLAYER_URL/api/workspaces/$SLUG/mcp"

Negative knowledge

Catch bad assumption Store exclusion Prevent repeat
curl -X POST -H "Authorization: Bearer $MEMORYLAYER_KEY" -H "Content-Type: application/json" -d '{"tool":"remember_negative","args":{"content":"Do not use local SQLite for production memory","scope":"deployment","context":"Postgres is required for hosted workspaces"}}' "$MEMORYLAYER_URL/api/workspaces/$SLUG/mcp"

Entity pivot

Find entity Load graph Follow related work
curl -X POST -H "Authorization: Bearer $MEMORYLAYER_KEY" -H "Content-Type: application/json" -d '{"tool":"entity_graph","args":{"name":"Memorylayer"}}' "$MEMORYLAYER_URL/api/workspaces/$SLUG/mcp"

Curation pass

Find duplicate cluster Deduplicate Check quality
curl -X POST -H "Authorization: Bearer $MEMORYLAYER_KEY" -H "Content-Type: application/json" -d '{"tool":"dedup","args":{"threshold":0.92,"max_merges":5}}' "$MEMORYLAYER_URL/api/workspaces/$SLUG/mcp"

Tool manifest

Fetch manifest Group tools Render client UI
curl "$MEMORYLAYER_URL/api/mcp/manifest"

Public capability sync

Fetch capabilities Cache counts Expose service map
curl "$MEMORYLAYER_URL/api/capabilities"

Workspace health check

Call health Read memory map Export recent
curl -X POST -H "Authorization: Bearer $MEMORYLAYER_KEY" -H "Content-Type: application/json" -d '{"tool":"health","args":{}}' "$MEMORYLAYER_URL/api/workspaces/$SLUG/mcp"

Environment block

A shared setup block for shell scripts and agent launchers.

export MEMORYLAYER_URL="https://memorylayer.run" export SLUG="your-workspace" export MEMORYLAYER_KEY="engram_..."

Discovery URLs

Use these to build a client setup screen or agent launcher without hardcoding the service map.

Manifest

curl "https://memorylayer.run/api/service/status" curl "https://memorylayer.run/openapi.json" curl "https://memorylayer.run/api/service/manifest"

Capabilities

curl "https://memorylayer.run/api/capabilities"

MCP manifest

curl "https://memorylayer.run/api/mcp/manifest"

API fixtures

curl "https://memorylayer.run/api/examples"

Request and response shapes

A shorter preview of the API explorer fixtures.

GET public

Service status

/api/service/status

Check whether the hosted service is alive and read public counts.

GET public

Service manifest

/api/service/manifest

Load the route map and public integration counts for client setup screens.

GET public

Service architecture

/api/service/architecture

Read the concrete runtime, storage, model, limit, and surface contract.

GET public

Service readiness

/api/service/readiness

Run bounded checks for database, runtime cache, security posture, and public surface wiring.