PHPackages                             shanginn/mem0 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. shanginn/mem0

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shanginn/mem0
=============

Memory for AI Agents; SOTA in AI Agent Memory;

0.0.2(9mo ago)03Apache-2.0PHPPHP &gt;=8.2CI passing

Since Aug 15Pushed 9mo agoCompare

[ Source](https://github.com/shanginn/mem0-sdk-php)[ Packagist](https://packagist.org/packages/shanginn/mem0)[ RSS](/packages/shanginn-mem0/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (12)Versions (3)Used By (0)

⚠️⚠️⚠️ UNSUPPORTED ⚠️⚠️⚠️
=========================

[](#️️️-unsupported-️️️)

These docs are ai bullshit, see the example for the working code.

UNOFFICIAL MEM0 PHP SDK
=======================

[](#unofficial-mem0-php-sdk)

**This is an unofficial PHP SDK for the Mem0 API. This library is not affiliated with, endorsed by, or officially supported by Mem0.**

---

 [ ![Mem0 - The Memory Layer for Personalized AI](https://raw.githubusercontent.com/mem0ai/mem0/main/docs/images/banner-sm.png) ](https://github.com/mem0ai/mem0)

 **⚡ +26% Accuracy vs. OpenAI Memory • 🚀 91% Faster • 💰 90% Fewer Tokens**

Mem0 PHP SDK
------------

[](#mem0-php-sdk)

This is an unofficial PHP SDK for [Mem0](https://mem0.ai), the intelligent memory layer for personalized AI. Mem0 enhances AI assistants and agents by enabling them to remember user preferences, adapt to individual needs, and continuously learn over time.

### Key Features &amp; Use Cases

[](#key-features--use-cases)

**Core Capabilities:**

- **Multi-Level Memory**: Seamlessly retains User, Session, and Agent state with adaptive personalization.
- **Developer-Friendly**: Intuitive API and cross-platform SDKs.
- **Type Safety**: Full PHP 8.2+ type declarations and strict typing
- **Async Support**: Built on Amp HTTP client for non-blocking operations
- **Advanced Filtering**: Complex query capabilities with AND/OR logic
- **Rich Memory Types**: Support for conversational memories and metadata

**Applications:**

- **AI Assistants**: Consistent, context-rich conversations.
- **Customer Support**: Recall past tickets and user history for tailored help.
- **Personalized Experiences**: Adapt applications based on user behavior and history.

🚀 Quickstart Guide
------------------

[](#-quickstart-guide)

### 1. Installation

[](#1-installation)

Install the SDK via Composer:

```
composer require shanginn/mem0
```

### 2. API Key Setup

[](#2-api-key-setup)

1. Sign in to the [Mem0 Platform](https://app.mem0.ai).
2. Copy your API Key from the dashboard.

### 3. Basic Usage

[](#3-basic-usage)

Create an instance of the `Mem0` client with your API key:

```
