[kimi] Add /api/matrix/memory/search endpoint (#678) #740

Merged
kimi merged 1 commits from kimi/issue-678 into main 2026-03-21 14:52:32 +00:00

1 Commits

Author SHA1 Message Date
kimi
4a7f362165 feat: Add /api/matrix/memory/search endpoint — visitors query Timmy's memory
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
Implements GET /api/matrix/memory/search?q=<query> endpoint that allows
Matrix visitors to search Timmy's memory. Results are formatted for the
3D world display.

Features:
- Returns JSON array of memory snippets with text (truncated 200 chars),
  relevance (0-1), created_at, and context_type
- Max 5 results per query
- Returns 400 if q param missing or empty
- Rate limited to 1 search per 5 seconds per IP
- Reuses existing memory_system.search() internals
- Graceful degradation on search failure (returns empty array)

Files changed:
- src/dashboard/routes/world.py: Added endpoint and helper functions
- tests/dashboard/test_world_api.py: Added comprehensive tests

Refs #678
2026-03-21 10:50:07 -04:00