mem0ai/mem0 · error · Error
Unsupported ${this.indexType} index parameter '${key}'. Allo
Error message
Unsupported ${this.indexType} index parameter '${key}'. Allowed: ${Object.keys(allowed).join(", ")} What it means
Index parameter keys are validated against INDEX_PARAMETER_RANGES for the chosen index type. HNSW accepts only 'neighbors' and 'efconstruction'; IVF accepts only 'neighbor partitions', 'samples_per_partition', and 'min_vectors_per_partition'. Any other key is rejected with the full allow-list in the message.
Source
Thrown at mem0-ts/src/oss/src/vector_stores/oracledb.ts:386
}
this.indexParameters = this.validateIndexParameters(config.indexParameters);
this.doCreateIndex = config.doCreateIndex ?? true;
this.config = config;
}
private validateIndexParameters(
parameters?: Record<string, number>,
): Record<string, number> {
if (!parameters) return {};
const allowed = INDEX_PARAMETER_RANGES[this.indexType];
const validated: Record<string, number> = {};
for (const [key, value] of Object.entries(parameters)) {
const range = allowed[key];
if (!range) {
throw new Error(
`Unsupported ${this.indexType} index parameter '${key}'. ` +
`Allowed: ${Object.keys(allowed).join(", ")}`,
);
}
if (!Number.isInteger(value) || value < range[0] || value > range[1]) {
throw new Error(
`Index parameter '${key}' must be an integer between ${range[0]} and ${range[1]}`,
);
}
validated[key] = value;
}
return validated;
}
async initialize(): Promise<void> {
if (!this._initPromise) {
this._initPromise = this._doInitialize().catch(async (error) => {View on GitHub (pinned to 001c235229)
Solutions
- HNSW: use exactly neighbors (2–2048) and efconstruction (1–65535).
- IVF: use exactly 'neighbor partitions' (1–10000000), samples_per_partition, min_vectors_per_partition.
- Map common names: m → neighbors, ef_construction → efconstruction, nlist → 'neighbor partitions'.
- Keep per-type parameter objects and select them alongside indexType in one config constant.
Example fix
// before
new OracleDB({ connectionParams, indexType: 'HNSW', indexParameters: { ef_construction: 400, m: 16 } });
// after
new OracleDB({ connectionParams, indexType: 'HNSW', indexParameters: { efconstruction: 400, neighbors: 16 } }); Defensive patterns
Strategy: validation
Validate before calling
const INDEX_PARAMS: Record<'HNSW'|'IVF', Record<string, [number, number]>> = {
HNSW: { neighbors: [2, 2048], efconstruction: [1, 65535] },
IVF: { 'neighbor partitions': [1, 10_000_000], samples_per_partition: [1, Number.MAX_SAFE_INTEGER], min_vectors_per_partition: [0, Number.MAX_SAFE_INTEGER] },
};
function validateIndexParameters(type: 'HNSW'|'IVF', params: Record<string, number> = {}): void {
const allowed = INDEX_PARAMS[type];
for (const [k, v] of Object.entries(params)) {
const range = allowed[k];
if (!range) throw new RangeError(`Unknown ${type} parameter '${k}'. Allowed: ${Object.keys(allowed).join(', ')}`);
if (!Number.isInteger(v) || v < range[0] || v > range[1]) throw new RangeError(`${type} parameter '${k}' must be an integer ${range[0]}-${range[1]}`);
}
} Type guard
const isHnswParams = (p: Record<string, unknown>): p is { neighbors?: number; efconstruction?: number } =>
Object.keys(p).every((k) => k === 'neighbors' || k === 'efconstruction'); Prevention
- Use Oracle's exact key names: neighbors, efconstruction, 'neighbor partitions' (with the space).
- Keep a per-indexType parameter preset object so keys can never leak across types.
When it happens
Trigger: indexType 'HNSW' with indexParameters { ef_construction: 400 } (snake_case with underscore — not recognized); HNSW with { m: 16 }; IVF with { neighbors: 64 }; IVF lists: sharing one parameter object across both types.
Common situations: Using pgvector/FAISS/Qdrant HNSW naming (m, ef_construction, ef_search, nlist, nprobe) instead of Oracle's; switching indexType from HNSW to IVF without updating indexParameters; hyphen vs underscore confusion — Oracle's IVF key is literally 'neighbor partitions' with a space.
Related errors
- Unsupported index type: ${config.indexType}
- `indexAccuracy` must be an integer between 1 and 100
- Index parameter '${key}' must be an integer between ${range[
- Must provide at least one of `connectionParams` and `client`
- `embeddingModelDims` must be a positive integer
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/041d521906ae1b63.
Report an issue: GitHub.