-
Notifications
You must be signed in to change notification settings - Fork 315
Open
Description
Description
The HSG query function in memory/hsg.ts supports temporal filtering via startTime and endTime parameters, but the /query endpoint in server/routes/vercel.ts doesn't pass these parameters to hsg_query().
This means users cannot filter memories by creation date via the REST API, even though the core functionality exists.
Current behavior
// vercel.ts line ~14
const matches = await hsg_query(query, k, { user_id });The startTime and endTime from the request body are ignored.
Expected behavior
The endpoint should extract and pass temporal parameters:
const startTime: number | undefined = b.startTime ? Number(b.startTime) : undefined;
const endTime: number | undefined = b.endTime ? Number(b.endTime) : undefined;
const matches = await hsg_query(query, k, { user_id, startTime, endTime });Steps to reproduce
- Store a memory
- Query with
startTimeset to a future timestamp:curl -X POST http://localhost:8090/query \ -H "Content-Type: application/json" \ -d '{"query": "test", "startTime": 9999999999999}'
- Expected: 0 results (no memories created after that timestamp)
- Actual: Returns all matching memories (filter ignored)
Suggested fix
In backend/src/server/routes/vercel.ts, add extraction of startTime/endTime and pass them to hsg_query().
The same fix should be applied to /memory/query in memory.ts for consistency.
Version
v1.2.3
Metadata
Metadata
Assignees
Labels
No labels