Mem0 v2.2.1 stops reporting memories it never stored

1 month ago

Mem0 v2.2.1: add() stops reporting memories the vector store rejected, Turbopuffer filters apply every operator, S3 Vectors and Turbopuffer scores rank correctly, Claude reasoning models work on Bedrock, pg becomes optional in the TypeScript SDK, and Mem0 for Hermes Agent ships as a standalone plugin. https://github.com/mem0ai/mem0/releases/tag/v2.2.1 https://github.com/mem0ai/mem0/compare/v2.2.0...v2.2.1 https://docs.mem0.ai/integrations/hermes

Ask about this presentation

Chapters

  1. 0:00Mem0 v2.2.1
  2. 0:11What add() returns
  3. 0:13Only inserted records count
  4. 0:25VectorStoreError
  5. 0:37Context manager is back
  6. 0:47Vector store search
  7. 0:49Turbopuffer filters
  8. 1:04Turbopuffer scores
  9. 1:18S3 Vectors scores
  10. 1:31Models and providers
  11. 1:33Bedrock reasoning models
  12. 1:46Provider defaults
  13. 2:00Installing from npm
  14. 2:02pg is optional
  15. 2:16PGVector needs pg
  16. 2:28Mem0 for Hermes Agent
  17. 2:30Standalone Hermes plugin
  18. 2:44Three backends
  19. 2:57Upgrade
Show transcript
  1. In this Mem0 release, the add call changes what it reports. Until now, a record the vector store rejected still came back as a successful add event, although it was never stored.

    Slide text
    Mem0

    Mem0 v2.2.1 stops reporting memories it never stored

    add() now returns only what the vector store accepted.

    docs/changelog/sdk.mdx

  2. What the add call returns.

    Slide text

    01: What add() returns

    mem0/memory/main.py

  3. Now only the records the vector store actually inserted count. Those are the ones written to history, linked to entities, and returned to your code, in both Memory and AsyncMemory.

    Slide text
    01 02 03 04 05 Memory · AsyncMemory

    Only records the store inserted reach history and the result

    • written to history
    • linked to entities
    • returned to your code
    mem0/memory/main.py
  4. If none of the extracted memories could be inserted, the add call now raises a VectorStoreError. Before, it returned those memories anyway, so your code carried on as if they were saved.

    Slide text
    01 02 03 04 05 VectorStoreError

    When nothing could be stored, add() raises an error

    before returned memories that were never stored
    now raises VectorStoreError
    docs/changelog/sdk.mdx
  5. The context manager protocol is back on Memory and AsyncMemory. Open one in a with block, or an async with block, and the instance closes itself when the block exits.

    Slide text
    01 02 03 04 05 Memory · AsyncMemory

    with Memory() as m: works again

    The instance closes when the block exits.

    with Memory() as m:
        ...
    
    async with AsyncMemory() as m:
        ...
    docs/changelog/sdk.mdx
  6. Vector store search.

    Slide text

    02: Vector store search

    docs/changelog/sdk.mdx

  7. Turbopuffer filters now apply every operator, in both the Python and TypeScript SDKs. Before, only the range operators were read. Equals, not equals, in and not in were dropped silently, and the query came back unfiltered.

    Slide text
    01 02 03 04 05 filters

    Turbopuffer filters now apply every operator

    In the Python and the TypeScript SDK.

    eq ne gt gte lt lte in nin

    Before, eq, ne, in and nin were dropped and the query ran unfiltered.

    mem0/vector_stores/turbopuffer.py · mem0-ts/src/oss/src/vector_stores/turbopuffer.ts
  8. Turbopuffer search scores now respect the distance metric. With squared euclidean distance, the old score went negative for any distance above one, which turned the ranking upside down. Now it stays between zero and one.

    Slide text
    01 02 03 04 05 search()

    Turbopuffer ranks euclidean_squared results in the right order

    before 1 - distance, negative above 1, ranking inverted
    now 1 / (1 + distance)
    docs/changelog/sdk.mdx
  9. S3 Vectors search scores are now metric-aware. With euclidean distance, the old formula collapsed most scores to zero. Now every distance maps to its own score, and a closer match always scores higher.

    Slide text
    01 02 03 04 05 euclidean

    S3 Vectors scores stop collapsing to zero

    before max(0, 1 - distance), most scores 0
    now 1 / (1 + distance)
    mem0/vector_stores/s3_vectors.py
  10. Models and providers.

    Slide text

    03: Models and providers

    docs/changelog/sdk.mdx

  11. On AWS Bedrock, Claude reasoning models can send a reasoning block before the text. Mem0 used to take only the first block and fail with a key error. Now it returns the first block that carries text.

    Slide text
    01 02 03 04 05 AWS Bedrock

    Claude reasoning models on Bedrock stop failing with a KeyError

    before read content[0], a reasoningContent block
    now the first block that carries text
    mem0/llms/aws_bedrock.py
  12. In the TypeScript SDK, a DeepSeek or xAI config without its own base URL or model used to point at OpenAI, with an OpenAI model name. Now it falls back to that provider's own defaults.

    Slide text
    01 02 03 04 05 TypeScript

    A DeepSeek or xAI config stays pointed at DeepSeek or xAI

    OpenAI's default baseURL and model now apply only to OpenAI.

    before OpenAI's URL, with an OpenAI model name
    now the provider's defaults and DEEPSEEK_API_BASE, XAI_API_BASE
    mem0-ts/src/oss/src/config/manager.ts
  13. Installing from npm.

    Slide text

    04: Installing from npm

    mem0-ts/package.json

  14. Installing mem0ai from npm no longer pulls in the Postgres driver. It's an optional peer dependency now, with a caret range in place of the exact pin, so it stops clashing with your app's own version.

    Slide text
    01 02 03 04 05 TypeScript

    npm install mem0ai no longer pulls in pg

    pg, @types/pg and natural are optional peer dependencies.

    before pg pinned at exactly 8.11.3
    now a caret range, and only if you want it
    mem0-ts/package.json
  15. If you use the PGVector store, the SDK now loads the Postgres driver only when that store is used. So install it next to mem0ai with one npm command.

    Slide text
    01 02 03 04 05 PGVector

    Using PGVector from TypeScript? Install pg yourself

    npm install pg
    docs/components/vectordbs/dbs/pgvector.mdx
  16. Mem0 for Hermes Agent.

    Slide text

    05: Mem0 for Hermes Agent

    integrations/hermes-plugin-mem0/README.md

  17. Mem0's memory for Hermes Agent, from Nous Research, now has its own plugin. Install it from the Mem0 repository, enable it, and run the memory setup wizard. It recalls memories before each reply.

    Slide text
    01 02 03 04 05 hermes-plugin-mem0

    Mem0 for Hermes Agent ships as a standalone plugin

    It recalls memories before each reply and extracts facts after it.

    hermes plugins install \
      mem0ai/mem0/integrations/hermes-plugin-mem0
    hermes plugins enable mem0
    hermes memory setup mem0
    integrations/hermes-plugin-mem0/README.md
  18. The setup wizard offers three backends. Mem0 Cloud with an API key, your own self-hosted Mem0 server, or the open source SDK running inside Hermes with your own model and vector store.

    Slide text
    01 02 03 04 05 hermes memory setup

    Pick where the memories are kept when you run setup

    • Mem0 Cloud, with a Mem0 API key
    • a self-hosted Mem0 server, its URL and key
    • the OSS SDK, in process, with your own LLM, embedder and vector store
    integrations/hermes-plugin-mem0/README.md
  19. Both SDKs shipped on September twenty-fifth. Upgrade mem0ai from PyPI for Python, or from npm for TypeScript.

    Slide text
    Mem0

    Mem0 v2.2.1

    Python SDK 2.2.1 and TypeScript SDK 3.3.1, 25 September 2026

    pip install -U mem0ai
    npm install mem0ai@latest

    pyproject.toml · mem0-ts/package.json

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York