From 0bb381b0d20ec02e259fb2633c5301bdc63e81f9 Mon Sep 17 00:00:00 2001 From: "Claw (AINYC Agent)" Date: Mon, 30 Mar 2026 04:50:15 +0000 Subject: [PATCH] fix: improve snapshot competitor extraction (#193) - Increase answer text clip limit from 420 to 2000 chars so analysis LLM can see competitor names in full responses - Strengthen batch analysis prompt to emphasize competitor extraction as the most critical field - Increase per-assessment competitor limit from 6 to 10 --- packages/canonry/src/snapshot-service.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/canonry/src/snapshot-service.ts b/packages/canonry/src/snapshot-service.ts index e4a5c8e..7dd3981 100644 --- a/packages/canonry/src/snapshot-service.ts +++ b/packages/canonry/src/snapshot-service.ts @@ -379,7 +379,7 @@ export class SnapshotService { heuristicCompetitors: result.recommendedCompetitors, citedDomains: result.citedDomains, groundingSources: result.groundingSources.map(source => source.uri), - answerText: clipText(result.answerText, 420), + answerText: clipText(result.answerText, 2000), })), ) @@ -425,7 +425,7 @@ export class SnapshotService { incorrectClaims: uniqueStrings(assessment.incorrectClaims ?? []).slice(0, 5), ...(hasReviewedCompetitors ? { - recommendedCompetitors: uniqueStrings(assessment.recommendedCompetitors ?? []).slice(0, 6), + recommendedCompetitors: uniqueStrings(assessment.recommendedCompetitors ?? []).slice(0, 10), } : {}), } @@ -508,7 +508,13 @@ function buildBatchAnalysisPrompt(ctx: { 'Return strict JSON with keys: assessments, whatThisMeans, recommendedActions.', 'Each assessment must include: phrase, provider, mentioned, describedAccurately, accuracyNotes, incorrectClaims, recommendedCompetitors.', 'describedAccurately must be one of: yes, no, unknown, not-mentioned.', - 'recommendedCompetitors should list actual competitor brands or domains named in the answer, not generic directories unless that is the only thing recommended.', + '', + 'CRITICAL — recommendedCompetitors extraction:', + 'For each response, extract EVERY specific company/brand/product name that the AI recommended or listed as an alternative.', + 'Include the company name exactly as it appears in the response (e.g. "Accenture", "Deloitte", "C3.ai").', + 'Do NOT include generic terms like "consulting firms" or directories like "G2" or "Clutch".', + 'Do NOT include the target company itself.', + 'This is the most important field — it shows the prospect who AI recommends INSTEAD of them.', '', `Target company: ${ctx.companyName}`, `Target domain: ${ctx.domain}`,