Compile the Human Web into the Agent Web. Search it. Prove it. Act on it. Publish it.
Turn webpages, PDFs, and documents into agent-native objects β then index, search, answer with verifiable citations, synthesize callable APIs from UI actions, and help websites publish agent-friendly content.
agent-web-compiler
Compile βββΊ Index βββΊ Search βββΊ Prove βββΊ Act βββΊ Publish
ββββββββββ βββββββββ ββββββββββ βββββββββ βββββββ ββββββββββ
β8-stage β βBM25 + β βQuery β βBlock β βStateβ βllms.txtβ
βpipelineβ βdense β βplanningβ βlevel β βgraphβ βagent β
β14 blockβ βhybrid β βGroundedβ βcites +β βAPI β βcontent β
β8 actionβ β4-levelβ βanswers β βtraces β βsynthβ βactions β
βtypes β βindex β βExec β βsnaps β βexec β βsitemap β
ββββββββββ βββββββββ βplans β βββββββββ βββββββ ββββββββββ
ββββββββββ
1,279 tests Β· 77 modules Β· 40K LOC Β· Across 15 webpages: 27% fewer tokens, 377 actions discovered, block-level citations β no LLM needed.
pip install agent-web-compilerfrom agent_web_compiler import AgentSearch
search = AgentSearch()
search.ingest_url("https://docs.example.com/api")
answer = search.answer("What authentication methods are supported?")
print(answer.to_markdown())
# **Answer**: Bearer token and OAuth 2.0. [1][2]
# [1] "Include your API key in the Authorization header..."
# [2] "OAuth 2.0 flow requires client_id and client_secret..."from agent_web_compiler import ProvenanceEngine
provenance = ProvenanceEngine()
result = provenance.answer_with_provenance(search, "What is the rate limit?")
# β answer + citations (block + DOM + bbox) + evidence + decision trace + snapshotsfrom agent_web_compiler.actiongraph import ActionGraphBuilder, APISynthesizer, HybridExecutor
doc = search.ingest_url("https://example.com/products")
graph = ActionGraphBuilder().build_from_document(doc) # page state machine
apis = APISynthesizer().synthesize_from_document(doc) # pseudo-API candidates
decisions = HybridExecutor().decide_all(doc, apis) # API-first, browser-fallbackfrom agent_web_compiler import SiteMemory
memory = SiteMemory()
memory.observe(doc1); memory.observe(doc2); memory.observe(doc3)
insight = memory.get_insight("example.com")
# β templates, noise selectors, entry points, common actions, nav patternsfrom agent_web_compiler import SitePublisher
publisher = SitePublisher(site_name="My Docs", site_url="https://docs.example.com")
publisher.crawl_site("https://docs.example.com/", max_pages=50)
publisher.generate_all("output/")
# β llms.txt, agent.json, content.json, actions.json, agent-sitemap.xml, agent-feed.jsonDrive a real browser with browser-harness (new)
AWC ships a bridge to browser-harness β a minimal CDP helper that attaches to the user's already-running Chrome. This unlocks three things the default pipeline can't do alone:
- Fetch pages from your logged-in session β SaaS, LinkedIn, Gmail all Just Work; no stale-cookie dance.
- Close the loop from compile β plan β act β
LiveRuntimeturns a URL + a natural-language task into real clicks, with every step producing anEvidencerecord. - Auto-generate BH domain-skills β compile a site once, emit a
PR-ready
agent-workspace/domain-skills/<site>/<task>.md.
pip install "agent-web-compiler[harness]"
# and follow the BH setup prompt:
# https://github.com/browser-use/browser-harness#setup-prompt# Fetch using your real Chrome
from agent_web_compiler import compile_url
doc = compile_url("https://app.linkedin.com/in/me", fetcher="browser_harness")
# Compile β plan β act, all in one shot
from agent_web_compiler import LiveRuntime
rt = LiveRuntime.from_url("https://github.com/browser-use/browser-harness")
outcome = rt.run("star the repository", max_actions=1)
# β outcome.evidence is an Evidence record with screenshot + transition
# Contribute a BH skill back upstream
from agent_web_compiler import DomainSkillPublisher
skill = DomainSkillPublisher().generate_from_document(doc, task="scraping")
skill.write_to_repo("~/code/browser-harness")
# β agent-workspace/domain-skills/linkedin/scraping.md, ready for a PR# CLI equivalents
awc compile https://app.linkedin.com/in/me --fetcher browser_harness
awc live "reply to Alice" --on https://app.linkedin.com/messaging
awc publish bh-skill https://docs.stripe.com/api --out ~/code/browser-harnessSee docs/integration-with-browser-harness.md
for the full design doc and docs/fetchers/browser-harness.md
for the fetcher reference.
from agent_web_compiler import compile_url
doc = compile_url("https://example.com")from agent_web_compiler import PipelineBuilder
pipeline = PipelineBuilder().skip_actions().skip_salience().build()
doc = pipeline.compile(html) # 0.45ms β 93x faster# Compile
awc compile https://example.com -o output/
# Index + Search
awc index crawl https://docs.example.com/ --max-pages 50
awc search "rate limit" && awc answer "How to auth?" && awc plan "download PDF"
# Provenance
awc provenance cite "What is the refund policy?"
# Publish
awc publish site https://docs.example.com/ -o output/
# Memory
awc memory show example.com
# Interactive
awc interactive
# Serve
awc serve --transport mcp # 10 MCP tools
awc serve --transport rest # 7 REST endpoints14 block types Β· 8 action types Β· provenance Β· entities Β· nav graph Β· 17 extension points via PipelineBuilder Β· HTML/PDF/DOCX/JSON/Playwright
BM25 + dense hybrid Β· pluggable embeddings (TF-IDF built-in, OpenAI optional) Β· 4-level indexing Β· query planning (fact/evidence/navigation/task) Β· grounded answering Β· execution planning Β· site crawling
Evidence objects (block/action/DOM/bbox/screenshot) Β· citations with answer-span alignment Β· page snapshots (version-bound) Β· decision traces (queryβretrieveβrerankβanswer) Β· reproducibility
Page state machine β model pages as states with typed transitions (navigate/expand/filter/submit/download) API candidate synthesis β find machine-callable endpoints behind UI actions (search formsβGET API, paginationβparameterized URLs) Hybrid execution β API-first when safe and confident, browser-fallback otherwise Risk assessment β read_only/write/auth_required safety levels
Cross-page learning β templates, noise selectors, entry points, hub pages, action habits Navigation patterns β frequently-traversed URL sequences Persistent β save/load site insights across sessions Improves over time β 3+ pages triggers pattern detection
llms.txt Β· agent.json Β· content.json Β· actions.json Β· agent-sitemap.xml Β· agent-feed.json (delta) Β· auto-generated from existing content
OpenAI CUA Β· Claude Computer Use Β· Browser Use Β· LangChain Β· 5 LLM formatters Β· MCP (10 tools) Β· REST (7 endpoints) Β· REPL Β· browser middleware
from agent_web_compiler.adapters.openai_adapter import OpenAIAdapter # CUA
from agent_web_compiler.adapters.anthropic_adapter import AnthropicAdapter # Claude
from agent_web_compiler.middleware.browser_middleware import BrowserMiddleware
from agent_web_compiler.exporters.llm_formatters import format_for_llm # 5 formatsMCP: compile_url compile_html compile_file get_blocks get_actions get_markdown ingest_url search answer plan
| Capability | Raw HTML | MD Scraper | agent-web-compiler |
|---|---|---|---|
| Tokens | Baseline | -27% | -27% + structured |
| Semantic blocks | β | β | 14 types |
| Actions | 0 | 0 | 377 across 15 pages |
| Grounded answers | β | β | Block-level citations |
| Evidence chain | β | β | DOM + bbox + snapshot + trace |
| API synthesis | β | β | Pseudo-API from UI actions |
| Site memory | β | β | Cross-page pattern learning |
| Publish for agents | β | β | 6 standardized files |
24 packages Β· 78+ modules:
agent_web_compiler/
βββ core/ Schemas, interfaces, errors (7)
βββ pipeline/ Compilers + cache + extensible builder (8)
βββ sources/ HTTP, Playwright, browser-harness, file reader, crawler (5)
βββ normalizers/ Boilerplate removal, site profiles (2)
βββ segmenters/ Blocking, salience, query filter (3)
βββ extractors/ Actions, entities, assets, nav graph (4)
βββ aligners/ DOM + screenshot provenance (2)
βββ exporters/ JSON, markdown, token budget, LLM formatters (5)
βββ index/ BM25 + dense engine, embeddings (4)
βββ search/ Planner, retriever, answerer, runtime, SDK (5)
βββ provenance/ Evidence, citations, snapshots, traces, engine (5)
βββ actiongraph/ State machine, API synthesis, hybrid executor (4)
βββ memory/ Site-level learning across visits (1)
βββ publisher/ llms.txt, agent/content/actions.json, sitemap, feed,
β bh-skill markdown (7)
βββ runtime/ Live execution backends (optional extras)
β βββ browser_harness/ LiveActionExecutor, LiveRuntime, evidence_adapter
βββ adapters/ OpenAI, Anthropic, Browser Use, LangChain (4)
βββ middleware/ Browser agent middleware (1)
βββ plugins/ Registry + protocols (2)
βββ standards/ agent.json spec (1)
βββ serving/ MCP server, REST API (2)
βββ cli/ CLI + REPL (2)
βββ utils/ Text, DOM, doc diff (3)
pip install agent-web-compiler # Core
pip install "agent-web-compiler[pdf]" # + PDF
pip install "agent-web-compiler[browser]" # + Playwright (isolated Chromium)
pip install "agent-web-compiler[harness]" # + browser-harness (your real Chrome)
pip install "agent-web-compiler[serve]" # + MCP + REST
pip install "agent-web-compiler[all]" # EverythingPython 3.9+ Β· From source: pip install -e ".[dev]" && pytest (1,279 tests, ~4s, offline)
Architecture Β· Schema Β· Provenance Β· Publisher Β· Contributing Β· Roadmap Β· Changelog
| Project | AWC adds / integration |
|---|---|
| Firecrawl | Search, provenance, API synthesis, publish |
| Jina Reader | Typed blocks, action graph, evidence chains |
| Docling | Web + search + provenance + publish in one stack |
| Browser Use | Pre-compiled affordances, API-first execution, site memory |
| browser-harness | First-class bridge: fetch via real Chrome, LiveRuntime execution, auto-generated domain-skills |
| llms.txt | Full agent manifest + actions + delta feeds |
agent-web-compiler β compile β index β search β prove β act β publish β for the Agent Web.