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
startTime set 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
Description
The HSG query function in
memory/hsg.tssupports temporal filtering viastartTimeandendTimeparameters, but the/queryendpoint inserver/routes/vercel.tsdoesn't pass these parameters tohsg_query().This means users cannot filter memories by creation date via the REST API, even though the core functionality exists.
Current behavior
The
startTimeandendTimefrom the request body are ignored.Expected behavior
The endpoint should extract and pass temporal parameters:
Steps to reproduce
startTimeset to a future timestamp:Suggested fix
In
backend/src/server/routes/vercel.ts, add extraction ofstartTime/endTimeand pass them tohsg_query().The same fix should be applied to
/memory/queryinmemory.tsfor consistency.Version
v1.2.3