Skip to content

Commit ab93197

Browse files
Merge pull request #4 from qdrant/fix/non-existing-collection
Check if the collection exists before loading the memories
2 parents ae33cc5 + 7703b22 commit ab93197

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mcp_server_qdrant/qdrant.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ async def store_memory(self, information: str):
4040

4141
async def find_memories(self, query: str) -> list[str]:
4242
"""
43-
Find memories in the Qdrant collection.
43+
Find memories in the Qdrant collection. If there are no memories found, an empty list is returned.
4444
:param query: The query to use for the search.
4545
:return: A list of memories found.
4646
"""
47+
collection_exists = await self._client.collection_exists(self._collection_name)
48+
if not collection_exists:
49+
return []
50+
4751
search_results = await self._client.query(
4852
self._collection_name,
4953
query_text=query,

0 commit comments

Comments
 (0)