Skip to content

Commit b9d9fbf

Browse files
authored
Merge pull request #61 from Firefox-AI/improve-insight-v1
iterating on insight improvements
2 parents 7923051 + 6976864 commit b9d9fbf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

browser/components/smartwindow/content/insights.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ export const INTENTS = [
127127
* Static data serves as placeholder until user generates insights
128128
*/
129129
const DEFAULT_INSIGHTS_DATA = {};
130-
const DEFAULT_INSIGHTS_SYSTEM_PROMPT = "[ NO INSIGHTS FOUND FOR THIS USER! We could not retrieve any insights for this user ]"
130+
const DEFAULT_INSIGHTS_SYSTEM_PROMPT =
131+
"[ NO INSIGHTS FOUND FOR THIS USER! We could not retrieve any insights for this user ]";
131132

132133
function getInsightsMeta() {
133134
const sw = getSmartWindow();
@@ -1113,14 +1114,15 @@ ${intentsList}
11131114
- Dont repeat insights about entities that are already in related_insights.
11141115
11151116
## Insight rules (write 1 short, specific sentence)
1116-
- Style = <who/what + action + constraint>, 4–10 words, no trailing period.
1117-
- Must include at least 1 concrete entity (brand/site/product/event) OR a clear constraint (price, time, size, color).
1118-
- Vary verbs; avoid repetitive "buys/watches" when not aligned with intent.
1117+
- Insights are useful preferences about the user such as product, brands, preferences, behavior, etc that could be useful to personalize the conversation response in the future.
1118+
- Dont imagine an action unless you see evidence for sure. E.g. use "shops for" unless you see an evidence of purchase or buy,
1119+
use "plans trip" unless you see a ticket was purchased,
1120+
use "looked for a tv show" unless sure if the user watched.
11191121
- Dont include person name unless they are popular to avoid any PII.
11201122
- Dont generate insight from just odd one visit.
11211123
- The insights are generated based on a pattern of visits.
11221124
- Don’t infer product relationships between unrelated domains unless both appear together in the same session evidence.
1123-
- No vague phrasing like "various", "often".
1125+
- AVOID collecting insights about personal, health related, or sensitive or anything user would like to keep it private.
11241126
- Don't generate a new insight unless it is quite different from known items in related_insights.
11251127
- If no safe, specific insight is supported by Inputs, set "insight_summary": null.
11261128
- Examples of good form:
@@ -1730,7 +1732,7 @@ export function buildInsightsSystemPrompt() {
17301732
const insightsData = getInsightsData();
17311733

17321734
if (!insightsData || Object.keys(insightsData).length === 0) {
1733-
return DEFAULT_INSIGHTS_SYSTEM_PROMPT
1735+
return DEFAULT_INSIGHTS_SYSTEM_PROMPT;
17341736
}
17351737

17361738
// Use generated insights if available, otherwise fall back to defaults

0 commit comments

Comments
 (0)