Skip to content

fix: add missing limit, threshold, and infer params to REST API models (#3976)#2

Open
themavik wants to merge 1 commit intomainfrom
fix/3976-rest-api-missing-params
Open

fix: add missing limit, threshold, and infer params to REST API models (#3976)#2
themavik wants to merge 1 commit intomainfrom
fix/3976-rest-api-missing-params

Conversation

@themavik
Copy link
Owner

@themavik themavik commented Feb 9, 2026

Fixes mem0ai#3976.

Root cause: Pydantic request models SearchRequest and MemoryCreate did not declare limit, threshold, and infer fields, so Pydantic v2 silently dropped them.

Fix: Added limit: Optional[int] and threshold: Optional[float] to SearchRequest, and infer: Optional[bool] to MemoryCreate.

mem0ai#3976)

Root cause: The Pydantic request models SearchRequest and MemoryCreate
did not declare limit, threshold, and infer fields. Since Pydantic v2
defaults to extra='ignore', these params were silently dropped from
requests, making it impossible for clients to control result count,
similarity filtering, or fact extraction behavior.

Fix: Add Optional fields for limit and threshold to SearchRequest,
and infer to MemoryCreate. The existing model_dump() + **params
pattern automatically forwards these to Memory.search() and
Memory.add().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REST API server silently drops limit, threshold, and infer parameters

1 participant