mem0ai/mem0 · error · Error
Missing memoryExportId or filters
Error message
Missing memoryExportId or filters
What it means
Thrown by MemoryClient.getMemoryExport() when the payload has neither memoryExportId nor filters. The POST /v1/exports/get/ endpoint needs one of the two to locate an export: an explicit ID from createMemoryExport's response, or filters to look it up. Supplying both is fine; supplying neither is rejected locally before the request.
Source
Thrown at mem0-ts/src/client/mem0.ts:793
headers: this.headers,
body: JSON.stringify({
...camelToSnakeKeys(rest),
filters,
schema,
}),
},
);
return response;
}
async getMemoryExport(
data: GetMemoryExportPayload,
): Promise<{ message: string; id: string }> {
this._captureEvent("get_memory_export", []);
if (!data.memoryExportId && !data.filters) {
throw new Error("Missing memoryExportId or filters");
}
const { filters, ...rest } = data;
const response = await this._fetchWithErrorHandling(
`${this.host}/v1/exports/get/`,
{
method: "POST",
headers: this.headers,
body: JSON.stringify({
...camelToSnakeKeys(rest),
...(filters && { filters }),
}),
},
);
return response;
}
}
View on GitHub (pinned to 001c235229)
Solutions
- Poll with the created export's ID: const { id } = await client.createMemoryExport(...); then await client.getMemoryExport({ memoryExportId: id })
- Or look up by the same filters used at creation: await client.getMemoryExport({ filters: { user_id: 'u1' }, schema })
- Type the payload as GetMemoryExportPayload so the compiler flags an empty/invalid object
Example fix
// before
const created = await client.createMemoryExport(payload);
await client.getMemoryExport({});
// after
const created = await client.createMemoryExport(payload);
await client.getMemoryExport({ memoryExportId: created.id }); Defensive patterns
Strategy: type-guard
Validate before calling
const hasLookupKey = (p: GetMemoryExportPayload) =>
typeof p.memoryExportId === 'string' && p.memoryExportId.length > 0 ||
!!p.filters;
if (!hasLookupKey(payload)) throw new Error('Pass memoryExportId from createMemoryExport, or filters');
await client.getMemoryExport(payload); Type guard
const isGetExportPayload = ( p: Partial<GetMemoryExportPayload>, ): p is GetMemoryExportPayload => (typeof p.memoryExportId === 'string' && p.memoryExportId.length > 0) || (!!p.filters && typeof p.filters === 'object');
Try / catch
try {
const result = await client.getMemoryExport({ memoryExportId: id });
} catch (e) {
if (e instanceof Error && e.message === 'Missing memoryExportId or filters') {
// the create-step ID was lost — re-create the export or persist created.id
throw new Error('Export ID missing; store createMemoryExport().id');
}
throw e;
} Prevention
- Persist the id returned by createMemoryExport immediately — it is the canonical poll handle
- Type poll payloads as GetMemoryExportPayload
- Do not copy the create payload to the get call; they have different required fields
When it happens
Trigger: Calling getMemoryExport({}) or getMemoryExport({ exportInstructions: '...' }) — any payload without memoryExportId and without filters. Common when the ID from createMemoryExport was not threaded through (e.g. destructured the wrong key from the response).
Common situations: Losing the id returned by createMemoryExport (response is { message, id }); retry logic that reuses the create payload instead of the created ID; assuming filters from the create call are remembered server-side.
Related errors
- Missing filters or schema
- projectId must be set to access webhooks
- projectId must be set to create a webhook
- Either memoryId or --all is required
- At least one entity ID is required for deleteEntities.
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/77947f5be3fbc131.
Report an issue: GitHub.