Bug Description
When GRAPH_DB_BACKEND=postgres, PostgresGraphDB.export_graph accepted page, page_size, memory_type, status, and filter only through **kwargs but silently ignored them. Its SQL had no LIMIT/OFFSET and no filtering beyond user_name, and total_nodes was set to the length of the returned page.
As a result, every consumer of POST /get_memory (which passes pagination and tag filters down to text_mem.get_all → export_graph) received the full memory list on every page, with an incorrect total — pagination and tag filtering were both broken.
How to Reproduce
- Run MemOS Product API with
GRAPH_DB_BACKEND=postgres.
- Call
POST /product/get_memory with page, page_size, and/or tag filters.
- Observe that all memories are returned regardless of page, and
total_nodes matches the page size instead of the filtered total.
Environment
- Python: 3.11
- Operating System: Linux (Docker)
- MemOS: main branch
- Graph backend: postgres + pgvector
Additional Context
Bug Description
When
GRAPH_DB_BACKEND=postgres,PostgresGraphDB.export_graphacceptedpage,page_size,memory_type,status, andfilteronly through**kwargsbut silently ignored them. Its SQL had noLIMIT/OFFSETand no filtering beyonduser_name, andtotal_nodeswas set to the length of the returned page.As a result, every consumer of
POST /get_memory(which passes pagination and tag filters down totext_mem.get_all→export_graph) received the full memory list on every page, with an incorrect total — pagination and tag filtering were both broken.How to Reproduce
GRAPH_DB_BACKEND=postgres.POST /product/get_memorywithpage,page_size, and/or tag filters.total_nodesmatches the page size instead of the filtered total.Environment
Additional Context
fix/postgres-export-graph-pagination(PR fix: support pagination and filters in Postgres export_graph #2268).