iflytek/astron-agent · error · NotImplementedError

SparkDesk-RAG does not support chunks_save operation.

Error message

SparkDesk-RAG does not support chunks_save operation.

What it means

SparkDeskRagStrategy.chunks_save() is an intentional stub. The SparkDesk-RAG service has no API for saving pre-split chunks, so the adapter raises NotImplementedError. It only exists to fulfill the RagStrategy abstract interface.

Solutions

  1. Use the strategy's document-upload flow instead of saving chunks manually
  2. Guard the call by backend type and skip chunk persistence for SparkDesk
  3. Implement chunks_save against a SparkDesk endpoint if one becomes available

Example fix

// before
await strategy.chunks_save(docId, group, uid, chunks)
// after
if strategy.supports_chunks_save:
    await strategy.chunks_save(docId, group, uid, chunks)
Defensive patterns

Strategy: validation

Validate before calling

def supports_chunks_save(strategy) -> bool:
    return not isinstance(strategy, SparkDeskRagStrategy)

Type guard

def is_sparkdesk(strategy) -> bool:
    return isinstance(strategy, SparkDeskRagStrategy)

Try / catch

try:
    await strategy.chunks_save(docId, group, uid, chunks)
except NotImplementedError:
    logger.warning("chunks_save unsupported by backend; skipping")

Prevention

When it happens

Trigger: Calling chunks_save(docId, group, uid, chunks) on a SparkDesk-RAG strategy instance, e.g. attempting to persist manually split chunks to the SparkDesk knowledge base.

Common situations: Pipelines that split documents client-side then upload chunks, reused unchanged after switching the RAG backend to SparkDesk via configuration.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/db5603a4218cbb17. Report an issue: GitHub.

Appendix: source

Thrown at core/knowledge/service/impl/sparkdesk_strategy.py:92

        self, docId: str, group: str, uid: str, chunks: List[Any], **kwargs: Any
    ) -> Any:
        """
        Save chunks to knowledge base

        Args:
            doc_id: Document ID
            group: Group name
            uid: User ID
            chunks: Chunk list
            **kwargs: Other parameters

        Returns:
            Save result

        Raises:
            NotImplementedError: SparkDesk-RAG does not support save operation
        """
        raise NotImplementedError(
            "SparkDesk-RAG does not support chunks_save operation."
        )

    async def chunks_update(
        self,
        docId: str,
        group: str,
        uid: str,
        chunks: List[Dict[str, Any]],
        **kwargs: Any
    ) -> Any:
        """
        Update chunks

        Args:
            doc_id: Document ID
            group: Group name
            uid: User ID

View on GitHub (pinned to 5e758547a8)