feat(llm-content-coverage): add LLM content coverage audit#2748
Open
anagarwa wants to merge 6 commits into
Open
feat(llm-content-coverage): add LLM content coverage audit#2748anagarwa wants to merge 6 commits into
anagarwa wants to merge 6 commits into
Conversation
Introduces a new audit type 'llm-content-coverage' that identifies topics where AI prompt volume is high but brand citations + mentions are low (the content coverage gap). Pipeline: 1. Fetches brand topics via PostgREST rpc_brand_presence_topics 2. Scores topics: gapScore = promptCount² / (promptCount + citations + mentions) 3. Takes top 10 candidates by gap score 4. Resolves topicHash via Semrush TopicService.brandTopics (UUID→uint64 bridge) 5. Fan-out gapPrompts(GAP_KIND: MISSING) for each top topic in parallel 6. Persists opportunity + suggestions via convertToOpportunity + syncSuggestions Also adds @quazar/ai-seo-ts (vendored protobuf), @connectrpc/connect, @connectrpc/connect-node, @bufbuild/protobuf, and @adobe/mysticat-shared-semrush-ai-client as dependencies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move all Semrush gRPC logic to @adobe/mysticat-shared-seo-client. Remove third-party/ai-seo-ts, @quazar/ai-seo-ts, @connectrpc/* and @bufbuild/protobuf deps — handler now imports only getGrpcClients, fetchTopicHashMap and fetchGapPrompts from the shared seo-client. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Proto files are now vendored inside mysticat-shared-seo-client, so the local copy in this repo is no longer needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…keyword detection Replaces Semrush PromptService gap-prompts enrichment with FanoutService resolveTopicMetrics. For each top-scored topic, identifies SERP keywords where the brand appears in rankings but at position > 5. Removes opportunity/suggestion persistence (detection only for now). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…stions post-audit Adds opportunityAndSuggestions post-processor that runs after the audit is persisted. Creates/updates the Opportunity with LLMO topic data and Semrush fanout results, then syncs one Suggestion per low-rank keyword identified. Fixes origin field required by OpportunityCollection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
llm-content-coverageaudit type that identifies topics where AI prompt volume is high but brand citation is lowrpc_brand_presence_topics(Mysticat PostgREST), scores each with a gap score (promptCount² / (promptCount + brandCitations + brandMentions)), and selects the top 10 candidatesOpportunitywith LLMO topic data + Semrush fanout results, and syncs oneSuggestionper low-rank keywordsrc/index.jsasllm-content-coverageDepends on
Must merge and publish
spacecat-shared#1776first — this PR importsgetGrpcClientsandfetchLowRankFanoutKeywordsfrom@adobe/mysticat-shared-seo-client.Test plan
c2473d89-e997-458d-a86d-b4096649c12b)topics+semrushTopicsindatafieldSEO_CLIENT_ID/SEO_CLIENT_SECRETloaded from Vault at pathbootstrapEnvironment/development/spacecat-services--audit-worker/anagarwaOpportunity data shape
{ "data": { "domain": "adobe.com", "topics": [{ "topic": "...", "promptCount": 41, "brandCitations": 0, "brandMentions": 66, "gapScore": 16 }], "semrushTopics": [{ "topic": "...", "matchedTopicName": "Generative AI", "similarityScore": 93, "keywords": [{ "keyword": "how to use generative ai", "volume": 480, "brandPosition": 6 }] }] } }🤖 Generated with Claude Code