Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Mem0 Dify Plugin - Changelog

## Version 0.3.1 (2026-05-16)

### 🐛 Fixes
- **Windows debugging environment: psycopg3 connection issue** (PR #47, credit: sususweet):
- Fixed `sending query failed: another command is already in progress` error on Windows caused by gevent's selector conflicting with ProactorEventLoop
- Added `asyncio.WindowsSelectorEventLoopPolicy()` on Windows to resolve the gevent/asyncio incompatibility at startup
- Made psycopg installation platform-conditional: psycopg3 (`psycopg[binary,pool]`) on Linux/macOS, psycopg2 (`psycopg2-binary`) on Windows only; mem0's built-in psycopg2 fallback handles the rest transparently
- **Ollama provider: API key screen hang** (PR #46, credit: sususweet):
- Added missing `ollama` package to `pyproject.toml` so credential validation no longer stalls when Ollama is selected as the LLM provider

### 🔧 Configuration / Defaults
- **Write operation timeout increase** (PR #47):
- Raised `WRITE_OPERATION_TIMEOUT` from 15 s to 45 s; write operations include an extra LLM inference step (fact extraction) that can exceed 15 s on slower providers, causing silent background write failures in async mode

---

## Version 0.3.0 (2026-04-22)

### 🛠️ Reliability & Compatibility
Expand Down
12 changes: 5 additions & 7 deletions PR_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Plugin Submission Form

Last updated: 2026-04-22
Last updated: 2026-05-16

## 1. Metadata

Expand Down Expand Up @@ -31,15 +31,13 @@ Please provide the following metadata of your plugin to make it easier for the r

<!-- Please briefly describe the purpose of the new plugin or the updates made to the existing plugin -->

This submission updates the Mem0 Dify plugin to **v0.3.0** (self-hosted mode). Key changes are summarized below; detailed release notes and historical context are in [CHANGELOG.md](https://github.com/beersoccer/mem0_dify_plugin/blob/main/CHANGELOG.md).
This submission updates the Mem0 Dify plugin to **v0.3.1** (self-hosted mode). Key changes are summarized below; detailed release notes and historical context are in [CHANGELOG.md](https://github.com/beersoccer/mem0_dify_plugin/blob/main/CHANGELOG.md).

### Key Updates

- **Checkpoint Reliability** (PR #44): Fixed async-mode resume-cursor restoration (`resume_conversation_cursor`, `resume_run_at`, `resume_start_time` now correctly round-trip through `AsyncCheckpointManager.load()`); switched save order to add-first-then-delete to prevent accidental data loss on write failure
- **Distributed Lock Reliability** (PR #44): `acquire_lock()` now performs read-after-write verification using a new `_load_all_locks()` method; earliest `acquired_at` wins on contention, loser self-deletes; `forget_memories` gains `_clean_expired_locks()` for lock record hygiene
- **Provider Compatibility Gate**: 117 parametrized unit tests covering canonical provider name strings and critical config fields across all mainstream mem0 LLMs, Embedders, Vector DBs, and Rerankers; 28 of these cross-check the mem0 factory registry directly to fail early on version-upgrade provider drift; removed invalid `mistral` provider entry
- **Test Isolation Fix**: Async checkpoint tests refactored to sync `def` + `_run_async()` helper that spawns a dedicated thread and explicitly clears inherited running-loop state, eliminating pytest-asyncio AUTO mode cross-test contamination
- **Test Suite Growth**: Unit tests grew from ~380 to **471 passing** tests
- **Windows Debugging Fix** (PR #47, credit: sususweet): Fixed psycopg3 connection errors on Windows caused by gevent's selector conflicting with `ProactorEventLoop`; added `asyncio.WindowsSelectorEventLoopPolicy()` on `win32` at startup; made psycopg dependency platform-conditional (psycopg3 on Linux/macOS, psycopg2 on Windows)
- **Write Timeout Increase** (PR #47): Raised `WRITE_OPERATION_TIMEOUT` from 15 s to 45 s; write operations involve an extra LLM inference step that can exceed 15 s on slower providers, previously causing silent background write failures in async mode
- **Ollama Dependency Fix** (PR #46, credit: sususweet): Added missing `ollama` package to `pyproject.toml` so the API-key validation screen no longer hangs when Ollama is selected as the LLM provider

All API keys and credentials are stored locally in the user's Dify instance configuration and are not shared with any third parties. The plugin only communicates with services configured by the user (their LLM, embedding, and database services).

Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Mem0 Dify Plugin v0.3.0
# Mem0 Dify Plugin v0.3.1

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Dify Plugin](https://img.shields.io/badge/Dify-Plugin-blue)](https://dify.ai)
[![Mem0 AI](https://img.shields.io/badge/Mem0-AI-green)](https://mem0.ai)

Last updated: 2026-04-22
Last updated: 2026-05-16

A comprehensive Dify plugin that integrates [Mem0 AI](https://mem0.ai)'s intelligent memory layer, providing **self-hosted mode** tools with a unified client for self-hosted setups. [View on GitHub](https://github.com/beersoccer/mem0_dify_plugin)

Expand Down Expand Up @@ -37,7 +37,17 @@ A comprehensive Dify plugin that integrates [Mem0 AI](https://mem0.ai)'s intelli
- 🌍 **Internationalized** - Chinese/English
- ⚙️ **Async Mode Switch** - `async_mode` is enabled by default; Write ops (Add/Update/Delete) are non-blocking in async mode, Read ops (Search/Get/History) always wait; in sync mode all operations block until completion.

### What's New (v0.3.0) - Checkpoint & Lock Reliability ✅
### What's New (v0.3.1) - Windows Compatibility & Write Timeout Fix ✅
- **Windows debugging environment support** (PR #47, credit: sususweet):
- Fixed psycopg3 connection errors on Windows (gevent selector conflict with ProactorEventLoop)
- Added `asyncio.WindowsSelectorEventLoopPolicy()` on Windows at plugin startup
- Conditional psycopg dependency: psycopg3 on Linux/macOS (production), psycopg2 on Windows (local debugging)
- **Write operation timeout** (PR #47):
- Raised `WRITE_OPERATION_TIMEOUT` from 15 s to 45 s to reduce silent write failures on slower LLM providers
- **Ollama provider fix** (PR #46, credit: sususweet):
- Added missing `ollama` dependency so the API-key validation screen no longer hangs when Ollama is selected

### Previous Updates (v0.3.0) - Checkpoint & Lock Reliability ✅
- **Checkpoint and distributed lock reliability** (PR #44):
- Improved checkpoint write/read sequencing to eliminate rare race conditions under concurrent extraction tasks
- Strengthened distributed lock acquisition and release paths for more predictable behavior under load
Expand Down Expand Up @@ -387,6 +397,7 @@ done

| Version | Date | Changes |
|---------|------|---------|
| v0.3.1 | 2026-05-16 | Windows psycopg3 connection fix, conditional psycopg platform dependency, write timeout 15→45 s, Ollama dependency fix |
| v0.3.0 | 2026-04-22 | Checkpoint and distributed lock reliability improvements, async checkpoint test isolation, provider compatibility gate and registry validation |
| v0.2.12 | 2026-04-16 | Dynamic `extract_long_term_memory` parameter binding via `form: llm`, bundled Cohere SDK dependency, and reranker documentation refresh |
| v0.2.11 | 2026-04-14 | AsyncMemory.from_config compatibility across mem0 variants, supported mem0 version range alignment, and release/test documentation refresh |
Expand Down
2 changes: 1 addition & 1 deletion manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.3.0
version: 0.3.1
type: plugin
author: beersoccer
name: mem0ai
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mem0-dify-plugin"
version = "0.3.0"
version = "0.3.1"
description = "Mem0 Dify plugin"
requires-python = ">=3.12"
dependencies = [
Expand Down
Loading