Skip to content

PostgreSQL JSONB reads float property values of 1e16 or more back as integers, making their segments unreadable, and -0.0 as 0.0 #1797

Description

@edwinyyyu

What happens

Measured on main at ad8ff24, one value at a time through each store's own code. The value is a float metadata value of an EpisodeEntry passed to MemMachine.add_episodes, which becomes a filterable property:

value episode store, PostgreSQL segment store, PostgreSQL SQLite stores, Qdrant, and Milvus
1e16, 1.5e17, -1e20, 1e300 reads back as an int (10000000000000000) stored, and reading the segment raises TypeError: Property 'k' entry 'v' must be float, got int, so every query whose result holds it raises float kept
-0.0 reads back as 0.0 reads back as 0.0 -0.0 kept
1e15, 2.0, 1.5, 1e-07 float kept float kept float kept

The REST request takes only strings as metadata values, so this is reachable in process only.

Why

  • PostgreSQL JSONB keeps a number as numeric and writes it back without an exponent and without the sign of zero, so 1e16 comes back as 10000000000000000, which JSON decoding reads as an integer.
  • The segment store's type-tagged codec requires a float entry to decode to a float (packages/server/src/memmachine_server/common/properties_json.py:134-137).

Expected

A float property value reads back as the same float from every store, and a stored segment stays readable.

Fix

Not in #1792. Two choices: decode an integer as a float for an entry typed float (or encode floats in a form JSONB keeps), and either refuse -0.0 where an episode enters or turn it into 0.0 there.

🤖 Written by Claude Code (Claude Opus 5.5) on behalf of @edwinyyyu.

Activity

  1. added theissue type on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions