mem0ai/mem0 · error · Error
${label} has unknown keys: ${unknown.join(", ")}
Error message
${label} has unknown keys: ${unknown.join(", ")} What it means
Strict-schema error thrown by mem0ConfigSchema.parse (via assertAllowedKeys) when the openclaw-mem0 plugin config in openclaw.json contains keys outside ALLOWED_KEYS (mode, apiKey, anonymousTelemetryId, baseUrl, userId, userEmail, autoCapture, autoRecall, customInstructions, customCategories, customPrompt, searchThreshold, topK, oss, skills). The message lists every offending key. Unknown mode values get a warning instead — but unknown keys hard-fail.
Source
Thrown at integrations/openclaw/config.ts:172
"autoCapture",
"autoRecall",
"customInstructions",
"customCategories",
"customPrompt",
"searchThreshold",
"topK",
"oss",
"skills",
];
function assertAllowedKeys(
value: Record<string, unknown>,
allowed: string[],
label: string,
) {
const unknown = Object.keys(value).filter((key) => !allowed.includes(key));
if (unknown.length === 0) return;
throw new Error(`${label} has unknown keys: ${unknown.join(", ")}`);
}
export const mem0ConfigSchema = {
parse(value: unknown, fileConfig?: FileConfig): Mem0Config {
if (!value || typeof value !== "object" || Array.isArray(value)) {
throw new Error("openclaw-mem0 config required");
}
const cfg = value as Record<string, unknown>;
assertAllowedKeys(cfg, ALLOWED_KEYS, "openclaw-mem0 config");
// Only two modes: "platform" (default) or "open-source"
if (
typeof cfg.mode === "string" &&
cfg.mode !== "platform" &&
cfg.mode !== "open-source"
) {
console.warn(
`[mem0] Unknown mode "${cfg.mode}" — expected "platform" or "open-source". Defaulting to "platform".`,View on GitHub (pinned to 001c235229)
Solutions
- Remove or rename the listed unknown keys so only ALLOWED_KEYS remain at the top level of the plugin section.
- OSS provider settings (llm, embedder, vectorStore) belong inside the 'oss' object, not at top level — move them there.
- Check key casing: apiKey not apikey, searchThreshold not search_threshold.
Example fix
// before (openclaw.json)
"openclaw-mem0": { "mode": "open-source", "apikey": "m0-..." }
// after
"openclaw-mem0": { "mode": "open-source", "apiKey": "m0-..." } Defensive patterns
Strategy: validation
Validate before calling
const ALLOWED = ['mode','apiKey','anonymousTelemetryId','baseUrl','userId','userEmail','autoCapture','autoRecall','customInstructions','customCategories','customPrompt','searchThreshold','topK','oss','skills'];
const unknown = Object.keys(pluginCfg).filter((k) => !ALLOWED.includes(k));
if (unknown.length) throw new Error(`unknown config keys: ${unknown.join(', ')}`); Prevention
- Keep OSS provider settings nested under the 'oss' key.
- Match key casing exactly (apiKey, searchThreshold, topK).
- Re-validate config after copying snippets from docs — versions drift.
When it happens
Trigger: Adding a top-level key to the plugins['openclaw-mem0'] section that is not in ALLOWED_KEYS, e.g. 'llm', 'embedder', 'version', or a misspelled key like 'apikey' (keys are case-sensitive).
Common situations: Copy-pasting config snippets from docs of a different plugin version; renaming of accepted keys between versions; users putting OSS sub-settings at top level instead of inside the 'oss' object.
Related errors
- openclaw-mem0 config required
- Unknown LLM provider: ${providerId}
- Unknown embedder provider: ${providerId}
- Langchain embedder provider requires an initialized Langchai
- Azure OpenAI requires both API key and endpoint
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/a7c58c141a954f3d.
Report an issue: GitHub.