Skip to Content

Web Automation

Intelligent web processing microservice with crawling, search, and automation.

Overview

Web Services provides four core capabilities:

FeatureDescriptionTest Status
Web CrawlingMulti-format content extraction✅ 100%
Web SearchMulti-engine with AI summaries✅ 100%
Deep SearchMulti-strategy RAG search✅ 100%
Web AutomationLLM-driven browser control✅ 100%

Architecture

┌─────────────────────────────────────────────────────────────┐ │ Layer 4: Services │ │ - WebAutomationService - WebCrawlService - WebSearchService│ └─────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────────┐ │ Layer 3: Core │ │ - BrowserService - PageAnalyzer - ActionCoordinator │ └─────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────────┐ │ Layer 2: Engines │ │ - ExtractionEngine - DetectionEngine - ActionEngine │ └─────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────────┐ │ Layer 1: Strategies │ │ - Detection: interactive_extractor │ │ - Extraction: readability, jina_reader │ │ - Actions: click, type, navigate, wait │ │ - Search: brave_search, parallel_search │ └─────────────────────────────────────────────────────────────┘

Web Crawling

Extract content from web pages in multiple formats.

Endpoint

POST /api/v1/crawl

Request

{ "url": "https://example.com", "output_format": "markdown", "extract_links": true, "extract_images": true }

Output Formats

FormatDescription
markdownClean markdown text
textPlain text
htmlRaw HTML
structuredStructured data with metadata

Example

async def crawl_page(url: str): async with httpx.AsyncClient() as client: response = await client.post( "http://localhost:8000/api/v1/crawl", json={ "url": url, "output_format": "markdown", "extract_links": True } ) return response.json()

Search the web with AI-powered summaries.

Endpoint

POST /api/v1/search

Request

{ "query": "Python async programming", "freshness": "week", "count": 10, "goggle": "tech", "summarize": true }

Freshness Options

OptionDescription
hourLast hour
dayLast 24 hours
weekLast 7 days
monthLast 30 days
yearLast year

Goggle Modes

ModeDescription
academicAcademic sources
newsNews sources
techTechnical resources

Multi-strategy search with RAG capabilities.

Endpoint

POST /api/v1/deep-search

Request

{ "query": "How to implement async generators in Python", "max_iterations": 3, "rag_mode": "auto" }

Query Types

TypeDescription
TECHNICALTechnical docs, programming
ACADEMICResearch papers, studies
LOCALLocal businesses, places
NEWSCurrent events
PRODUCTProduct comparisons

RAG Modes

ModeDescription
naiveSimple retrieval
cragCorrective RAG
self_ragSelf-reflective RAG
autoAutomatic selection

Web Automation

LLM-driven browser automation.

Endpoint

POST /api/v1/automation/execute

Request

{ "url": "https://example.com", "task": "Search for 'Python tutorials' and click the first result", "mode": "intelligent" }

Modes

ModeDescriptionLLM Cost
dom_onlyPure DOM extractionZero
dom_firstDOM with LLM fallbackLow
intelligentFull LLM planningHigher

Supported Actions

ActionDescription
clickClick element
typeType text
navigateGo to URL
waitWait for condition
screenshotCapture screen
extractExtract data

Example

async def automate_task(url: str, task: str): async with httpx.AsyncClient() as client: response = await client.post( "http://localhost:8000/api/v1/automation/execute", json={ "url": url, "task": task, "mode": "intelligent" } ) return response.json() # Example: Login flow result = await automate_task( "https://example.com/login", "Fill in username 'test@example.com' and password 'password123', then click submit" )

Screenshots

Endpoint

POST /api/v1/screenshot

Request

{ "url": "https://example.com", "full_page": true, "format": "png" }

Integration with MCP

@mcp.tool() async def web_crawl(url: str, format: str = "markdown"): """Crawl webpage and extract content""" async with httpx.AsyncClient() as client: response = await client.post( "http://localhost:8000/api/v1/crawl", json={"url": url, "output_format": format} ) return response.json() @mcp.tool() async def web_search(query: str, count: int = 5): """Search the web""" async with httpx.AsyncClient() as client: response = await client.post( "http://localhost:8000/api/v1/search", json={"query": query, "count": count} ) return response.json() @mcp.tool() async def browser_automate(url: str, task: str): """Automate browser task""" async with httpx.AsyncClient() as client: response = await client.post( "http://localhost:8000/api/v1/automation/execute", json={"url": url, "task": task} ) return response.json()

Configuration

Environment Variables

VariableDescription
BRAVE_API_KEYBrave Search API key
BROWSERBASE_API_KEYBrowserbase API key
OPENAI_API_KEYOpenAI for LLM automation

Next Steps