Skip to content

Perceive Webpage Stream

POST
/api/agents/perceive/webpage/stream

Streaming webpage perception — NDJSON events from start → complete / error.

Each line of the response body is a JSON-encoded PerceptionStreamEvent. Events: start, one chunk per Lagan message, extract_start, then terminal complete (with the full WebpagePerceptionResponse) or error. Mirrors the /chat/stream pattern so the UI can observe client disconnects and abort cleanly.

WebpagePerceptionRequest

Request model for comprehensive webpage perception analysis.

Analyzes webpage content to extract entities, relationships, sentiment, and strategic insights using Lagan’s perception engine. Supports configurable analysis depth from surface-level scanning to deep prophetic insights.

Fields:

  • url: URL of the webpage to analyze (required, must be valid HTTP/HTTPS)
  • depth: Analysis depth level controlling thoroughness and insight depth
  • extract_entities: Whether to perform named entity recognition
  • analyze_sentiment: Whether to perform sentiment analysis
  • map_relationships: Whether to map entity relationships

Depth Levels:

  • surface: Quick scan, basic structure extraction
  • analytical: Detailed analysis with entity extraction
  • strategic: In-depth strategic insights and patterns
  • prophetic: Deep analysis with predictive insights

Usage: Used by perception routes to analyze webpage content for knowledge extraction.

Integration:

  • PerceptionRoutes: Request validation for /perception/webpage endpoint
  • LaganAgent: Web perception tool configuration
  • Frontend: Perception analysis request forms
object
url
required
Url

URL of the webpage to analyze

string format: uri
>= 1 characters <= 2083 characters
Example
https://example.com/article
depth
Depth

Analysis depth level (surface, analytical, strategic, prophetic)

string
default: analytical
Allowed values: surface analytical strategic prophetic
extractEntities
Extractentities

Whether to extract entities from content

boolean
default: true
analyzeSentiment
Analyzesentiment

Whether to perform sentiment analysis

boolean
default: true
mapRelationships
Maprelationships

Whether to map entity relationships

boolean
default: true

Successful Response

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