mem0ai/mem0 · error · Error
Unsupported index type: ${config.indexType}
Error message
Unsupported index type: ${config.indexType} What it means
Oracle 23ai only offers HNSW and IVF vector index types, and the choice determines both the CREATE INDEX DDL and which index parameters are validated later. The value is uppercased before comparison, so 'hnsw' passes; any other string (including 'IVF_FLAT', 'FLAT', or 'HNSWPQ') is rejected with the raw config value echoed.
Source
Thrown at mem0-ts/src/oss/src/vector_stores/oracledb.ts:357
this.embeddingModelDims = config.embeddingModelDims ?? 1536;
if (
!Number.isInteger(this.embeddingModelDims) ||
this.embeddingModelDims <= 0
) {
throw new Error("`embeddingModelDims` must be a positive integer");
}
const distanceMetric = (config.distanceMetric ??
"COSINE") as string as DistanceMetric;
this.distanceMetric = distanceMetric.toUpperCase() as DistanceMetric;
if (!DISTANCE_METRICS.includes(this.distanceMetric)) {
throw new Error(`Unsupported distance metric: ${config.distanceMetric}`);
}
const indexType = (config.indexType ?? "HNSW") as string;
this.indexType = indexType.toUpperCase() as IndexType;
if (this.indexType !== "HNSW" && this.indexType !== "IVF") {
throw new Error(`Unsupported index type: ${config.indexType}`);
}
this.indexAccuracy = config.indexAccuracy;
if (
this.indexAccuracy !== undefined &&
(!Number.isInteger(this.indexAccuracy) ||
this.indexAccuracy <= 0 ||
this.indexAccuracy > 100)
) {
throw new Error("`indexAccuracy` must be an integer between 1 and 100");
}
this.indexParameters = this.validateIndexParameters(config.indexParameters);
this.doCreateIndex = config.doCreateIndex ?? true;
this.config = config;
}
private validateIndexParameters(View on GitHub (pinned to 001c235229)
Solutions
- Set indexType to 'HNSW' (default, best for recall/low latency) or 'IVF' (lower build cost, larger scale) — case-insensitive.
- Remove pgvector/FAISS-specific names like 'ivfflat' or 'flat' from the config.
- Omit indexType entirely to keep the HNSW default.
- Tune within the chosen type via indexParameters (neighbors/efconstruction for HNSW; neighbor partitions etc. for IVF) instead of inventing index types.
Example fix
// before
new OracleDB({ connectionParams, indexType: 'ivfflat' });
// after
new OracleDB({ connectionParams, indexType: 'IVF' }); Defensive patterns
Strategy: validation
Validate before calling
function normalizeIndexType(t?: string): 'HNSW' | 'IVF' {
const upper = (t ?? 'HNSW').toUpperCase();
if (upper !== 'HNSW' && upper !== 'IVF') throw new RangeError(`indexType must be HNSW or IVF, got '${t}'`);
return upper;
} Type guard
const isOracleIndexType = (v: unknown): v is 'HNSW' | 'IVF' | 'hnsw' | 'ivf' => v === 'HNSW' || v === 'IVF' || v === 'hnsw' || v === 'ivf';
Prevention
- Scrub pgvector/FAISS index names (ivfflat, flat) out of configs before switching to Oracle.
- Pick per-type indexParameters together with indexType in one constant.
When it happens
Trigger: indexType: 'ivfflat' (a pgvector name) fails; 'flat' fails because mem0 always creates a vector index; typos like 'HNSW ' with trailing space pass uppercase+trim? — no trim happens, so trailing whitespace fails; undefined defaults to 'HNSW'.
Common situations: Porting pgvector configs (ivfflat/halfvec), FAISS terminology (Flat, IVF), or Qdrant HNSW config into OracleDB; experimenting with quantization names that Oracle does not expose via this adapter.
Related errors
- `indexAccuracy` must be an integer between 1 and 100
- Must provide at least one of `connectionParams` and `client`
- `embeddingModelDims` must be a positive integer
- Unsupported distance metric: ${config.distanceMetric}
- Unsupported ${this.indexType} index parameter '${key}'. Allo
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/eeb5ec5a2b5b2cd5.
Report an issue: GitHub.