Overview
The analysis types module defines the core data structures for analyzing brand presence in AI-generated responses. These types power OneGlance’s ability to evaluate brand visibility, sentiment, positioning, and competitive landscape across multiple AI models.AnalysisFilters
Filter parameters for querying analysis data.Filter by specific AI model provider (e.g., “chatgpt”, “claude”)
Time range filter: all time, last 7 days, 14 days, or 30 days
Filter to a specific prompt for detail view
Usage
packages/utils/src/analysis/filterAnalysisRecords.ts:4
AnalysisInputSingle
Input parameters for analyzing a single AI response.The domain of the brand being analyzed (e.g., “oneglance.ai”)
The name of the brand being analyzed
The AI-generated response text to analyze
The original prompt that generated the response
Usage
packages/services/src/analysis/runAnalysis.ts:2
BrandAnalysisResult
Comprehensive analysis result evaluating a brand’s presence and perception in an AI-generated response.Core Sections
Metadata
Optional contextual information populated by application code
Name of the analyzed brand
Domain of the analyzed brand
The prompt that generated the response
Unique identifier for the prompt
ISO 8601 timestamp of when the analysis was performed
GEO Score
The headline composite score (0-100) indicating overall brand performance.Composite score from 0-100 representing overall brand performance
Human-readable verdict explaining the score
Presence
Measures if and how prominently the brand appears in the response.Whether the brand was mentioned at all
Number of times the brand was mentioned
Visibility score (0-100)
Level of prominence:
dominant, significant, moderate, minor, passing, or absentWhere the brand first appears:
top, middle, bottom, or absentPosition
Tracks the brand’s ranking within the response.Numerical rank (1 = first place, null if not ranked)
Total number of brands ranked in the response
Whether the brand is the #1 recommendation
Whether the brand is in the top 3 recommendations
Additional context about the ranking
Sentiment
Evaluates how favorably the brand is portrayed.Sentiment score (-100 to 100)
Categorical label:
very_negative, negative, neutral, positive, or very_positiveArray of positive mentions or attributes
Array of negative mentions or criticisms
Recommendation
Indicates how strongly the AI recommends the brand.Recommendation strength:
top_pick, strong_alternative, conditional, mentioned_only, discouraged, or not_mentionedUse cases or scenarios where the brand is recommended
Limitations or conditions mentioned
Competitors
Competitive landscape analysis.Array of competitor analysis objects
Competitor brand name
Competitor domain
Competitor’s visibility score
Competitor’s sentiment score
Competitor’s rank position (null if not ranked)
Whether the competitor is actively recommended
Brands this competitor is positioned above
Brands this competitor is positioned below
Perception
How the brand is characterized and positioned.Main claims made about the brand
Unique features or advantages highlighted
Primary association or specialty
Price positioning:
premium, mid_range, budget, free, or not_mentionedRisks
Issues that need attention.Whether any risks were identified
Array of risk items
Risk category:
outdated_info, factual_error, brand_confusion, negative_association, or missing_from_responseRisk severity:
critical, warning, or infoDetailed description of the risk
Actions
Recommended next steps for the brand.Array of actionable recommendations
Priority level:
critical, high, medium, or lowThe recommended action to take
Usage Example
packages/services/src/analysis/runAnalysis.ts:8- Analysis generationpackages/services/src/analysis/fetchAnalysedPrompts.ts:4- Data retrievalapps/web/src/app/(auth)/dashboard/_hooks/use-dashboard-data.ts:1- Dashboard data processing
AnalysisModelInput
Input structure for model-specific analysis.The AI model provider identifier (e.g., “chatgpt”, “claude”)
The response text from the model
Usage
PromptAnalysis
Database representation of a prompt analysis stored in ClickHouse.Unique identifier for the analysis record
References the prompt that was analyzed
Workspace context identifier
User who created the prompt
AI model provider that generated the response
The original prompt text (stored for convenience)
Complete
BrandAnalysisResult serialized as JSON stringISO 8601 timestamp when the prompt was executed
ISO 8601 timestamp when the analysis was created
Usage
This type represents the persisted structure in ClickHouse:AnalysisRecord
Flattened analysis record structure optimized for filtering and display.Unique record identifier
References the prompt
When the prompt was executed
The prompt text
User identifier
Workspace identifier
AI model provider name
The AI-generated response text
Array of sources cited in the response
Parsed analysis object (only present if analyzed)
True if the record has been analyzed, false if it’s a raw response
ISO 8601 timestamp of record creation
Usage
packages/utils/src/export/buildAnalysisCsvRow.ts:1- CSV export functionalitypackages/utils/src/analysis/filterAnalysisRecords.ts:1- Filtering operationsapps/web/src/app/(auth)/prompts/page.tsx:5- Prompts page displayapps/web/src/app/(auth)/dashboard/page.tsx:5- Dashboard displayapps/web/src/app/(auth)/dashboard/_hooks/use-dashboard-data.ts:1- Data hooks
AnalysisMetadata
Metadata about available filters in the analysis dataset.List of brands that have analysis data
Brand name
Brand website URL
List of AI model providers with available data
Usage
AnalysisResponse
Complete response object containing analysis records and metadata.Array of analysis records
Metadata about available filters and options
Usage
AnalysisRow
Legacy analysis row structure with brand metrics.Unique row identifier
Associated prompt ID
Prompt execution timestamp
User identifier
Workspace identifier
AI model provider
AI response text
Brand metrics as JSON string or parsed object. See
BrandMetricMap in metrics types.Source citations
Record creation timestamp
Related Types
- Agent Types - Provider types and agent results
- Entity Types - Competitor input structures