How romek-rozen/intent-labeler works
Intent Labeler turns a Google SERP or supplied pages into intent labels, measured coverage and traffic shares, and a recommended content form. The main flow gathers and enriches page data, asks an LLM to group results, computes metrics in code, decides the expected form, and renders JSON or reports. The API and CLI are product entry points; the browser playground is also documented. Source excerpts establish the API and pipeline calls; some unsampled module relationships are omitted where the available evidence does not establish the invocation.
Main entry points: app.py HTTP API · pipeline.py Analysis orchestration · dataforseo.py SERP retrieval · labeler.py Intent labeling
Components 25
Entry points
- Command-line interface
src/intent_labeler/cli.py - HTTP API
src/intent_labeler/api/app.py - Browser playground
site/app.js
Inputs and enrichment
- SERP retrieval
src/intent_labeler/features/serp_source/dataforseo.py - SERP normalization
src/intent_labeler/features/serp_source/normalize.py - Page fetching
src/intent_labeler/features/page_source/fetch.py - Page extraction
src/intent_labeler/features/page_source/extract.py - Search demand
src/intent_labeler/features/search_volume/dataforseo.py - Seasonality
src/intent_labeler/features/search_volume/seasonality.py - Traffic estimates
src/intent_labeler/features/traffic/dataforseo.py
Intent analysis
- Analysis orchestration
src/intent_labeler/pipeline.py - Intent labeling
src/intent_labeler/features/intent_labeling/labeler.py - Label contract
src/intent_labeler/features/intent_labeling/contract.py - Code-based metrics
src/intent_labeler/features/metrics/measure.py - Content-form decision
src/intent_labeler/features/form_decision/decide.py
Results and reports
- HTML report
src/intent_labeler/features/report/html.py - Markdown report
src/intent_labeler/features/report/markdown.py - SVG charts
src/intent_labeler/features/report/charts.py - Report palette
src/intent_labeler/features/report/palette.py
Shared runtime
- LLM client and cache
src/intent_labeler/core/llm.py - Snapshot and result types
src/intent_labeler/core/types.py - LLM configuration
src/intent_labeler/core/config.py
Other components
- Analyst
- DataForSEO
- OpenAI-compatible model
Connections 29
- Analyst → Command-line interface: runs analysis
README.md - Analyst → HTTP API: submits requests
- Analyst → Browser playground: uses playground
README.md - Command-line interface → Analysis orchestration: runs pipeline
src/intent_labeler/cli.py - HTTP API → SERP retrieval: fetches results
src/intent_labeler/api/app.py - SERP retrieval → DataForSEO: queries SERP
- HTTP API → Search demand: adds demand
src/intent_labeler/api/app.py - Search demand → DataForSEO: queries volume
- HTTP API → Traffic estimates: adds estimates
src/intent_labeler/api/app.py - Traffic estimates → DataForSEO: queries traffic
- SERP retrieval → SERP normalization: normalizes response
src/intent_labeler/features/serp_source/dataforseo.py - HTTP API → Analysis orchestration: runs analysis
src/intent_labeler/api/app.py - HTTP API → Page fetching: builds page snapshot
src/intent_labeler/api/app.py - Analysis orchestration → Page fetching: enriches pages
src/intent_labeler/pipeline.py - Page fetching → Page extraction: extracts page data
src/intent_labeler/features/page_source/fetch.py - Analysis orchestration → Intent labeling: labels results
src/intent_labeler/pipeline.py - Intent labeling → Label contract: validates labels
src/intent_labeler/features/intent_labeling/labeler.py - Intent labeling → LLM client and cache: requests JSON labels
src/intent_labeler/features/intent_labeling/labeler.py - LLM client and cache → LLM configuration: uses settings
src/intent_labeler/core/llm.py - LLM client and cache → OpenAI-compatible model: sends chat request
src/intent_labeler/core/llm.py - Analysis orchestration → Code-based metrics: measures results
src/intent_labeler/pipeline.py - Analysis orchestration → Content-form decision: decides content form
src/intent_labeler/pipeline.py - Analysis orchestration → Seasonality: computes seasonality
src/intent_labeler/pipeline.py - Analysis orchestration → Snapshot and result types: accepts snapshot
src/intent_labeler/pipeline.py - HTTP API → HTML report: renders HTML
src/intent_labeler/api/app.py - HTTP API → Markdown report: renders Markdown
src/intent_labeler/api/app.py - HTML report → SVG charts: embeds charts
src/intent_labeler/features/report/html.py - HTML report → Report palette: uses colors
src/intent_labeler/features/report/html.py - SVG charts → Report palette: uses palette
src/intent_labeler/features/report/charts.py