deepset-ai/haystack · error · TypeError

Document store {type(self.document_store).__name__} does not

Error message

Document store {type(self.document_store).__name__} does not provide async support.

What it means

CacheChecker.run_async raises TypeError when the configured document store lacks a filter_documents_async method. Some stores only implement the synchronous API, so async pipeline execution cannot check the cache.

Source

Thrown at haystack/components/caching/cache_checker.py:114

        return {"hits": found_documents, "misses": misses}

    @component.output_types(hits=list[Document], misses=list)
    async def run_async(self, items: list[Any]) -> dict[str, Any]:
        """
        Asynchronously checks if any document associated with the specified cache field is already present in the store.

        :param items:
            Values to be checked against the cache field.
        :return:
            A dictionary with two keys:
            - `hits` - Documents that matched with at least one of the items.
            - `misses` - Items that were not present in any documents.
        """
        found_documents = []
        misses = []

        if not hasattr(self.document_store, "filter_documents_async"):
            raise TypeError(f"Document store {type(self.document_store).__name__} does not provide async support.")

        for item in items:
            filters = {"field": self.cache_field, "operator": "==", "value": item}
            found = await self.document_store.filter_documents_async(filters=filters)
            if found:
                found_documents.extend(found)
            else:
                misses.append(item)
        return {"hits": found_documents, "misses": misses}

    def close(self) -> None:
        """
        Release the synchronous resources of the underlying Document Store.
        """
        if hasattr(self.document_store, "close"):
            self.document_store.close()

    async def close_async(self) -> None:

View on GitHub (pinned to e318778c9b)

Solutions

  1. Use a document store with async support (e.g. one implementing filter_documents_async, like qdrant/pgvector stores).
  2. Keep this component in the synchronous pipeline path and call run() instead of run_async().
  3. Upgrade the store integration package to a version that adds async methods.

Example fix

// before
checker = CacheChecker(document_store=InMemoryDocumentStore(), cache_field='text')
await pipeline.run_async(...)  # raises
// after
checker = CacheChecker(document_store=QdrantDocumentStore(url=...), cache_field='text')
await pipeline.run_async(...)
Defensive patterns

Strategy: validation

Validate before calling

if not hasattr(store, 'filter_documents_async'):
    raise TypeError(f'{type(store).__name__} lacks async support; use a sync pipeline')

Type guard

def supports_async(store) -> bool:
    return hasattr(store, 'filter_documents_async')

Try / catch

try:
    res = await checker.run_async(items=items)
except TypeError as e:
    if 'does not provide async support' in str(e):
        res = checker.run(items=items)
    else:
        raise

Prevention

When it happens

Trigger: Running an async pipeline containing CacheChecker with a store such as InMemoryDocumentStore (no async support), i.e. via Pipeline.run_async or an async server.

Common situations: Migrating a sync pipeline to async (FastAPI server) without swapping the document store; using a custom or older store version that predates async methods.

Related errors


AI-assisted analysis of deepset-ai/haystack@e318778c9b (2026-08-30). Data as JSON: /api/errors/d2cf05b14bd2af6f. Report an issue: GitHub.