janhq/jan · error

RAG extension does not support project-level ingestion

Error message

RAG extension does not support project-level ingestion

What it means

Thrown when the RAG extension registered with the ExtensionManager exists but does not implement ingestAttachmentsForProject, so project-level ingestion is unsupported in this build/configuration. The service requires ext?.ingestAttachmentsForProject to be truthy.

Solutions

  1. Upgrade or replace the RAG extension with a version that implements ingestAttachmentsForProject
  2. Fall back to thread-level ingestFileAttachment when project ingestion is unsupported
  3. Feature-gate the project-upload UI on capability detection: !!ext?.ingestAttachmentsForProject

Example fix

// before
await uploads.ingestFileAttachmentForProject(projectId, att)
// after
const ext = ExtensionManager.getInstance().get<RAGExtension>(ExtensionTypeEnum.RAG)
const result = ext?.ingestAttachmentsForProject
  ? await uploads.ingestFileAttachmentForProject(projectId, att)
  : await uploads.ingestFileAttachment(threadId, att)
Defensive patterns

Strategy: fallback

Validate before calling

const supportsProjectIngest = (): boolean =>
  !!ExtensionManager.getInstance().get<RAGExtension>(ExtensionTypeEnum.RAG)?.ingestAttachmentsForProject

Type guard

const supportsProjectIngestion = (ext: RAGExtension | undefined): ext is RAGExtension & { ingestAttachmentsForProject: NonNullable<RAGExtension['ingestAttachmentsForProject']> } =>
  typeof ext?.ingestAttachmentsForProject === 'function'

Try / catch

try {
  return await uploads.ingestFileAttachmentForProject(projectId, att)
} catch (e) {
  if (e instanceof Error && e.message.includes('project-level ingestion')) {
    return uploads.ingestFileAttachment(threadId, att) // graceful fallback
  }
  throw e
}

Prevention

When it happens

Trigger: Calling ingestFileAttachmentForProject when the registered RAG extension only implements thread-level ingestAttachments (no project variant), or no RAG extension is registered at all.

Common situations: Running an older RAG extension that predates project-level ingestion; project upload feature shipped before the extension supporting it was deployed; extension build/version mismatch between web-app and the installed extension.

Related errors


AI-assisted analysis of janhq/jan@7205d770c1 (2026-09-17). Data as JSON: /api/errors/0d30806c69d101d7. Report an issue: GitHub.

Appendix: source

Thrown at web-app/src/services/uploads/default.ts:36

    if (!ext?.ingestAttachments) throw new Error('RAG extension not available')
    const res: IngestAttachmentsResult = await ext.ingestAttachments(threadId, [
      { path: attachment.path!, name: attachment.name, type: attachment.fileType, size: attachment.size },
    ])
    const files = res.files
    if (Array.isArray(files) && files[0]?.id) {
      return {
        id: files[0].id,
        size: typeof files[0].size === 'number' ? Number(files[0].size) : undefined,
        chunkCount: typeof files[0].chunk_count === 'number' ? Number(files[0].chunk_count) : undefined,
      }
    }
    throw new Error('Failed to resolve ingested attachment id')
  }

  async ingestFileAttachmentForProject(projectId: string, attachment: Attachment): Promise<UploadResult> {
    if (attachment.type !== 'document') throw new Error('ingestFileAttachmentForProject: attachment is not document')
    const ext = ExtensionManager.getInstance().get<RAGExtension>(ExtensionTypeEnum.RAG)
    if (!ext?.ingestAttachmentsForProject) throw new Error('RAG extension does not support project-level ingestion')
    const res: IngestAttachmentsResult = await ext.ingestAttachmentsForProject(projectId, [
      { path: attachment.path!, name: attachment.name, type: attachment.fileType, size: attachment.size },
    ])
    const files = res.files
    if (Array.isArray(files) && files[0]?.id) {
      return {
        id: files[0].id,
        size: typeof files[0].size === 'number' ? Number(files[0].size) : undefined,
        chunkCount: typeof files[0].chunk_count === 'number' ? Number(files[0].chunk_count) : undefined,
      }
    }
    throw new Error('Failed to resolve ingested attachment id')
  }
}

View on GitHub (pinned to 7205d770c1)