feat(memory): enforce English-only memory indexing with CJK guardrail

Memory layer is now English-indexed: memories() query terms and
  remember() summaries must be English. Adds a runtime assertion that
  rejects CJK text in both paths, guiding the agent to translate
  non-English user requests before querying or writing memories.
  Ensures consistent retrieval regardless of conversation language.
This commit is contained in:
tommy0103
2026-06-10 03:50:38 +08:00
parent 89b53d4570
commit b52f57b538
5 changed files with 45 additions and 17 deletions
+2 -1
View File
@@ -18,7 +18,7 @@ faceted detail pass if the first pass reveals useful projects, sessions, files,
or terms.
```js
const topic = 'topic terms from the user request';
const topic = 'English topic terms translated from the user request';
const map = overview({ limit: 6 });
const project = map.current.project?.project;
const scoped = project ? { project } : {};
@@ -124,6 +124,7 @@ return hits.slice(0, 5).map(h => {
Use this when prior conclusions may exist but the answer still depends on raw
session evidence. Keep memory as prior notes, not final authority; compare it
with session evidence in your final answer when correctness matters.
Memory query terms are English even when the user asks in another language.
```js
const project = '%quiet-zero%';