Skip to content

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 context
  • url: Webpage URL for reference
  • content: Main text content to analyze
  • meta: Additional page metadata
  • project: Project context for relevance analysis (default: “general”)
  • word_count: Number of words in content

Returns:

  • ContentAnalysisResponse containing:
    • summary: Concise 2-3 sentence summary
    • key_points: List of 3-5 important points extracted
    • entities: List of significant entities mentioned
    • project_relevance: Analysis of relevance to project context
    • reading_time: Estimated reading time (e.g., “8 min read”)
    • content_type: Type of content analyzed (always “webpage”)
    • analysis_timestamp: When analysis was performed
    • word_count: Original content word count

Raises:

  • HTTPException 500: If AI analysis fails or content is invalid

Analysis Process:

  1. Calculate reading time (200 words per minute)
  2. Generate AI analysis prompt with context
  3. Execute via EnhancedChatHandler (Etherforce-managed)
  4. Parse AI response into structured format
  5. 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
}
ContentAnalysisRequest

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 context
  • url: The webpage URL for reference
  • content: The main text content to analyze
  • meta: Additional page metadata
  • project: Project context for relevance analysis
  • word_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
title
required
Title

Page title

string
url
required
Url

Page URL

string format: uri
>= 1 characters <= 2083 characters
content
required
Content

Page text content

string
meta

Page metadata

object
key
additional properties
any
project
Project

Project context

string
default: general
wordCount
Wordcount

Word count

integer
0

Successful Response

ContentAnalysisResponse

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 content
  • key_points: List of important points extracted
  • entities: List of important entities mentioned
  • project_relevance: Analysis of relevance to the project
  • reading_time: Estimated reading time
  • content_type: Type of content analyzed
  • analysis_timestamp: When the analysis was performed
  • word_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 webpage
  • tutorial: Step-by-step tutorial
  • documentation: Technical documentation
  • blog_post: Blog or article
  • research_paper: Academic or research content
  • news: 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
summary
Any of:
string
keyPoints
Keypoints

Extracted key points

Array<string>
entities
Entities

Important entities

Array<string>
projectRelevance
Any of:
string
readingTime
Any of:
string
contentType
Contenttype

Content type

string
default: webpage
analysisTimestamp
required
Analysistimestamp

Analysis timestamp

string
wordCount
required
Wordcount

Word count

integer

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object