Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(search): classify first-person "what do I know about X" as an entity query (#3615) (#3616)

Sean Gearin002ac8050f1d
diff --git a/src/core/search/query-intent.ts b/src/core/search/query-intent.ts
index 844bfa25b6..3f8a5d5a7c 100644
--- a/src/core/search/query-intent.ts
+++ b/src/core/search/query-intent.ts
@@ -96,7 +96,7 @@ const ENTITY_PATTERNS = [
/\boverview\b/i,
/\bbackground\b/i,
/\bprofile\b/i,
- /\bwhat\s+do\s+(you|we)\s+know\b/i,
+ /\bwhat\s+do\s+(i|you|we)\s+know\b/i,
];
const FULL_CONTEXT_PATTERNS = [
diff --git a/test/query-intent.test.ts b/test/query-intent.test.ts
index a288cd5851..8e8ca2bc75 100644
--- a/test/query-intent.test.ts
+++ b/test/query-intent.test.ts
@@ -33,6 +33,14 @@ describe('classifyQuery — entity / canonical queries → both axes off', () =>
expect(r.suggestedSalience).toBe('off');
});
+ test('"what do I know about widget-co" → entity, same as you/we phrasings', () => {
+ const r = classifyQuery('what do I know about widget-co');
+ expect(r.intent).toBe('entity');
+ expect(r.suggestedDetail).toBe('low');
+ expect(r.suggestedRecency).toBe('off');
+ expect(r.suggestedSalience).toBe('off');
+ });
+
test('"history of X" → both off (canonical)', () => {
const r = classifyQuery('history of acme corp');
expect(r.suggestedRecency).toBe('off');