diff --git a/src/brainy.ts b/src/brainy.ts index e04df2c4..f7a102b7 100644 --- a/src/brainy.ts +++ b/src/brainy.ts @@ -9469,6 +9469,11 @@ export class Brainy implements BrainyInterface { const idMapper = this.metadataIndex.getIdMapper?.() if (!idMapper) return + // Feature-detect: vector-index providers without per-node connection + // lists (e.g. single-file graph formats) don't expose this hook. Skip + // silently — the codec only applies to the JS HNSW connection layout. + if (typeof this.index.setConnectionsCodec !== 'function') return + const codec = new ConnectionsCodec(provider, idMapper) this.index.setConnectionsCodec(codec) if (!this.config.silent) {