janhq/jan · error · Error

RAG extension does not support project-level ingestion

Error message

RAG extension does not support project-level ingestion

What it means

Thrown by ingestFileAttachmentForProject when the RAG extension is registered but does not implement ingestAttachmentsForProject - an older or stripped-down RAG extension that only supports thread-level ingestion. Project-level ingestion is a newer, separate capability.

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 fad3f12a14)

Solutions

  1. Update to / enable a RAG extension version that implements ingestAttachmentsForProject.
  2. Fall back to thread-level ingestion (ingestFileAttachment) if project-level isn't required.
  3. Disable the project document-upload UI when the capability is absent.

Example fix

// before: throw on missing project method
const ext = ExtensionManager.getInstance().get<RAGExtension>(ExtensionTypeEnum.RAG)
if (!ext?.ingestAttachmentsForProject) throw new Error('RAG extension does not support project-level ingestion')
// after: feature-detect and gate the UI
const ext = ExtensionManager.getInstance().get<RAGExtension>(ExtensionTypeEnum.RAG)
if (!ext?.ingestAttachmentsForProject) { setProjectUploadEnabled(false); return }
Defensive patterns

Strategy: validation

Validate before calling

function supportsProjectIngest(): boolean {
  return !!ExtensionManager.getInstance().get<RAGExtension>(ExtensionTypeEnum.RAG)?.ingestAttachmentsForProject
}

Type guard

function hasProjectIngest(e: unknown): e is RAGExtension {
  return !!e && typeof (e as RAGExtension).ingestAttachmentsForProject === 'function'
}

Prevention

When it happens

Trigger: ExtensionManager.get<RAGExtension>(ExtensionTypeEnum.RAG) returns an object, but that object has no ingestAttachmentsForProject function - so !ext?.ingestAttachmentsForProject is true.

Common situations: Deployed RAG extension predates the project-level ingestion API; feature-gated build that omitted the method; extension partially loaded.

Related errors


AI-assisted analysis of janhq/jan@fad3f12a14 (2026-08-12). Data as JSON: /api/errors/0d30806c69d101d7. Report an issue: GitHub.