Install
openclaw skills install graymatterInstall and use GrayMatter as an OpenClaw skill that provides primary durable memory, shared object-graph state, and authenticated access to the live ValkyrAI schema via api-0. Use when the agent should persist durable memory, inspect organizational data models, and operate inside the business domain through RBAC-scoped API access.
openclaw skills install graymatterGrayMatter is the installable OpenClaw skill for durable memory, shared graph state, and live organizational schema awareness through api-0.
This skill is intentionally thin. It defines when to use GrayMatter, what to write, and how to choose durable types. Transport resilience, retries, token refresh, fallback queues, and replay behavior belong to shared infrastructure and plugin/client runtime, not this skill.
Use GrayMatter as the primary durable memory system. Use local workspace files only as:
GrayMatter is not only a note store. It is the authenticated memory and object-graph layer that lets an OpenClaw instance inhabit the organization's live data model safely, within RBAC and the current account's permissions.
On startup or first use in a workspace that depends on GrayMatter:
scripts/gm-activate is missing but graymatter-bootstrap exists, run ./graymatter-bootstrap to restore runtime files from graymatter.skillhttps://api-0.valkyrlabs.com/v1/api-docsMinimum activation flow:
test -x scripts/gm-activate || ./graymatter-bootstrap
scripts/gm-activate
Expanded manual flow:
scripts/gm-login
scripts/gm-install-check
scripts/gm-smoke
scripts/gm-register-agent
scripts/gm-openapi-sync
Auth should be treated as an OpenClaw-managed first-run step.
The user should be prompted for api-0 username and password, and the resulting session should be stored securely in macOS/iCloud Keychain for reuse.
The user should not need to manually fetch or paste a raw auth token.
Use these first:
/MemoryEntry/MemoryEntry/query/MemoryEntry/read/MemoryEntry/write/GrayMatter/SwarmOps/graphUse MemoryEntry.type intentionally:
decisiontodocontextartifactpreferenceLoad the live OpenAPI spec and use it to understand the organization's environment. This skill assumes the agent should understand and work across the available schema, not just memory endpoints.
Observed live schema domains from api-0 include, among many others:
OrganizationCustomerOpportunityInvoiceProductApplicationWorkbookWorkflowTaskNoteMediaObjectFileRecordSalesActivitySalesPipelineGoalStrategicPriorityKeyMetricAgentSpaceSwarmOpsGrayMatterMemoryEntryThis means a properly authenticated OpenClaw instance can understand the business as a live object graph, not as disconnected chat logs.
Use SwarmOps and related graph endpoints when relationships matter:
Core transport:
scripts/graymatter_api.shReadiness and auth:
scripts/gm-loginscripts/gm-activatescripts/gm-install-checkscripts/gm-smokescripts/gm-register-agentscripts/gm-openapi-syncscripts/gm-openapi-summaryMemory and graph helpers:
scripts/gm-writescripts/gm-queryscripts/gm-graphscripts/gm-entityLocal/server packaging:
scripts/gm-light-bootstrapscripts/gm-light-upscripts/gm-light-envscripts/gm-light-json-smokescripts/package-local-serverMCP server:
mcp-server/ exposes memory_write, memory_read, memory_query, graph_get, entity_list, entity_get, entity_create, and schema_summaryVALKYR_API_BASE to hosted api-0 for Cloud mode or to the running GrayMatter Light base URL for local ThorAPI modeDesign boundary:
For a new GrayMatter account, use:
Commercial model:
Fresh machine or fresh OpenClaw skill install:
scripts/gm-activate
scripts/gm-activate is the one-shot OpenClaw bootstrap script. It can either:
Then it:
Expanded manual flow if needed:
scripts/gm-login
scripts/gm-install-check
scripts/gm-smoke
scripts/gm-register-agent
scripts/gm-openapi-sync
scripts/gm-openapi-summary
scripts/gm-login is the intended OpenClaw login UX: prompt once for username/password, store securely in Keychain, and let the rest of the skill use that session automatically.
scripts/gm-register-agent should run immediately after auth succeeds so the OpenClaw server creates or refreshes an Agent record for itself in api-0 before normal operation.
After that, GrayMatter is ready to use as primary durable memory and schema context.
# query durable memory
scripts/gm-query "graymatter launch" 10
# write durable context
scripts/gm-write context "GrayMatter is primary memory for this OpenClaw instance"
# write durable decision with tags
scripts/gm-write decision "Use GrayMatter as primary memory and file memory as backup" openclaw "graymatter,bootstrap,memory"
# one-shot activation for OpenClaw install or skill bootstrap
scripts/gm-activate
# register this OpenClaw instance as an agent in api-0
scripts/gm-register-agent
# inspect graph state
scripts/gm-graph GET
# fetch live OpenAPI and store a local cache for startup/reference
scripts/gm-openapi-sync
# summarize the live schema in a human-usable way
scripts/gm-openapi-summary
# list organizations visible to the current account
scripts/gm-entity Organization
# fetch a specific customer by id
scripts/gm-entity Customer 123
# create a note directly if the account is allowed
scripts/gm-entity Note POST '{"title":"Launch note","content":"GrayMatter launch in progress"}'
graymatter_api.sh uses:
VALKYR_API_BASE, defaulting to https://api-0.valkyrlabs.com/v1VALKYR_KEYCHAIN_SERVICE, defaulting to VALKYR_AUTHVALKYR_AUTHVALKYR_AUTH_TOKEN if already present as an override/debug pathVALKYR_JWT_SESSION as a compatible env fallbackPreferred auth behavior is OpenClaw-first:
VALKYR_AUTH firstVALKYR_AUTH tokenIf activation can write/read by id and register the agent but semantic memory query is blocked by missing credits, treat that as a degraded startup state rather than total activation failure. Preserve auth, register the agent, sync the schema, and surface that query/list capability is limited until credits are available.
Do not hardcode secrets into the skill. Do not print tokens. Do not require manual token handling as the normal setup path.
The live OpenAPI endpoint is:
https://api-0.valkyrlabs.com/v1/api-docsThis skill expects the spec to be loaded at startup or during activation so the agent understands the environment it is entering.
Use the spec to:
Local cache path used by helper scripts:
tmp/api-docs.jsontmp/api-docs.summary.mdTreat the live API docs as authoritative, but remember that actual access is still constrained by auth and RBAC.
When helping in a GrayMatter-native environment:
Examples:
Customer, Opportunity, SalesActivity, SalesPipelineTask, Workflow, WorkflowExecution, ApplicationNote, MediaObject, FileRecord, SpaceGoal, StrategicPriority, KeyMetricAgent, SwarmOps, GrayMatter, MemoryEntryMemoryEntry.textMemoryEntryWhen tag persistence is healthy, prefer normalized tags such as:
graymattermemorylaunchpatchbotsalesbotscribebotCurrent caution:
MemoryEntry.tags persistence mismatchscripts/gm-write should retry without tags when the backend rejects tagged writesUse MemoryEntry.sourceChannel as the primary retrieval scope key. It is the field that gm-query maps to the query source filter, so it should carry the most specific stable context identifier available.
Recommended scope keys:
codex:automation:<automation-id>codex:workspace:<workspace-key>codex:chat:<chat-id>codex:session:<session-id>When memory is backed by a file path, preserve the folder hierarchy as structured metadata in the MemoryEntry.text header and mirror the strongest scope into sourceChannel. For example, $HOME/.codex/automations/mcp-and-skill-hunter/memory.md should become sourceChannel=codex:automation:mcp-and-skill-hunter with an audit header containing scope, runtime, automationId, artifactPath, and sourceChannel.
The helpers support this convention directly:
scripts/gm-write context "handoff state" --scope-path "$HOME/.codex/automations/mcp-and-skill-hunter/memory.md"
scripts/gm-query "handoff" 5 context --scope-path "$HOME/.codex/automations/mcp-and-skill-hunter/memory.md"
Tags are secondary hints only. Do not depend on tags for scoped retrieval until backend tag persistence is known healthy.
If api-0 is unavailable or a known schema/runtime bug blocks the exact write:
If login authenticates successfully but no token appears in the response body, use the latest scripts/gm-login, which now treats VALKYR_AUTH as the primary contract and checks body, headers, and cookies accordingly.
Do not pretend durable memory succeeded when it did not.
Known operational note:
/MemoryEntry/query may require credits even when write/read paths succeedscripts/graymatter_api.sh prints both links on INSUFFICIENT_FUNDS and attempts a popup prompt on macOS/WindowsVALKYR_BUY_CREDITS_URL, VALKYR_HUMAN_SIGNUP_URLUse local files only as backup, typically:
memory/YYYY-MM-DD.mdMEMORY.mdmemory/graymatter-fallback.jsonGrayMatter remains the primary system of record whenever available.
For this skill to count as installable and immediately usable, a fresh user should be able to:
scripts/gm-login or env varsscripts/gm-install-checkscripts/gm-smokescripts/gm-register-agentscripts/gm-openapi-syncIf any of those fail, the install is not complete.