Analyze browser content
POST /api/browser/analyze-content
Perform comprehensive AI analysis of browser content with structured insights.
Uses EnhancedChatHandler (via Etherforce) to perform deep AI analysis of webpage content, extracting concise summaries, key points, important entities, and project relevance assessment. Includes automatic reading time calculation.
Request Body:
title: Page title for contexturl: Webpage URL for referencecontent: Main text content to analyzemeta: Additional page metadataproject: Project context for relevance analysis (default: “general”)word_count: Number of words in content
Returns:
- ContentAnalysisResponse containing:
summary: Concise 2-3 sentence summarykey_points: List of 3-5 important points extractedentities: List of significant entities mentionedproject_relevance: Analysis of relevance to project contextreading_time: Estimated reading time (e.g., “8 min read”)content_type: Type of content analyzed (always “webpage”)analysis_timestamp: When analysis was performedword_count: Original content word count
Raises:
HTTPException 500: If AI analysis fails or content is invalid
Analysis Process:
- Calculate reading time (200 words per minute)
- Generate AI analysis prompt with context
- Execute via EnhancedChatHandler (Etherforce-managed)
- Parse AI response into structured format
- Return structured analysis results
Example Request:
{
"title": "Introduction to Vector Databases",
"url": "https://example.com/vector-db-intro",
"content": "Vector databases enable semantic search...",
"meta": {"author": "John Doe"},
"project": "research",
"word_count": 1500
}
Example Response:
{
"summary": "Vector databases enable semantic search using embeddings.",
"key_points": [
"Enables semantic search beyond keyword matching",
"Uses embeddings for similarity calculations",
"Optimized for AI and ML applications"
],
"entities": ["vector databases", "embeddings", "semantic search"],
"project_relevance": "Highly relevant for research project on modern data storage",
"reading_time": "8 min read",
"content_type": "webpage",
"analysis_timestamp": "2024-12-18T10:30:00",
"word_count": 1500
}Request Body required
Section titled “Request Body required ”Request model for detailed AI-powered content analysis.
Used for performing AI-powered analysis of webpage content to extract insights, entities, key points, and project relevance scoring.
Fields:
title: The page title for contexturl: The webpage URL for referencecontent: The main text content to analyzemeta: Additional page metadataproject: Project context for relevance analysisword_count: Number of words in the content
Analysis Capabilities:
- Extractive summarization (key points)
- Named Entity Recognition (people, places, organizations)
- Project relevance scoring (how useful for current project)
- Reading time estimation
- Content type classification (tutorial, documentation, blog, etc.)
Usage: POST /api/browser/analyze for deep content analysis.
JSON Example:
{
"title": "React Performance Optimization",
"url": "https://example.com/react-perf",
"content": "React performance can be improved using...",
"meta": {"author": "React Team"},
"project": "ishvana_frontend",
"wordCount": 2000
}
Integration:
- AI Service: Performs content analysis using LLM
- Entity Extraction: Identifies important entities
- Relevance Scorer: Calculates project relevance
- Frontend: Displays analysis results
object
Page title
Page URL
Page text content
Page metadata
object
Project context
Word count
Responses
Section titled “ Responses ”Successful Response
Response model for content analysis results.
Contains the structured results of AI-powered content analysis including summary, key points, entities, and relevance scoring.
Fields:
summary: Concise summary of the contentkey_points: List of important points extractedentities: List of important entities mentionedproject_relevance: Analysis of relevance to the projectreading_time: Estimated reading timecontent_type: Type of content analyzedanalysis_timestamp: When the analysis was performedword_count: Number of words in the original content
Summary Format: 2-3 sentence concise summary capturing main points and purpose.
Key Points Format: Bullet-point style extractive summary (5-10 points for long content).
Entities Examples:
React,TypeScript,Webpack(technologies)Facebook,Microsoft(organizations)Dan Abramov,Kent C. Dodds(people)
Project Relevance: Explanation of why content is useful for the current project with specific use case recommendations.
Reading Time: Human-readable format: “5 minutes”, “15 minutes”, “1 hour”
Content Types:
webpage: General webpagetutorial: Step-by-step tutorialdocumentation: Technical documentationblog_post: Blog or articleresearch_paper: Academic or research contentnews: News article
Usage: Returned from POST /api/browser/analyze endpoint.
JSON Example:
{
"summary": "Guide to optimizing React performance using memoization and virtualization",
"keyPoints": [
"Use React.memo for expensive components",
"Implement virtualization for long lists",
"Optimize re-renders with useMemo"
],
"entities": ["React", "useMemo", "React.memo", "virtualization"],
"projectRelevance": "Directly applicable to Ishvana frontend optimization",
"readingTime": "8 minutes",
"contentType": "tutorial",
"analysisTimestamp": "2024-12-20T10:30:00Z",
"wordCount": 2000
}object
Extracted key points
Important entities
Content type
Analysis timestamp
Word count
Validation Error