{"record":{"id":"63255176f5dc5dd7","repo":"janhq/jan","slug":"vector-db-extension-does-not-support-project-level","errorCode":null,"errorMessage":"Vector DB extension does not support project-level ingestion","messagePattern":"Vector DB extension does not support project-level ingestion","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/rag-extension/src/index.ts","lineNumber":387,"sourceCode":"  ): Promise<{\n    filesProcessed: number\n    chunksInserted: number\n    files: AttachmentFileInfo[]\n  }> {\n    if (!projectId || !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?.ingestFileForProject) {\n      throw new Error('Vector DB extension does not support project-level ingestion')\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":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/extensions/rag-extension/src/index.ts#L369-L405","documentation":"Thrown by RAGExtension.ingestAttachmentsForProject() when the resolved VectorDB extension is absent OR lacks an ingestFileForProject method. Project-level ingestion was added later than thread-level, so an older/incompatible vector-db-extension exposes createCollection/insertChunks but not ingestFileForProject. The guard prevents calling an undefined method.","triggerScenarios":"Calling ingestAttachmentsForProject(projectId, files) when vector-db-extension is disabled, failed to load, or is a version predating the project-level API; running RAG against a stub/mock VectorDB extension in tests.","commonSituations":"Mixing extension versions after a partial upgrade; vector-db-extension disabled in settings but rag-extension still enabled; the extension crashed during startup and was not re-registered.","solutions":["Update vector-db-extension to a version that implements ingestFileForProject.","Ensure vector-db-extension is enabled and loaded (check window.core.extensionManager.get(ExtensionTypeEnum.VectorDB)).","Guard the call site: fall back to thread-level ingestAttachments if project-level is unavailable.","Restart the app to re-register extensions after enabling vector-db-extension."],"exampleFix":"// before\nawait rag.ingestAttachmentsForProject(projectId, files)\n\n// after\nconst vec = window.core?.extensionManager.get(ExtensionTypeEnum.VectorDB)\nif (!vec?.ingestFileForProject) {\n  // fall back to thread-scoped ingestion or prompt the user to enable/update the extension\n  return\n}\nawait rag.ingestAttachmentsForProject(projectId, files)","handlingStrategy":"type-guard","validationCode":"const vec = window.core?.extensionManager.get(ExtensionTypeEnum.VectorDB) as any\nconst supportsProject = typeof vec?.ingestFileForProject === 'function'\nif (!supportsProject) {\n  // fall back to thread-level ingestion, or prompt to update the extension\n}","typeGuard":"function supportsProjectIngest(vec: unknown): vec is { ingestFileForProject: Function } {\n  return !!vec && typeof (vec as any).ingestFileForProject === 'function'\n}","tryCatchPattern":null,"preventionTips":["Keep rag-extension and vector-db-extension versions in lockstep.","Check extension capabilities before calling project-level APIs.","Disable project-level RAG UI when the capability is absent."],"tags":["rag","vector-db","extension","project","version-mismatch"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}