docs: clarify filter field prefix requirements#1333
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates public API documentation to match the stricter filter behavior introduced in #1291 (requiring metadata field prefixes and rejecting unsupported fields).
Changes:
- Clarifies in router docstrings that
filteruses the structured filter expression language and requiresm./metadata.prefixes for user metadata. - Regenerates
docs/openapi.jsonto reflect the updated endpoint descriptions. - Updates Python + TS REST docs/examples to use
m.sourceand to document rejection of unsupported filter fields.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/common/src/memmachine_common/api/doc.py | Updates endpoint docstrings for list/search memories filter semantics and prefix requirements. |
| docs/openapi.json | Regenerated OpenAPI description strings to align with updated router docs. |
| docs/api_reference/ts-rest/interfaces/SearchMemoriesOptions.mdx | Updates filter field docs + adds example using m.source. |
| docs/api_reference/ts-rest/interfaces/ListMemoriesOptions.mdx | Updates filter field docs + adds example using m.source. |
| docs/api_reference/python/memory_api.mdx | Updates Python example + parameter docs to use prefixed metadata keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| The filter field accepts the structured filter expression language. | ||
| User-defined metadata keys must be referenced with the `m.` or `metadata.` prefix | ||
| (for example, `m.source = "chat_v3"`). Unknown or unsupported fields are rejected | ||
| instead of being ignored. |
There was a problem hiding this comment.
“Rejected” is an important behavioral change, but the docs don’t say how the rejection manifests (e.g., HTTP status code / error shape). Consider explicitly stating the response behavior (such as returning a 4xx) and/or linking to (or briefly summarizing) the structured filter expression language reference so users know what syntax is accepted beyond the single equality example.
|
@haosenwang1018 thank you for the pull request submission. Please sign your commits, resolve the unit test failures, and review the CoPilot feedback. You only need to resolve the relevant items. Thanks. |
Update the API docstrings and the TypeScript `ListMemoriesOptions` reference to document the `m.` / `metadata.` prefix requirement for user-defined metadata fields in the filter expression language. Unknown or unsupported fields are now rejected by the server (see MemMachine#1291), so referencing user metadata without a prefix returns a 400 instead of being silently ignored. Files updated: - `packages/common/src/memmachine_common/api/doc.py` — `SEARCH_MEMORIES` and `LIST_MEMORIES` endpoint docstrings. - `docs/api_reference/ts-rest/interfaces/ListMemoriesOptions.mdx` — `filter` property description + `m.source = "chat_v3"` example in the usage snippet. - `docs/openapi.json` — regenerated from the updated doc.py via `docs/tools/generate_openapi.py`. The original PR (MemMachine#1333) also touched `docs/api_reference/python/memory_api.mdx` and `docs/api_reference/ts-rest/interfaces/SearchMemoriesOptions.mdx`, but `main` has since received equivalent (and slightly more detailed) wording in both files via the merge of MemMachine#1352 and the related cleanup. Those hunks have been dropped during rebase to avoid no-op conflicts. Refs: MemMachine#1333 Co-authored-by: Steve Scargall <steve.scargall@gmail.com> Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>
22a1b4c to
cfc6467
Compare
Purpose of the change
Document the stricter filter behavior introduced by #1291 so the public API docs match runtime behavior.
Description
Fixes #1306
Fixes #1307
Fixes #1308
This updates the memory search/list docs to explain that:
m.ormetadata.prefixUpdated locations:
docs/openapi.jsonSearchMemoriesOptionsandListMemoriesOptionsType of change
How Has This Been Tested?
Manual verification:
packages/common/src/memmachine_common/api/doc.pyuv run python docs/tools/generate_openapi.pydocs/openapi.jsondescriptions for list/search memories reflect the prefixed filter syntaxm.sourceChecklist
Maintainer Checklist