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.
What happens
Measured on
mainat ad8ff24, one value at a time through each store's own code. The value is a float metadata value of anEpisodeEntrypassed toMemMachine.add_episodes, which becomes a filterable property:1e16,1.5e17,-1e20,1e300int(10000000000000000)TypeError: Property 'k' entry 'v' must be float, got int, so every query whose result holds it raises-0.00.00.0-0.0kept1e15,2.0,1.5,1e-07The REST request takes only strings as metadata values, so this is reachable in process only.
Why
numericand writes it back without an exponent and without the sign of zero, so1e16comes back as10000000000000000, which JSON decoding reads as an integer.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.0where an episode enters or turn it into0.0there.🤖 Written by Claude Code (Claude Opus 5.5) on behalf of @edwinyyyu.