> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Safe Mem0 Search • AI Agent SDK

> safe_mem0_search: Defensive wrapper for mem0.search() to handle MongoDB vector store compatibility.

# safe\_mem0\_search

Function

> This function is defined in the [**factories**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/factories.md) module.

Defensive wrapper for mem0.search() to handle MongoDB vector store compatibility.

Catches the specific TypeError about an unexpected 'vectors' kwarg and falls back
gracefully by returning an empty result set. This addresses the upstream mem0 bug:
[https://github.com/mem0ai/mem0/issues/3185](https://github.com/mem0ai/mem0/issues/3185)

Any other TypeError is re-raised unchanged.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def safe_mem0_search(mem0_client: Any) -> List[Dict[str, Any]]
```

## Parameters

**mem0\_client** `Any` *required*

No description available.

### Returns

**Returns** `List[Dict[str, Any]]`

The result of the operation.

## Uses

* `mem0_client.search`
* `logger.warning`

## Used By

* [`Mem0MemoryAdapter.search_long_term`](../functions/Mem0MemoryAdapter-search_long_term)

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/memory/adapters/factories.py#L40)
>
> `praisonaiagents/memory/adapters/factories.py` at line 40


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.