Bug description
On Windows, the auto-generated collection names in QdrantStorage and FaissStorage contain : (and .) characters from datetime.now().isoformat(). Because both storages use the generated name as a local filesystem path component, simply instantiating them with default arguments crashes on Windows:
QdrantStorage(vector_dim=4, path=<dir>) → OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<dir>\collection\2026-09-14T03:25:34.181072'
FaissStorage(vector_dim=4, storage_path=<dir>) → RuntimeError: Error in __cdecl faiss::FileIOWriter::FileIOWriter(const char *) ... could not open C:\Users as soon as the index is persisted.
Root cause
QdrantStorage._generate_collection_name() returns datetime.now().isoformat() verbatim (camel/storages/vectordb_storages/qdrant.py:241), and FaissStorage._generate_collection_name() returns f"faiss_index_{datetime.now().isoformat()}" (camel/storages/vectordb_storages/faiss.py:123).
- Qdrant's local mode creates a directory
<path>/collection/<collection_name>, and : is illegal in Windows path components.
FaissStorage._get_index_path() joins storage_path with <collection_name>.index, hitting the same restriction.
Other storages in the same package already avoid this: chroma.py sanitizes with .replace(':', '-').replace('.', '-'), and milvus.py / tidb.py / weaviate.py strip non-alphanumeric characters with a regex. Only qdrant and faiss still emit raw ISO timestamps.
Reproduction (Windows)
import tempfile
from camel.storages.vectordb_storages import QdrantStorage, FaissStorage
# Qdrant local mode: crashes at instantiation
QdrantStorage(vector_dim=4, path=tempfile.mkdtemp())
# OSError: [WinError 123] ... 'C:\...\collection\2026-09-14T03:25:34.181072'
# FAISS with a storage path: crashes when the index is written
fs = FaissStorage(vector_dim=4, storage_path=tempfile.mkdtemp())
fs.add([VectorRecord(vector=[0.1, 0.2, 0.3, 0.4])])
# RuntimeError: ... could not open C:\Users\...
The bug is also visible in the existing test suite: on Windows, test/storages/vector_storages/test_all_vectordbs.py::test_vector_storage[qdrant:local] and test_get_payload_by_vector[qdrant:local] error at fixture setup with WinError 123, and test/memories/test_vector_db_memory.py errors the same way. (CI is ubuntu-only, so this is currently not covered.)
A related test-side issue: once setup succeeds, the qdrant:local fixture still fails at teardown on Windows, because shutil.rmtree(tmpdir) runs while the local Qdrant client still holds open file handles. The fixture never calls storage.close_client().
Proposed fix
- Sanitize the generated names in
qdrant.py and faiss.py with .replace(':', '-').replace('.', '-'), following the existing chroma.py precedent.
- Call
storage.close_client() in the qdrant:local test fixture before shutil.rmtree.
- Add a regression test asserting that auto-generated collection names contain no Windows-illegal path characters (
<>:"/\|?*).
I'm happy to open a PR with this fix.
Environment
- camel-ai: 0.2.91a7 (master @ 8c791b7)
- Python: 3.10.20
- OS: Windows 11 (10.0.26200)
Bug description
On Windows, the auto-generated collection names in
QdrantStorageandFaissStoragecontain:(and.) characters fromdatetime.now().isoformat(). Because both storages use the generated name as a local filesystem path component, simply instantiating them with default arguments crashes on Windows:QdrantStorage(vector_dim=4, path=<dir>)→OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<dir>\collection\2026-09-14T03:25:34.181072'FaissStorage(vector_dim=4, storage_path=<dir>)→RuntimeError: Error in __cdecl faiss::FileIOWriter::FileIOWriter(const char *) ... could not open C:\Usersas soon as the index is persisted.Root cause
QdrantStorage._generate_collection_name()returnsdatetime.now().isoformat()verbatim (camel/storages/vectordb_storages/qdrant.py:241), andFaissStorage._generate_collection_name()returnsf"faiss_index_{datetime.now().isoformat()}"(camel/storages/vectordb_storages/faiss.py:123).<path>/collection/<collection_name>, and:is illegal in Windows path components.FaissStorage._get_index_path()joinsstorage_pathwith<collection_name>.index, hitting the same restriction.Other storages in the same package already avoid this:
chroma.pysanitizes with.replace(':', '-').replace('.', '-'), andmilvus.py/tidb.py/weaviate.pystrip non-alphanumeric characters with a regex. Only qdrant and faiss still emit raw ISO timestamps.Reproduction (Windows)
The bug is also visible in the existing test suite: on Windows,
test/storages/vector_storages/test_all_vectordbs.py::test_vector_storage[qdrant:local]andtest_get_payload_by_vector[qdrant:local]error at fixture setup withWinError 123, andtest/memories/test_vector_db_memory.pyerrors the same way. (CI is ubuntu-only, so this is currently not covered.)A related test-side issue: once setup succeeds, the
qdrant:localfixture still fails at teardown on Windows, becauseshutil.rmtree(tmpdir)runs while the local Qdrant client still holds open file handles. The fixture never callsstorage.close_client().Proposed fix
qdrant.pyandfaiss.pywith.replace(':', '-').replace('.', '-'), following the existingchroma.pyprecedent.storage.close_client()in theqdrant:localtest fixture beforeshutil.rmtree.<>:"/\|?*).I'm happy to open a PR with this fix.
Environment