{"record":{"id":"9f947a6436d2a2d8","repo":"janhq/jan","slug":"vector-db-extension-not-available","errorCode":null,"errorMessage":"Vector DB extension not available","messagePattern":"Vector DB extension not available","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/rag-extension/src/index.ts","lineNumber":445,"sourceCode":"  ): Promise<{\n    filesProcessed: number\n    chunksInserted: number\n    files: AttachmentFileInfo[]\n  }> {\n    if (!threadId || !Array.isArray(files) || files.length === 0) {\n      return { filesProcessed: 0, chunksInserted: 0, files: [] }\n    }\n\n    // Respect feature flag: do nothing when disabled\n    if (this.config.enabled === false) {\n      return { filesProcessed: 0, chunksInserted: 0, files: [] }\n    }\n\n    const vec = window.core?.extensionManager.get(\n      ExtensionTypeEnum.VectorDB\n    ) as unknown as VectorDBExtension\n    if (!vec?.createCollection || !vec?.insertChunks) {\n      throw new Error('Vector DB extension not available')\n    }\n\n    // Load settings\n    const s = this.config\n    const maxSize = (s?.enabled === false ? 0 : s?.maxFileSizeMB) || undefined\n    const chunkSize = s?.chunkSizeChars as number | undefined\n    const chunkOverlap = s?.overlapChars as number | undefined\n\n    let totalChunks = 0\n    const processedFiles: AttachmentFileInfo[] = []\n\n    for (const f of files) {\n      if (!f?.path) continue\n      if (maxSize && f.size && f.size > maxSize * 1024 * 1024) {\n        throw new Error(\n          `File '${f.name}' exceeds size limit (${f.size} bytes > ${maxSize} MB).`\n        )\n      }","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/janhq/jan/blob/7205d770c1e097c3daf35a911176410e93bc5564/extensions/rag-extension/src/index.ts#L427-L463","documentation":"ingestAttachments requires the VectorDB extension (with createCollection and insertChunks APIs) to be registered under window.core.extensionManager. If it is missing or lacks those methods, the extension cannot perform vector ingestion and throws immediately.","triggerScenarios":"Calling ingestAttachments when no VectorDB extension is installed, it failed to initialize, or the registered object lacks createCollection/insertChunks methods.","commonSituations":"Vector DB extension not installed/enabled in the app; extension failed to load at startup; wrong extension version exposing a different API surface; window.core not yet initialized when the call runs.","solutions":["Install/enable the Vector DB extension and verify it appears in window.core.extensionManager.get(ExtensionTypeEnum.VectorDB)","Ensure window.core is initialized before calling ingestAttachments","Check the Vector DB extension version exposes createCollection and insertChunks","Wrap the call in try/catch and guide the user to install the extension"],"exampleFix":"// before\nawait rag.ingestAttachments(files)\n// after\nconst vec = window.core?.extensionManager?.get(ExtensionTypeEnum.VectorDB)\nif (!vec) throw new Error('Install the Vector DB extension first')\nawait rag.ingestAttachments(files)","handlingStrategy":"type-guard","validationCode":"const vec = window.core?.extensionManager?.get(ExtensionTypeEnum.VectorDB) as VectorDBExtension | undefined\nif (!vec || typeof vec.createCollection !== 'function' || typeof vec.insertChunks !== 'function') {\n  throw new Error('Vector DB extension is required for attachment ingestion')\n}","typeGuard":"const hasVectorDb = (v: any): v is VectorDBExtension =>\n  Boolean(v) && typeof v.createCollection === 'function' && typeof v.insertChunks === 'function'","tryCatchPattern":"try {\n  await rag.ingestAttachments(files)\n} catch (e) {\n  if (e.message === 'Vector DB extension not available') {\n    // prompt user to install/enable the Vector DB extension\n  }\n}","preventionTips":["Check extension availability at app startup and degrade features gracefully","Pin/verify Vector DB extension versions in your app manifest","Ensure window.core is initialized before any extension-dependent calls"],"tags":["dependency","extension","vector-db"],"backgroundTag":"missing-dependency","analyzedSha":"7205d770c1e097c3daf35a911176410e93bc5564","analyzedAt":"2026-09-17T14:27:30.100Z","contentChangedAt":"2026-09-17T14:27:30.100Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}