{"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/7205d770c1e097c3daf35a911176410e93bc5564/extensions/rag-extension/src/index.ts#L369-L405","documentation":"ingestAttachmentsForProject() looks up the registered VectorDB extension and requires it to expose ingestFileForProject. The built-in vector-db extension does not implement project-level ingestion, so this guard throws to signal the operation is unsupported by the current VectorDB provider.","triggerScenarios":"Calling RAG extension's ingestAttachmentsForProject() when no VectorDB extension is registered, the cast to VectorDBExtension failed, or the installed VectorDB implementation lacks ingestFileForProject.","commonSituations":"Project-level RAG ingestion attempted with the default vector-db extension that only supports per-file ingestion; vector-db extension not installed/enabled; version mismatch where the extension predates the ingestFileForProject API.","solutions":["Ingest files individually via vec.ingestFile per attachment instead of project-level ingestion","Install/upgrade a VectorDB extension that implements ingestFileForProject","Check capability first (typeof vec?.ingestFileForProject === 'function') and fall back to per-file ingestion","Ensure the VectorDB extension is registered in window.core.extensionManager before ingest"],"exampleFix":"// before\nawait rag.ingestAttachmentsForProject(projectId, files) // throws with default vector DB\n// after\nif (typeof vec?.ingestFileForProject === 'function') {\n  await rag.ingestAttachmentsForProject(projectId, files)\n} else {\n  for (const f of files) await vec.ingestFile(f)\n}","handlingStrategy":"type-guard","validationCode":"const vec = window.core?.extensionManager?.get(ExtensionTypeEnum.VectorDB) as VectorDBExtension | undefined\nif (typeof vec?.ingestFileForProject !== 'function') {\n  throw new Error('Project-level ingestion unavailable; fall back to per-file ingestFile')\n}","typeGuard":"const supportsProjectIngestion = (v: unknown): v is VectorDBExtension & { ingestFileForProject: Function } =>\n  !!v && typeof (v as any).ingestFileForProject === 'function'","tryCatchPattern":"try {\n  await rag.ingestAttachmentsForProject(projectId, files)\n} catch (e) {\n  if (String(e).includes('does not support project-level ingestion')) {\n    for (const f of files) await vec.ingestFile(f)\n  } else throw e\n}","preventionTips":["Feature-detect ingestFileForProject before calling project-level ingestion","Keep the VectorDB extension upgraded to a version that supports project ingestion","Design callers with a per-file ingestion fallback path","Verify the VectorDB extension is registered and enabled at startup"],"tags":["unsupported","rag","vectordb"],"backgroundTag":"method-not-implemented","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"}