mmr_lambda=self.mmr_lambda,
        )
        results: List[MemorySearchResult] = self.zep_client.memory.search_memory(
            self.session_id, payload, limit=self.top_k
        )
        if self.search_scope == SearchScope.summary:
            return self._summary_search_result_to_doc(results)
        return self._messages_search_result_to_doc(results)
    async def _aget_relevant_documents(
        self,
        query: str,
        *,
        run_manager: AsyncCallbackManagerForRetrieverRun,
        metadata: Optional[Dict[str, Any]] = None,
    ) -> List[Document]:
        from zep_python.memory import MemorySearchPayload
        if not self.zep_client:
            raise RuntimeError("Zep client not initialized.")
        payload = MemorySearchPayload(
            text=query,
            metadata=metadata,
            search_scope=self.search_scope,
            search_type=self.search_type,
            mmr_lambda=self.mmr_lambda,
        )
        results: List[MemorySearchResult] = await self.zep_client.memory.asearch_memory(
            self.session_id, payload, limit=self.top_k
        )
        if self.search_scope == SearchScope.summary:
            return self._summary_search_result_to_doc(results)
        return self._messages_search_result_to_doc(results)