-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Required prerequisites
- I have read the documentation https://camel-ai.github.io/camel/camel.html.
- I have searched the Issue Tracker and Discussions that this hasn't already been reported. (+1 or comment there if it has.)
- Consider asking first in a Discussion.
What version of camel are you using?
0.2.70
System information
Python: 3.12.10 on darwin (macOS)
CAMEL: 0.2.70
Problem description
When using AutoRetriever with local Qdrant storage (StorageType.QDRANT), if the local storage becomes corrupted or was created with an incompatible version, the retriever throws a pydantic ValidationError and fails completely. This happens because _initialize_vector_storage() attempts to load the existing collection before the vector_count == 0 check and clear() call in run_vector_retriever(). The only workaround is to manually delete the local storage directory.
Reproducible example code
Reproducible Example
import os
import json
from pathlib import Path
from camel.retrievers import AutoRetriever
from camel.types import StorageType
from camel.embeddings import OpenAIEmbedding
# Step 1: Create a corrupted Qdrant storage directory
storage_path = "test_corrupted_storage"
collection_path = Path(storage_path) / "collection" / "test_collection"
collection_path.mkdir(parents=True, exist_ok=True)
# Write invalid config that will fail pydantic validation
invalid_config = {"vectors": {"size": 1536, "distance": "Cosine"}, "metadata": None}
with open(collection_path / "config.json", "w") as f:
json.dump(invalid_config, f)
# Step 2: Try to use AutoRetriever - this will fail
retriever = AutoRetriever(
vector_storage_local_path=storage_path,
storage_type=StorageType.QDRANT,
embedding_model=OpenAIEmbedding(),
)
# This raises ValidationError instead of recovering gracefully
retriever.run_vector_retriever(
query="test query",
contents=["Some test content to index"],
)
### Traceback
```pytbExpected behavior
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working