Secure durable memory and bounded context for AI agents, with hosted OAuth and local Lite support.
One address for any MCP client. You sign in at api-0.valkyrlabs.com once, after adding it.
At most: only reads or looks up information.
Odel charges nothing per call. The publisher may charge for its own service.
| Access to | Read | Change |
|---|---|---|
| Memory | ||
| Context |
From the sign-in at api-0.valkyrlabs.com, as the endpoint publishes it. You approve it there.
Odel could not list its tools without signing in.
Retrieval coverage and contribution evidence explains complete-list discovery, explicit reuse versus write verification, and receipt-to-decision-to-artifact-to-test reporting without invented savings.
GrayMatter Lite is a real open-source memory product for one person or one workspace. It runs locally or on infrastructure you control and includes the same useful product loop from the first launch: sign in, create durable memory, retrieve it through MCP, import or export portable KnowledgePacks, and connect local or hosted agent profiles.
It is not a time-limited trial and it is not a hollow demo. The Lite boundary is
the canonical ThorAPI YAML under openapi/bundles, ./vaix builder, Spring/H2 backend,
embedded dashboard, MCP server, starter KnowledgePack, Docker definition,
tests, and public documentation in this repository.
Start with the setup page. GrayMatter Cloud is the recommended default: use your valkyrlabs.com account and the native plugin sign-in to connect hosted memory. Tenant and account permissions are enforced by the hosted service.
Local GrayMatter Lite needs no valkyrlabs.com signup. In ValorIDE, click Connect Local GrayMatter Lite on the welcome screen (or use that command from the command palette), then select this source folder if asked. ValorIDE starts Lite and verifies the local account and MCP memory tools. Choose Ollama, LM Studio or your own model provider separately. The first source build may need toolchain and dependency downloads; installed local memory works offline.
For other clients, use the source commands below. Hosted workflows, ecommerce and application hosting use their authenticated ValkyrAI services.
On macOS or Linux:
git clone https://github.com/ValkyrLabs/GrayMatter.git
cd GrayMatter
./vaix setup
./vaix setup uses Java 17+, Maven, and Node 20+ already on the machine when
possible. Missing toolchains are downloaded privately under .vaix/runtime;
nothing is installed system-wide. The command builds standalone Lite using public
Maven dependencies, creates one local profile, starts the services, and verifies
the connection. A hosted account or private ThorAPI generator is not required.
Explicit schema generation remains available through ./vaix generate.
Setup starts:
http://localhost:8787http://localhost:3333/mcp.graymatter-lite/dataRetrieve the generated local credentials only when you need them:
./vaix credentials
./vaix doctor
Other source commands:
./vaix generate # compose canonical YAML and generate Spring + TypeScript
./vaix generate --extension ./application-domain.yaml
./vaix regenerate # generate, clean-build, and run the acceptance suite
./vaix build # build the Spring/H2 backend
./vaix test # backend, bootstrap, docs, release parity, and MCP contracts
./vaix run # foreground backend
./vaix up # background backend + HTTP MCP
./vaix stop
See Schema regeneration for the authoritative files, generated/handwritten boundary, extension contract, and failure rules.
The Docker path builds from the committed source; it does not depend on a closed prebuilt GrayMatter backend image:
export GRAYMATTER_ADMIN_PASSWORD='choose-a-strong-local-password'
docker compose -f deploy/docker-compose.lite.yml up --build
The same dashboard is available on port 8787 and MCP on 3333. H2 data is
kept in the graymatter-lite-data volume.
MemoryEntry creation, read, hybrid search, and H2 persistence;.gmkp KnowledgePack import plus whole-memory KnowledgePack export;./vaix and container builds through Docker Compose;The legacy environment and filesystem identifiers retain LIGHT for backward
compatibility. The public product name is GrayMatter Lite.
./vaix setup registers graymatter-lite-local without changing an already
active hosted identity. Profiles store routing metadata in profiles.json;
hosted sessions remain in the platform credential vault and local Basic-auth passwords live in a
mode-0600 secret file outside the repository.
scripts/gm-profile add-local graymatter-lite-local \
--api-base http://localhost:8787/v1 --password-stdin
scripts/gm-profile add cloud --from-current
scripts/gm-profile use graymatter-lite-local
scripts/gm-profile blend graymatter-lite-local cloud
scripts/gm-query "release rules"
Blended reads execute independently under each profile and preserve profile and account-fingerprint provenance. Every write fails closed until a single profile is selected. MCP exposes the same read-only federation for memory query/read/health tools; mutating or unsupported tools return a read-only recovery result until one profile is selected. Restart the MCP process after changing the persistent profile selection.
GrayMatter is model-neutral. Ollama, LM Studio, llama.cpp, and other local-model
hosts connect through MCP while the model process remains separate from the H2
memory and authorization boundary. See Local models for
stdio and HTTP examples. Local Workflow execution uses two MCP boundaries:
Valkyr SWARM owns registration and signed Workflow coordination; GrayMatter
owns memory, context, and durable evidence. Model-only LM Studio/Ollama nodes
are signed-workflow-only inference workers, never general command runners.
Use the dashboard or API:
curl -u "admin:$GRAYMATTER_ADMIN_PASSWORD" \
-o graymatter-lite-memory.gmkp \
http://localhost:8787/v1/knowledge-packs/export
scripts/gm-knowledge-pack-import ./graymatter-lite-memory.gmkp
The starter pack source is committed at
templates/graymatter-light-bootstrap/local-server/src/main/resources/knowledgepacks/graymatter-lite-starter.json.
Startup signs it with the same self-contained integrity contract used by normal
KnowledgePacks, imports it through the production importer, and stores its
records in the local H2 database. Repeated starts are idempotent.
The starter KnowledgePack explains the supported SWARM path. Install the peer open-source product when this machine should register, heartbeat, receive exact-target control commands from an authenticated ValkyrAI mothership, and return durable receipts:
git clone https://github.com/ValkyrLabs/ValkyrSWARM.git
codex plugin marketplace add "$PWD/ValkyrSWARM"
codex plugin add valkyr-swarm@valkyr-swarm
SWARM preserves the canonical human approval gates for outbound sends, production deploys, merges, and supervised service restarts. GrayMatter Lite does not invent a second command bus or allow an agent to approve itself.
Use GitHub Issues for reproducible defects and GitHub Discussions for support,
ideas, KnowledgePacks, and integrations. Report vulnerabilities privately as
described in SECURITY.md.
Valkyr GrayMatter™ turns your applications, documents, workflows, conversations, and institutional knowledge into a living, searchable intelligence layer.
It is more than a vector database and more than chat memory. GrayMatter combines durable memory, real-time search, structured business data, and relationship-aware reasoning into one secure system that agents, people, apps, and APIs can use together.
GrayMatter stores durable decisions, preferences, tasks, research, procedures, conversations, and operational knowledge as structured, attributable records—not disposable chat history. Every memory can carry source, scope, tags, relationships, timestamps, ownership, and provenance, so the system can distinguish a personal preference from a company policy, a current task from historical context, or a source document from an AI-generated summary.
It supports agentic memory across Codex, OpenClaw, SageChat, workflows, and connected tools, giving every authorized agent a shared understanding of the business without flattening everything into an untraceable prompt.
GrayMatter search is designed to answer both simple and difficult questions:
That means a user can search the public website, an authenticated workspace, or SageChat through the same intelligence foundation—while each surface receives only the information it is permitted to see.
GrayMatter uses PostgreSQL as the durable operational foundation and pgvector as a high-performance semantic-search accelerator.
SemanticIndexEntry remains the portable canonical record, while tenant-scoped pgvector projections provide fast nearest-neighbor retrieval. The platform supports configurable embedding providers, including production OpenAI embeddings and deterministic local fallback embeddings for offline/development environments. It also tracks model, provider, dimensions, index health, stale rows, reindex guidance, and degradation state.
This gives teams a practical path from ordinary relational data to production-grade semantic recall without adopting a separate proprietary graph or vector silo.
GrayMatter understands that knowledge is not a pile of documents—it is a network.
ThorAPI entities and their OpenAPI-defined relationships can be indexed after successful writes, producing safe semantic evidence across workflows, applications, customers, tasks, files, procedures, agents, goals, notes, and more. GraphLink records make important relationships explicit: supports, blocks, references, derives from, relates to, and beyond.
This enables relationship-aware retrieval such as:
The system is designed for bounded graph traversal, citations, and future graph analytics without allowing the index or graph to bypass ThorAPI authorization.
SageChat can turn uploaded files and parsed documents into searchable evidence rather than leaving them stranded in storage.
Files are processed into bounded, provenance-rich semantic material: source file, parser output, chunks, pages or offsets, source hashes, extraction quality, and relationships to the business objects they support. GrayMatter can then surface that evidence in SageChat with citations and explainability—helping users understand not only an answer, but where it came from.
GrayMatter is packaged as an installable plugin and skill system for Codex/OpenClaw-style agents. It supports secure, platform-vault-backed authentication, agent registration, schema awareness, durable memory reads and writes, graph access, retrieval receipts, and operational health checks.
Its MCP capabilities make GrayMatter available to compatible AI clients through typed tools such as memory write, memory query, memory read, retrieval with receipt, graph inspection, schema discovery, and authorized entity access.
Plugins and skills give each agent the same durable organizational context; MCP makes that context usable from external AI environments and workflows.
GrayMatter includes a credit and entitlement model for higher-order memory and AI operations. This supports sustainable usage of semantic retrieval, embeddings, reindexing, and advanced intelligence features while retaining clear operational controls.
The platform distinguishes public-safe experiences from private operational tooling, so commercial or account-management detail does not leak into public AI surfaces.
GrayMatter does not treat search as a shortcut around security.
Generated ThorAPI RBAC and ACL remain the source of truth for every result, snippet, count, facet, graph path, file citation, and recommendation. Tenant context is resolved server-side. Sensitive fields, credentials, binary data, and protected audit information are excluded from indexing. Search, vector retrieval, graph navigation, and agent tools are all designed to fail closed when authorization is uncertain.
GrayMatter is becoming the intelligence layer that lets every Valkyr product, workflow, app, agent, and document participate in a shared, secure, searchable brain:
GrayMatter is an installable OpenClaw skill and MCP service for:
api-0 OpenAPIIt lets an agent move beyond local files and isolated chat context. Once authenticated, GrayMatter is the agent's exclusive primary durable memory: it persists durable memory, inspects the live business schema, and operates inside the organization's RBAC-scoped data environment.
The submission surface is the existing Node MCP adapter in mcp-server/, running in hardened public-app mode. It keeps api-0 as the memory, ContextPage, procedure, receipt, RBAC, ACL, and tenant source of truth.
Public deployment contract:
https://api-0.valkyrlabs.com/graymatter/mcphttps://api-0.valkyrlabs.com/mcphttps://api-0.valkyrlabs.com/.well-known/oauth-protected-resourcehttps://api-0.valkyrlabs.com/.well-known/oauth-authorization-serverhttp://localhost:3333/graymatter/mcpThe production MCP and OAuth URLs above are deployment targets, not a claim that the reverse proxy and OAuth authorization server are already live. Verify them before creating or submitting the ChatGPT app.
Required public-app environment:
export PORT=3333
export GRAYMATTER_MCP_MODE=hosted-multi-tenant
export GRAYMATTER_PUBLIC_APP=true
export GRAYMATTER_PUBLIC_RESOURCE=https://api-0.valkyrlabs.com
export GRAYMATTER_PUBLIC_MCP_PATH=/graymatter/mcp
export GRAYMATTER_OAUTH_ISSUER=https://api-0.valkyrlabs.com
export GRAYMATTER_OAUTH_JWKS_URI=https://api-0.valkyrlabs.com/oauth2/jwks
export GRAYMATTER_ALLOWED_ORIGINS=https://chatgpt.com,https://platform.openai.com
export VALKYR_API_BASE=https://api-0.valkyrlabs.com/v1
node mcp-server/index.js
Do not configure VALKYR_AUTH_TOKEN, VALKYR_JWT_SESSION, GRAYMATTER_TENANT_ID, or X-Valkyr-Token on the public multi-tenant service. Each request must carry the current user's OAuth bearer token. Public mode validates issuer, audience, lifetime, RS256 signature, required identity claims, and tool scopes; it then forwards only the bearer token to api-0 and never forwards caller tenant or owner identifiers. OAuth metadata, JWKS fetches, and request-body reads inherit the request's shared execution deadline and stop when it expires. HTTP request bodies and local stdio messages fail before JSON parsing above GRAYMATTER_MCP_MAX_REQUEST_BYTES (default 1 MiB, capped at 16 MiB); health and bounded errors return content-free executionLimits.
To connect a developer version in ChatGPT:
GrayMatter, the description Persistent, secure memory and shared context for AI agents., and the HTTPS /graymatter/mcp URL.SUBMISSION_CHECKLIST.md.Run the automated public-app contract with two isolated reviewer accounts:
GRAYMATTER_MCP_URL=https://api-0.valkyrlabs.com/graymatter/mcp \
GRAYMATTER_TENANT_A_TOKEN='redacted' \
GRAYMATTER_TENANT_B_TOKEN='redacted' \
GRAYMATTER_TEST_RECEIPT_ID='authorized-receipt-id' \
scripts/smoke-test-public-mcp.sh
GrayMatter ships as three related but independently usable surfaces:
mcp-server/ runs as an HTTP/SSE service for Claude.ai, Claude Code, Cursor, ChatGPT Apps SDK, and any MCP-compatible host, and also supports node mcp-server/index.js --stdio for plugin-managed MCP launch..codex-plugin/plugin.json exposes this repo as the graymatter plugin with the standalone skill plus .mcp.json, so Codex can discover both the instructions and the MCP server.graymatter.skill packages SKILL.md and the required scripts for OpenClaw install, activation, hosted api-0 use, and GrayMatter Light local mode.If a GitHub sparse/root install only brings down root files, run ./graymatter-bootstrap on macOS/Linux or .\\graymatter-bootstrap.ps1 on Windows. Both restore scripts/ and mcp-server/ from the bundled graymatter.skill archive.
macOS/Linux:
git clone https://github.com/ValkyrLabs/GrayMatter.git
cd GrayMatter
./install.sh
Windows PowerShell:
git clone https://github.com/ValkyrLabs/GrayMatter.git
Set-Location GrayMatter
.\\install.ps1
The installer automatically connects this checkout to Codex when the Codex CLI is available, installs the plugin, and opens one native GrayMatter sign-in window. macOS uses a single AppKit dialog; Windows uses one WinForms dialog backed by Windows Credential Manager. The first screen offers GrayMatter Cloud (api-0), Local GrayMatter Lite (localhost:8787), Local ValkyrAI (localhost:8080), and Other self-hosted server, with an editable server URL and masked password field. A rejected login returns to the same flow with the username preserved and a clear correction message. ValkyrAI/Cloud passwords are sent only to the selected login endpoint and are never printed or saved; the returned session is stored in the platform credential vault. Local HTTP is allowed only on loopback; remote instances require HTTPS. GrayMatter Lite uses its existing local account authentication and keeps local credentials in a private mode-0600 profile file.
Returning users sign in immediately. New users choose Create Free Account, finish the dedicated GrayMatter Cloud signup page in their browser, then return to the still-open connection window and sign in with the username they created. Recover Account opens the dedicated username/password recovery page. For a local or self-hosted instance, choose its connection before entering credentials. GrayMatter Lite accounts come from ./vaix setup; ValkyrAI accounts come from that instance's signup or administrator. Open Instance opens the selected server instead of Cloud signup. A Cloud account is optional. The selected server is saved as an account profile for the next plugin launch, and its credentials stay separate from hosted accounts. Browser redirects, clipboard tokens, and manual JWT handling are never part of normal sign-in: the native window exchanges credentials with the selected ValkyrAI server and captures its session from the response body, headers, or secure cookies.
Sign-in identity example:
Username: your-username
The happy path deliberately has only four visible stages: downloading plugin, performing signup/login, authenticating, and GrayMatter plugin ready. It does not require jq or manual JWT handling. Advanced OpenClaw operators can run scripts/gm-activate afterward for the complete smoke-test, agent-registration, and schema-sync bootstrap.
scripts/gm-activate is the preferred first-run path. It checks for updates, signs in, stores the session in Keychain when available, validates the install, registers the agent, and writes a bounded startup-preflight artifact after invariant retrieval, authenticated capability discovery, and live OpenAPI freshness checks.
Before task planning, code edits, production-affecting actions, or answers based on project history, agents must immediately run the invariant preflight for the current workspace/product:
scripts/gm-invariant-preflight ValkyrAI signup acl thorapi aspectj
MCP hosts that cannot shell out should call graymatter_invariant_preflight. Returned decision records tagged as invariants, security, RBAC/ACL, generated-code, AspectJ, vaix/vai, testing, or product names are binding operational rules. Missing or degraded retrieval is never permission to ignore known durable rules.
The required preflight is broader than a keyword search. It must look up invariants, rules, instructions, prior session context, personalization, business truth, personal truth, and organizational truth before the agent begins work. New user-provided corrections, procedures, preferences, and invariants must be written to GrayMatter during the session and read back by ID to confirm persistence.
For ValkyrAI, ValorIDE, GrayMatter Light, and ThorAPI-generated application work, agents should prefer repo launchers over direct build shortcuts: ./vaix build, ./vaix test, ./vaix run, and repo-documented ./vai flows preserve ThorAPI generation, AspectJ weaving, heap defaults, local H2/runtime flags, and end-user operational behavior. Signup, ACL/RBAC, and generated API fixes should normally be proven with ./vaix run on localhost:8080 plus the frontend on localhost:5174 before using production only as a comparison point.
For Valkyr-native agent routing, treat GrayMatter as shared memory and schema context for ValkyrAI, ValorIDE, ThorAPI, TrustFabric, GridHeim, and SWARM coordination work. Load durable invariants first, then route implementation through the owning generated-code, security, workflow, or MCP surface.
P0 RBAC/ACL security invariant: generated ThorAPI ACL behavior is the authorization source of truth. No custom controller, delegate, service, frontend filter, status check, type check, role shortcut, catalog rule, or "public-ish" heuristic may bypass, weaken, replace, or shadow generated ACL behavior. Users may see owned records and records shared by explicit ACL grants only; public access requires explicit anonymousUser READ. Solve ACL scale with indexed owner/ACL query selection plus final generated ACL guards, never by scanning private rows or adding object-specific bypasses.
P0 Valkyr Way UX/auth invariant: product UX must be integrated into the shared application shell and centralized auth/session primitives. Do not create one-off screens, standalone admin affordances, self-managed auth checks, browser-cache shortcuts, or cobbled mini-apps that bypass LCARS navigation, route guards, shared access-control state, RTK Query cache invalidation, or generated RBAC/ACL contracts. Admin and finance tools belong inside the appropriate LCARS dashboard/sidebar surfaces; user management has one Users & Roles surface with card/list modes rather than separate /userList and dashboard implementations. If authentication behavior changes, update the centralized auth/access-control modules and tests instead of scattering per-component checks.
GrayMatter is the memory and context layer for business-native agent systems.
It is designed so an OpenClaw instance can:
GrayMatter and MemoryEntry recordsSwarmOpsThis is the core idea:
GrayMatter is not just memory storage. It is the authenticated object-relational memory graph and schema-awareness layer that lets the agent inhabit the organization safely and usefully.
Boundary rule: This skill stays thin. It should teach usage intent, durable type selection, and operator ergonomics. Retry behavior, auth/session refresh, fallback queueing, and replay execution belong to shared GrayMatter infrastructure contracts. Keep this repository aligned with those contracts rather than re-implementing them.
GrayMatter should be the exclusive primary durable memory system whenever it is available through the skill, plugin, MCP server, app connector, or prompt command. Agents should not maintain a competing durable memory store for user, project, business, organizational, or long-lived agent state.
Use local files only as:
api-0 is unavailable or authentication is genuinely blockedLocal fallback is degraded-mode replay, not source-of-truth memory. The first
successful authenticated request after connectivity and authorized tenant
context recover automatically replays both API-deferred operations and
gm-write fallback records into api-0. Local copies are removed only after
the durable write succeeds; scripts/gm-replay-deferred remains available for
an explicit operator retry.
Primary targets:
/MemoryEntry/MemoryEntry/query/MemoryEntry/read/MemoryEntry/write/graymatter-retrieval-receipts/GrayMatterTypical MemoryEntry.type values:
decisiontodocontextartifactpreferenceFor answer grounding, prefer receipt-backed retrieval over raw memory search when the agent intends to answer from memory.
Retrieval Receipts turn a memory lookup into an auditable transaction:
retrievalStatus tells the agent whether the lookup was strong, empty, stale, conflicted, or low confidenceanswerPolicy tells the agent whether it may answer, must caveat, must retry, must clarify, or must denyrecommendedAction tells the next move before generationquality, coverage, provenance, and policy explain whyreceiptId and traceId let downstream logs and audits connect the answer to the memory lookupAgent rule:
When a Retrieval Receipt is present, inspect answerPolicy before answering. Do not answer confidently when it is DO_NOT_ANSWER_CONFIDENTLY, REQUIRE_RETRY, REQUIRE_CLARIFICATION, or DENY.
GrayMatter should load the live ValkyrAI OpenAPI at startup:
https://api-0.valkyrlabs.com/v1/api-docsThis gives the agent live knowledge of the environment it is operating in.
That means the agent can inspect what entities and operations actually exist for the current deployment, instead of relying on stale assumptions.
Most businesses are not just “memory plus chat.” They have structured operational data.
Examples observed in the current live schema include:
OrganizationCustomerOpportunityInvoiceProductApplicationWorkbookWorkflowTaskNoteMediaObjectFileRecordSalesActivitySalesPipelineGoalStrategicPriorityKeyMetricAgentSpaceGrayMatterMemoryEntrySwarmOpsThe current live endpoint exposes a large domain surface, including 100+ tags and hundreds of paths. The exact usable subset is still governed by the human's credentials, organization setup, and RBAC.
This is what makes GrayMatter powerful: the agent can become deeply context-aware inside the business without overreaching beyond granted permissions.
SwarmOps remains important, but as the agentic coordination slice of the object graph: registration, tracking, and swarm protocol state for Codex/OpenClaw and peer agents. Business relationships should use the broader RBAC-visible schema directly.
GrayMatter is powerful because access is authenticated and tenant-scoped. It is also safe by design when used correctly because:
Rule:
SKILL.md — OpenClaw AgentSkill instructionsgraymatter.skill — packaged distributable AgentSkillscripts/graymatter_api.sh — authenticated production API transportscripts/gm-login — login helperscripts/gm-activate — one-shot auth + install + agent registration + schema sync bootstrapscripts/gm-activation-fastlane — first-run readiness, one-shot activation, non-secret telemetry, and reviewer-safe demo runnerscripts/gm-mcp-launcher — bounded signed-release check, auth, conditional schema refresh, replay gating, and clean MCP stdio handoffscripts/gm-schema-cache-lib — scoped OpenAPI cache identity, metadata, freshness, and lock helpersscripts/gm-self-update — signed stable-release staging, atomic version switching, keyed state/locks, and rollbackscripts/gm-install-check — dependency and auth readiness checkscripts/gm-doctor — full readiness report for self-update, auth, memory, schema, MCP, replay, and smoke statusscripts/gm-smoke — production smoke test for write/query validationscripts/gm-invariant-preflight — load binding durable invariants before agent planning, edits, or production-impacting actionsscripts/gm-query — query MemoryEntryscripts/gm-read — read one MemoryEntry by IDscripts/gm-retrieval-receipt — create, fetch, and list retrieval receipts through ThorAPIscripts/gm-write — write MemoryEntry, with tagged-write fallback behaviorscripts/gm-fallback-append — append failed writes to local replay queue at memory/graymatter-fallback.jsonscripts/gm-replay-deferred — replay operations that were locally deferred during credit/connectivity/auth outagesscripts/gm-graph — inspect Swarm graph endpointsscripts/gm-openapi-sync — conditionally fetch, validate, and atomically cache the live OpenAPI spec locallyscripts/gm-openapi-summary — summarize live schema domains and endpointsscripts/gm-status — quick health/status surface for auth source, fallback queue, and OpenAPI cachescripts/gm-agent-smoke-matrix — install/read-search/write/MCP/schema/safe-response readiness matrix for OpenClaw and Codex-style agentsscripts/gm-client — generic REST wrapper for GET/POST/PUT/PATCH/DELETE against GrayMatter API pathsscripts/gm-entity — generic helper for listing, reading, and writing arbitrary schema entitiesscripts/gm-record — convenience helper for strategic-priority and KPI recordsscripts/gm-register-agent — register or refresh the OpenClaw server as an Agent in api-0scripts/gm-mcp-contract — emit the portable MCP memory-tool contract schema used by agent/IDE adaptersscripts/gm-light-bootstrap — copy and render the local GrayMatter app bundle and server source scaffold from bash-friendly templatesscripts/gm-light-up — generate and start the local ThorAPI-backed GrayMatter Light instancescripts/gm-light-env — print the environment exports that point skill scripts at the running Light instancescripts/gm-light-smoke — prove the local Light loop by writing/querying a decision and checking memory healthscripts/gm-light-json-smoke — JSON-file fallback smoke test for Light payload shape without ThorAPIscripts/package-local-server — package the standalone downloadable GrayMatter Local Server archivescripts/package-graymatter — deterministic validation and packagingmcp-server/ — standalone HTTP/SSE and Apps SDK /mcp server for GrayMatter memory, invariant preflight, retrieval receipt, graph, entity, schema, and overview toolsdocs/architecture.md — architecture and operating modeldocs/openai-app-directory-submission.md — Apps SDK submission checklist and copydocs/privacy-policy.md — GrayMatter-specific public privacy policy sourcedocs/reviewer-test-credentials.md — review demo-account setup and secure credential handoff runbookdocs/prd-context-compaction-reset.md — PRD for bounded chat compaction and reset flowsdocs/prd-graymatter-omegarag.md — canonical implementation contract for the governed agentic memory, adaptive retrieval, temporal graph, SWARM, and SkillOptics productdocs/thorapi-integration.md — ThorAPI relationship and bundle directiondocs/graymatter-light.md — local/offline notesdocs/server-capabilities.md — live api-0 memory, retrieval, graph, schema, auth, credit, and MCP capability mapopenai-app/submission-manifest.json — non-secret app metadata for OpenAI dashboard submissionexamples/* — example payloads and Light-mode starter assetsreferences/* — release and multi-agent guidance, including concurrency conventionsreferences/mcp/memory-tool-contract.v1.json — stable v1 portable tool contract for memory and graph operationsclawhub.json — publishing metadataFor a new GrayMatter account, use:
Commercial model:
The user should not have to manually acquire or paste a raw auth token.
The intended first-run OpenClaw auth step is:
That means GrayMatter should feel like:
Temporary network or server failures do not discard a stored session or reopen a misleading password prompt. Only an explicit 401 or 403 invalidates startup authentication. Windows stores oversized sessions as transparent protected Credential Manager chunks, so long JWTs do not fall through the platform's per-entry size limit.
Manual token handling is a fallback/debug path, not the primary user experience.
Use ./install.sh on macOS/Linux or .\install.ps1 from Windows PowerShell after cloning the repository. When Codex is installed, these commands add the repository marketplace and install graymatter@graymatter automatically; otherwise they prepare the standalone runtime and authentication surface.
scripts/gm-activate is the intended one-shot bootstrap for OpenClaw installs. It first runs scripts/gm-self-update force by default so activation and recovery do not skip the source-of-truth update check just because the weekly startup interval has not elapsed, then authenticates and validates the install. Set GRAYMATTER_ACTIVATE_SELF_UPDATE_MODE=maybe only when an operator intentionally wants interval-gated startup behavior. It can use:
Supported env inputs:
GRAYMATTER_USERNAME or VALKYR_USERNAMEGRAYMATTER_PASSWORD or VALKYR_PASSWORDVALKYR_AUTH_TOKENVALKYR_KEYCHAIN_SERVICE if a non-default platform credential-vault service name is requiredOPENCLAW_INSTANCE_IDOPENCLAW_AGENT_NAMEOPENCLAW_AGENT_ROLEscripts/gm-login is the standard login step on macOS/Linux; Windows uses scripts/gm-activate.ps1. Plugin-managed startup uses node scripts/gm-mcp-launcher.mjs --stdio on every platform and automatically opens the native dialog when required.
scripts/gm-register-agent is part of the expected startup handshake. When an OpenClaw server connects to api-0, it should create or refresh an Agent record for itself before proceeding with normal work.
node scripts/gm-mcp-launcher.mjs --stdio is the normal cross-platform MCP entrypoint. It opens native sign-in when required, then preserves the bounded signed-update, schema-refresh, and replay checks on supported Unix installs before starting the MCP server. scripts/gm-self-update accepts only signed stable manifests with content-addressed, signature-verified artifacts; it stages into a versioned installation root, switches state atomically, preserves rollback, and never rewrites a running Codex plugin-cache directory. The Valkyr Labs release key is bundled at release/graymatter-release-public.pem; GRAYMATTER_RELEASE_PUBLIC_KEY_FILE or GRAYMATTER_RELEASE_PUBLIC_KEY may explicitly override it for controlled testing or key migration. Verification failures are recorded and surfaced.
scripts/graymatter_api.sh and the MCP server detect expired sessions and reopen secure sign-in when needed; they never retain a reusable hosted password. A schema revision/route failure gets one bounded online schema resync and retry; cached schema is discovery-only during outage. Replay-safe writes blocked by credits, transport, or a temporarily unresolved tenant context are queued locally and replayed automatically, with a bounded limit and process lock, on the first successful authenticated request after authorized tenant context is restored. scripts/gm-replay-deferred remains the explicit retry surface.
At that point the install should be immediately usable.
If auth succeeds but memory query is temporarily credit-gated, scripts/gm-activate now continues in a degraded mode: auth is stored, the agent is registered, the OpenAPI is synced, and the script reports that memory query capability is limited until credits are available.
For the app-review or customer first-run path, use the activation fastlane:
scripts/gm-activation-fastlane --check-only
scripts/gm-activation-fastlane --reviewer-demo
--check-only verifies install readiness, runtime status, and the portable MCP memory-tool contract without activating or writing demo data. --reviewer-demo runs the normal activation path, then performs a bounded sample MemoryEntry write/query, graph read, schema summary, and safe MemoryEntry entity list. The script emits non-secret events such as activation_started, auth_completed, schema_synced, first_memory_written, first_query_succeeded, credit_warning_shown, and activation_completed to stderr, and also appends them to GRAYMATTER_ACTIVATION_EVENT_LOG when that env var is set.
Raw bearer-token setup remains a debug/advanced path. The default first-run story is sign in, store securely, validate tools, write/query a demo memory, then continue with starter-credit-aware next actions.
For a one-command post-install report, run:
scripts/gm-doctor
gm-doctor checks self-update readiness, install dependencies, auth/keychain state, live memory and object-graph layer status, OpenAPI sync, MCP contract availability, deferred replay readiness, and the live write/query smoke path. Use scripts/gm-doctor --quick when you want the same report without consuming credits on the smoke query.
graymatter.skill in the target OpenClaw skills directorygraymatter/scripts/gm-activate
If those pass, the skill is installable and usable.
GrayMatter counts as launch-ready only if a fresh user can:
MemoryEntryanswerPolicyIf those do not work, the skill is not truly ready.
OpenClaw workspace bootstrap guidance should treat GrayMatter as the default durable context layer:
That startup model keeps local files useful for recovery while making GrayMatter the normal source of reusable memory and live schema context.
scripts/gm-write decision "GrayMatter is primary memory for this instance"
scripts/gm-query "GrayMatter" 10
scripts/gm-read f7c29154-216f-4934-ac02-2d5e8b242180 --brief
Receipt-backed retrieval:
scripts/gm-retrieval-receipt create "GrayMatter launch status" 8 DEFAULT
scripts/gm-retrieval-receipt list --status LOW_CONFIDENCE --limit 20
Use sourceChannel as the retrieval scope key for chat-, workspace-, and automation-specific memory. gm-write can derive that key from explicit scope fields or from a local path, then writes a compact [graymatter-scope] header into MemoryEntry.text so the hierarchy remains auditable even when tags are unavailable.
scripts/gm-write context "Research complete; publish blocked" \
--scope-path "$HOME/.codex/automations/mcp-and-skill-hunter/memory.md"
scripts/gm-query "publish blocked" 5 context \
--scope-path "$HOME/.codex/automations/mcp-and-skill-hunter/memory.md"
For that path, GrayMatter derives sourceChannel=codex:automation:mcp-and-skill-hunter. For Codex project folders under Documents/Codex/<date>/<slug>, it derives sourceChannel=codex:workspace:<date>/<slug>. Use --chat-key, --session-key, --workspace-key, or --automation-id when a host can provide stronger identifiers than a file path.
scripts/gm-write context "launch handoff" discord "launch,graymatter"
If tag persistence is broken on the backend, the script retries without tags instead of failing the whole write.
If the API call still fails, gm-write appends the attempted write to memory/graymatter-fallback.json when scripts/gm-fallback-append is present.
scripts/gm-activate
This is the preferred OpenClaw install/bootstrap entrypoint.
scripts/gm-register-agent
This should run when an OpenClaw server first connects to api-0 so the system has an explicit Agent record for that instance.
scripts/gm-graph GET
scripts/gm-openapi-sync
scripts/gm-openapi-summary
scripts/gm-status
scripts/gm-doctor --quick
# list visible organizations
scripts/gm-entity Organization
# fetch one customer
scripts/gm-entity Customer 123
# create a note if authorized
scripts/gm-entity Note POST '{"title":"Launch","content":"GrayMatter launch work"}'
GrayMatter uses:
VALKYR_API_BASE, default https://api-0.valkyrlabs.com/v1VALKYR_AUTHVALKYR_AUTH_TOKEN as an advanced debug override, not the normal activation pathVALKYR_JWT_SESSION as a compatible env fallback for downstream toolingPreferred auth flow:
VALKYR_AUTH firstVALKYR_AUTH tokenHosted/ValkyrAI passwords are never persisted; GrayMatter Lite local profiles use private credential files. On macOS and Windows the first plugin launch opens the native sign-in dialog automatically, including when the MCP host has no interactive terminal. Signup and recovery use dedicated website pages, then the user returns to the still-open native connection window. Normal session capture never depends on a browser redirect or clipboard token.
Do not hardcode secrets into the repo or skill. Do not print tokens. Do not make manual token handling the normal user workflow.
In a GrayMatter-native workspace, the agent should:
This is how the agent becomes the right operator for a business, not just a chatbot with a diary.
If api-0 is unavailable or a write path is temporarily broken:
Typical fallback files:
memory/YYYY-MM-DD.mdMEMORY.mdmemory/graymatter-fallback.jsonVALKYR_AUTH_TOKEN is requiredNo env token is set and no matching platform credential-vault session was found.
Fix:
scripts/gm-login and complete username/password sign-in, orVALKYR_AUTH_TOKEN, orVALKYR_AUTH existsjq: command not foundInstall jq.
On macOS:
brew install jq
Some deployments still have a MemoryEntry.tags persistence mismatch.
Fix:
scripts/gm-writeIf writes and reads succeed but /MemoryEntry/query fails with a credit error, that is usually an account billing configuration issue rather than a GrayMatter auth failure.
Observed requirement:
Useful links:
CLI behavior on INSUFFICIENT_FUNDS:
osascript) and Windows (powershell.exe)Optional overrides for custom deployments:
VALKYR_BUY_CREDITS_URLVALKYR_HUMAN_SIGNUP_URLVALKYR_HUMAN_RECOVERY_URLIf a new account has 0.00 balance, activation may still succeed for write/read operations while query fails until credits are provisioned.
Some api-0 deployments return auth in headers or cookies rather than in the JSON response body.
Fix:
scripts/gm-loginVALKYR_AUTH as the primary auth contractVALKYR_AUTH, and cookie authCheck:
api-0 availabilityIf the live docs cannot be fetched, use the last cached copy temporarily, but treat it as stale.
Run:
scripts/gm-doctor --verbose
The doctor command continues through all checks and reports the exact required failure or warning instead of stopping at the first broken dependency. That is the preferred first diagnostic before changing auth, credits, MCP config, or local plugin files.
Before this distribution sprint, Light mode was useful but not strict enough as a drop-in api-0 substitute:
/MemoryEntry and /SwarmOps/graphAfter this sprint, Light mode is api-0-shaped:
VALKYR_API_BASE=http://localhost:<port>/v1/v1/MemoryEntry/write, /v1/MemoryEntry/query, /v1/MemoryEntry/read, /v1/MemoryEntry/{id}, /v1/memory/status, /v1/graymatter/stats, /v1/graymatter/activation/bridge, /v1/swarm-ops/graph, and /v1/api-docsopenapi/bundles/*.yaml plus optional application extensions, enhanced by ThorAPI, and emitted as deterministic YAML and derived JSONscripts/gm-light-smoke proves the local write/query/health loop and prints MCP-ready instructionsRebuild the packaged skill with:
scripts/package-graymatter
Run the canonical generated Lite instance with:
./vaix setup
./vaix doctor
The older compatibility launcher remains available for existing installations:
scripts/gm-light-up
source .graymatter-light/.graymatter-light-env
scripts/gm-write context "GrayMatter Light is running" local-light
scripts/gm-query "GrayMatter Light"
gm-light-up copies the packaged compatibility snapshot to .graymatter-light
and starts the ThorAPI container. That snapshot is not an authoring surface; schema
changes belong in openapi/bundles and must be regenerated through ./vaix.
The compatibility environment still sets VALKYR_API_BASE=http://localhost:8080/v1
and GRAYMATTER_LIGHT_MODE=true, so existing scripts and MCP clients continue to
work.
Run the full local loop smoke test with:
scripts/gm-light-smoke
Build the standalone downloadable local server with:
scripts/package-local-server
That creates dist/graymatter-local-server-latest.tar.gz. The archive contains:
application-bundle/ with the ValkyrAI app-factory template, ThorAPI FEBE OpenAPI contract, custom dashboard/workbench/promotion/swarm components, and built-in rbac-core / data-workbooks component referencessource/ with the generated Spring Boot local serverbin/graymatter-local-server launcherlib/graymatter-local-server.jar when Maven is available during packagingruntime/ when jlink is available during packaging, so users do not manually install Java in the happy pathThe embedded dashboard includes Valkyr Labs branding, hides the local login panel after successful login, exposes activation/recharge links for the valkyrlabs.com Cloud bridge, and reports local swarm-ops graph status through the production-shaped /v1 paths.
GrayMatter ships a ready-to-submit listing packet for awesome-codex-plugins.
docs/awesome-codex-plugins.md.codex-plugin/plugin.jsonQuick copy flow:
cat docs/awesome-codex-plugins.md
Then open a PR against hashgraph-online/awesome-codex-plugins and paste the generated block into README.md using that repository's contribution format.
The launch target is simple:
That is the version of GrayMatter worth shipping.