diff --git a/src/crewai/knowledge/knowledge.py b/src/crewai/knowledge/knowledge.py index 571542994a..c964333c82 100644 --- a/src/crewai/knowledge/knowledge.py +++ b/src/crewai/knowledge/knowledge.py @@ -49,8 +49,13 @@ def query(self, query: List[str], limit: int = 3) -> List[Dict[str, Any]]: """ Query across all knowledge sources to find the most relevant information. Returns the top_k most relevant chunks. + + Raises: + ValueError: If storage is not initialized. """ - + if self.storage is None: + raise ValueError("Storage is not initialized.") + results = self.storage.search( query, limit,