stanford-oval/storm · error · ValueError

Collection {self.collection_name} does not exist. Please cre

Error message

Collection {self.collection_name} does not exist. Please create the collection first.

What it means

When the Qdrant collection exists, VectorRM loads it as a langchain Qdrant retriever; when it does not exist, instead of creating it (despite the docstring), the else branch raises ValueError telling the user to create the collection first. So the vector store must be populated out-of-band before VectorRM can attach to it.

Source

Thrown at knowledge_storm/rm.py:246

    def _check_collection(self):
        from langchain_qdrant import Qdrant

        """
        Check if the Qdrant collection exists and create it if it does not.
        """
        if self.client is None:
            raise ValueError("Qdrant client is not initialized.")
        if self.client.collection_exists(collection_name=f"{self.collection_name}"):
            print(
                f"Collection {self.collection_name} exists. Loading the collection..."
            )
            self.qdrant = Qdrant(
                client=self.client,
                collection_name=self.collection_name,
                embeddings=self.model,
            )
        else:
            raise ValueError(
                f"Collection {self.collection_name} does not exist. Please create the collection first."
            )

    def init_online_vector_db(self, url: str, api_key: str):
        from qdrant_client import QdrantClient

        """
        Initialize the Qdrant client that is connected to an online vector store with the given URL and API key.

        Args:
            url (str): URL of the Qdrant server.
            api_key (str): API key for the Qdrant server.
        """
        if api_key is None:
            if not os.getenv("QDRANT_API_KEY"):
                raise ValueError("Please provide an api key.")
            api_key = os.getenv("QDRANT_API_KEY")
        if url is None:

View on GitHub (pinned to fb951af774)

Solutions

  1. Verify the exact collection name on the server (qdrant_client.get_collections()) and fix collection_name
  2. Create and populate the collection beforehand with qdrant_client.create_collection(...) plus an ingestion script using the same embedding model and vector dimension
  3. For offline mode, confirm vector_store_path points at the folder that actually contains the pre-built store

Example fix

// before
rm = VectorRM(collection_name='my_col', source='offline', vector_store_path='./qdrant', embedding_model='...')
rm.init_offline_vector_db('./empty_dir')  # collection missing
// after
from qdrant_client import QdrantClient
client = QdrantClient(path='./qdrant')
client.get_collections()  # verify name, create/populate 'my_col' first
rm.init_offline_vector_db('./qdrant')
Defensive patterns

Strategy: validation

Validate before calling

from qdrant_client import QdrantClient
client = QdrantClient(path='./qdrant')  # or url=..., api_key=...
names = [c.name for c in client.get_collections().collections]
assert 'docs' in names, f'collection docs not found; have {names}'
rm = VectorRM(collection_name='docs', source='offline', vector_store_path='./qdrant', embedding_model=MODEL)
rm.init_offline_vector_db('./qdrant')

Type guard

def collection_exists(client, name: str) -> bool:
    return any(c.name == name for c in client.get_collections().collections)

Try / catch

try:
    rm.init_offline_vector_db('./qdrant')
except ValueError as e:
    if 'does not exist' in str(e):
        client.create_collection(collection_name='docs', vectors_config=Dim(384))  # then ingest
        raise SystemExit('Collection created empty — run ingestion before retrieval')
    raise

Prevention

When it happens

Trigger: Calling VectorRM(...) with a collection_name that has never been created on the Qdrant server or in the offline path folder, then running init_online_vector_db/init_offline_vector_db which calls _check_collection and finds collection_exists(...) == False.

Common situations: Typos in collection_name; pointing at a fresh/empty Qdrant server; pointing vector_store_path at an empty or wrong directory for offline mode; expecting VectorRM to auto-create the collection because of its docstring.

Related errors


AI-assisted analysis of stanford-oval/storm@fb951af774 (2026-08-28). Data as JSON: /api/errors/3b9fca287e00825d. Report an issue: GitHub.