v2.0.18
mem0ai/mem0v2.0.18Aug 11, 2026by kartik-mem0
AI Summary
This release focuses on critical bug fixes for the Mem0 Python SDK, specifically addressing session key handling, vector store query validation, and connection management. Improvements include proper escaping of special characters in IDs, stricter validation for PGVector filters, and prevention of resource leaks during Oracle initialization.
Key Highlights
- Fixed session scope key generation to properly percent-escape special characters (%, &, =) in IDs to prevent ambiguity.
- Enhanced PGVector filter validation to raise explicit ValueError for non-list inputs in in/nin queries.
- Added validation to reject index_accuracy=0 in Oracle AI Vector Search configurations to prevent invalid queries.
- Ensured Oracle connections are closed properly if initialization fails to prevent resource leaks.
Full Release Notes
**Bug Fixes:**
- **Core:** Percent-escape `%`, `&`, and `=` in `user_id`, `agent_id`, and `run_id` when building the session scope key for the recent-conversation buffer, so the key stays unambiguous for ids containing those characters. Ordinary ids keep their existing key; an id already containing `%`, `&`, or `=` maps to a new key, so its buffer starts empty once and refills on the next `add()`. Stored memories are unaffected. Reported by [@OfficialAbhinavSingh](https://github.com/OfficialAbhinavSingh) ([#6892](https://github.com/mem0ai/mem0/pull/6892))
- **Vector Stores:** Raise `ValueError` when a PGVector `in`/`nin` filter value is not a list. A string value was previously iterated character by character into the generated `= ANY(...)` array (so `{"user_id": {"in": "alice"}}` matched `a`, `l`, `i`, `c`, `e`), and a non-iterable value raised a bare `TypeError` from deep inside filter building ([#6879](https://github.com/mem0ai/mem0/pull/6879))
- **Vector Stores:** Reject `index_accuracy=0` in the Oracle AI Vector Search config. The range check sat behind a truthiness test, so `0` skipped validation entirely and was passed through to `WITH TARGET ACCURACY 0` instead of raising ([#6848](https://github.com/mem0ai/mem0/pull/6848))
- **Vector Stores:** Close the Oracle connection or pool that Mem0 opened when initialization fails. A client version check, a database version check, or a `create_col()` error previously propagated with the connection still open, leaking it for the life of the process. A caller-supplied `client` is left untouched ([#6839](https://github.com/mem0ai/mem0/pull/6839))