# The Missing Layer in Agentic AI — Giedrius Šteimantas, Oxylabs

Giedrius Šteimantas, Oxylabs

AI Engineer World's Fair 2026

[Talk page](https://ai.engineer/talks/XsvUhpnHepE-missing-layer-in-agentic-ai) · [Video](https://www.youtube.com/watch?v=XsvUhpnHepE)

## The Missing Layer in Agentic AI

Giedrius Šteimantas walks through a shopping agent’s redesign: search for candidates, validate product content before spending model tokens, ask the user to approve, and reserve browser automation for checkout.

### A personal shopper meets the open web

[0:13](https://www.youtube.com/watch?v=XsvUhpnHepE&t=13s)

The shopping chatbot could discuss a customer’s style and turn their preferences into prompts. A second agent was supposed to take those prompts, find suitable items online, and purchase them. Getting from a plausible recommendation to an actual product page proved harder: requests often returned CAPTCHAs, and browser automation throughout the workflow made the product slow, expensive, and unreliable.

Giedrius Šteimantas of Oxylabs introduces this friend’s project as an example of the infrastructure layer agents need to work on the open web. Oxylabs had spent ten years helping companies obtain data, including companies training large language models. The same web-access infrastructure could now support agents.

The redesign starts with three scraping principles:

- **Use a browser selectively.** Pay for browser execution when the task requires it.
- **Validate content.** HTTP `200` means the request received a successful response; it does not establish that the response contains the requested product page.
- **Send lighter content.** JavaScript, CSS, and HTML can contribute many bytes without helping the model choose a product.

The operating constraint behind these choices is simple: “cost matters.”

### Discovery: search for candidates without opening every store

[3:56](https://www.youtube.com/watch?v=XsvUhpnHepE&t=236s)

The workflow separates four jobs. Discovery finds product URLs. Decision checks whether the products have the right price, stock, description, and details. The user accepts or rejects the proposed purchase. Execution makes the purchase. Keeping these jobs separate allows each web-access step to use a tool suited to what it actually needs to accomplish.

Originally, discovery opened the search pages of a predefined list of major retailers in an automated browser. Sites challenged or blocked that browser, interrupting the flow. Retries added time and expense without guaranteeing access, making the final cost per transaction difficult to predict. The fixed retailer list also constrained the agent’s choices to stores its developer had selected.

Heavy JavaScript made those searches costly even when they succeeded. Location introduced another failure: an item could appear available early in the workflow and become unavailable at checkout. Retailers can show different stock, sizes, and options depending on the user’s location, and the original discovery stage lacked geolocation controls. A usable listing therefore needed more than a product match; its availability had to apply to the customer’s region.

The replacement, **Fast Search API**, gives the agent search results as compact JSON. The agent formulates fan-out queries—several searches for the shopping task—and selects relevant URLs from the results. Search engines supply the indexed candidates, removing the need to navigate each retailer’s search interface or restrict discovery to a hardcoded list.

Šteimantas reports responses below 2,000 tokens and average response times below 700 milliseconds, alongside high success rates and predictable low pricing. These are reported service characteristics rather than a controlled comparison of the two shopping agents. Small responses also reduce the need for a complicated model at this stage: the immediate job is to select promising links, with detailed product verification still to come.

### Decision: validate the page before the model reads it

[8:06](https://www.youtube.com/watch?v=XsvUhpnHepE&t=486s)

Selected URLs now need inspection. The decision stage reads the product pages to confirm price, stock, description, and other details before choosing an item. The original agent ran many browsers in parallel to accelerate this work. Parallelism helped with speed, but it could not make blocked pages useful. Failed access left the agent with few options and excluded many popular retailers.

Observability let the friend notice these failures. Other implementations can miss them by checking only response size and HTTP status before sending the HTML to an LLM. A substantial CAPTCHA page can pass both checks. The model may recognize it as invalid product content, but the application has already spent tokens to find that out.

Consider the talk’s concrete example: ten attempted pages return three valid product pages and seven invalid responses, yet all ten go to the model. Šteimantas estimates that this wastes 70% of the tokens. Seven out of ten establishes the fraction of invalid responses; the token fraction also depends on their lengths. The practical failure is the same: blocked content consumes model input while supplying no products to compare.

Compression initially looked like the fix. Smaller HTML would cost fewer tokens. But compressing a CAPTCHA still leaves a CAPTCHA, so validation has to come first. Once a blocked response becomes an explicit retrieval error, the application can exclude it before inference. Better retrieval can expand the usable choice set; filtering keeps unsuccessful retrievals from becoming model work.

Where does the wasted model work disappear? The diagram follows the ten-response example through the original path, then shows the redesigned routing. Previously, valid and blocked pages traveled together into the model. The new service sends useful content onward and reports blocks separately. Validation changes which data reaches inference, rather than merely shortening every response.

Blocked responses stop before inference
The original ten-response example sends seven invalid pages to the model. The redesign separates retrieval errors from product content without assuming that the new service has the same success count.
- Ten responses — Three valid product pages and seven invalid responses.
- Model reads all ten — Tokens are spent recognizing CAPTCHAs as well as comparing products.
- Web Scraper API — Retrieves content and reports CAPTCHAs or other blocks as explicit errors.
- Valid product content — Markdown can replace raw HTML as model input.
- Explicit retrieval error — The application excludes the blocked response from model input.
- Model compares products — Product content reaches the decision stage without known blocked responses.
- Ten responses → Model reads all ten (Send valid and invalid HTML)
- Web Scraper API → Valid product content (Successful retrieval)
- Web Scraper API → Explicit retrieval error (CAPTCHA or other block)
- Valid product content → Model compares products (Send product content)

### Move retrieval complexity behind an extraction service

[10:23](https://www.youtube.com/watch?v=XsvUhpnHepE&t=623s)

The rebuilt decision stage uses **Oxylabs Web Scraper API** through a lightweight REST interface. Explicit errors establish which responses should stay out of the LLM call. The service then addresses several other costs independently:

- **Concurrent requests:** Hundreds of requests can run in parallel without the shopping application orchestrating a browser for each one.
- **Markdown output:** Product content can reach the model in a lighter form than raw HTML.
- **Dynamic rendering:** When a site requires it, the service runs a full browser internally to render the content.
- **Geolocation:** Requests can retrieve localized product information, including the regional context relevant to availability.
- **Successful-result billing:** Under the described pricing model, failed scraper requests incur no scraper charge.

A browser may still perform some retrieval work. The important change is that the application calls an extraction service, and that service handles rendering when needed. This preserves access to dynamic pages while removing browser management from the agent’s ordinary product-reading step. Failure also becomes a visible outcome with a clear billing rule: “No cure, no pay.”

### Checkout: keep the browser and align its location

[11:54](https://www.youtube.com/watch?v=XsvUhpnHepE&t=714s)

With product information available, the agent presents its choice to the user. Only an affirmative answer starts the purchase stage. Here the browser earns its cost: checkout requires processing inputs and interacting with highly dynamic content. Extracted Markdown can help choose an item, but it cannot select a size or add the item to a cart.

Both implementations retain **Playwright MCP**, a browser, and an LLM for execution. The remaining obstacle is familiar: the original automated browser gets challenged repeatedly and cannot complete the flow. Šteimantas replaces it with **Oxylabs Headless Browser**, described as a drop-in replacement because it supports Playwright MCP.

The replacement supplies three access capabilities:

- **Browser-level stealth:** Changes at the browser source-code level address detection of automation.
- **Residential proxy:** A residential proxy comes attached to the browser.
- **Consistent geolocation:** Checkout uses the same location context as product verification, addressing the earlier mismatch between displayed availability and what can be purchased.

Return to the item that appeared available and then vanished at checkout. The redesigned flow checks localized product content, presents the choice for approval, and opens the interactive purchase flow using the same location. Playwright can then select the size specified in the prompt, add the item to the cart, and proceed through purchase. Šteimantas describes this as the intended working flow; the account does not establish an observed completed transaction or guarantee that inventory cannot change between verification and checkout.

The ending brings the implementation choices back to their purpose. Search handles discovery, extraction handles product reading, and a browser handles the interaction that remains. Infrastructure absorbs the web-access work so builders can focus on the shopping experience. The rules apply throughout: use browsers when necessary, validate content before feeding it to an LLM, and keep cost in view.

## Key takeaways

- Choose web-access tools by task: search for candidate URLs, extract validated product content, and use a browser for interactive checkout after user approval.
- HTTP `200` and response size cannot establish that a page contains useful product information. Explicit retrieval errors keep known blocked responses out of model input.
- Validate before compression: shrinking invalid content does not make it useful, and asking the model to reject it still spends tokens.
- An extraction API can hide browser orchestration while retaining conditional browser rendering for dynamic pages.
- Align geolocation across product verification and checkout so regional stock, sizes, and options are evaluated in the same context.

## Related talks

- [How Web Data Infrastructure Powers the Next Generation of AI](https://ai.engineer/talks/1UmZHb_E_SM-web-data-infrastructure-powers-next-generation-ai) — A related talk on the web-data infrastructure that forms this recording’s central subject.
- [The Agentic Commerce Stack — Ahnaf Prio, Best Buy](https://ai.engineer/talks/G7cgLjZtmMU-agentic-commerce-stack-ahnaf-prio-best-buy) — A related commerce-focused talk for readers interested in the shopping-agent setting.

## Slides

### The Chat Becomes One Prompt

A personal shopper chatbot turns a style conversation into a product prompt for a shopping agent to find and attempt to buy online. The example narrows the request to a black wool blazer in size 46.

[0:32](https://www.youtube.com/watch?v=XsvUhpnHepE&t=32s) [A blazer search prompt beside a phone mockup of an AI stylist chat and product recommendations.](https://assets.ai.engineer/sites/aiecode2025/sha256/ef09796286ae78e6d766178163b02b80925ed530c70db452aac0170e5ffc4bdf.webp)

The Chat Becomes One Prompt:

“Single-breasted Wool Blazer, size 46, black”

Style AI - Your AI Stylist

Hi Sarah! To help with your new style for the company event, I’ve curated some looks for you. Check them out below! I can also buy them for you.

What do you think of this blazer and trouser combo? I can also check for similar items in different colors or price points.

I love the navy blazer and the wide-leg trousers! Can you find me a white silk blouse to go with it? My budget for the whole outfit is $250.

Great choice! I’m searching for a silk blouse and calculating the total. I’ll show you some options now.

Your Curation
Based on your preferences

Everlane — $148
Buy Now
Single-Breasted Wool Blazer - Fits true to size, good quality.

Arket — $99
Buy Now
High-waist Crepe Trousers - Flowy and professional.

Suggested Silk Blouse
Searching for options...

Interface text:
9:41

### Then Reality Hit

The shopping agent encountered CAPTCHA challenges instead of product pages. The slide shows motorcycle selection, dice arithmetic and distorted-text verification.

[1:18](https://www.youtube.com/watch?v=XsvUhpnHepE&t=78s) [Three examples of CAPTCHA challenges, including image selection, dice and text verification.](https://assets.ai.engineer/sites/aiecode2025/sha256/c8186b2cbc890d0e0b9c40d3ec0772b06bbc6a6247505caf9e7be504adc10b72.webp)

Then Reality Hit

Select all squares with motorcycles
If there are none, click skip

Pick the dice pair whose top sides add up to 14
[illegible]

I’m not a robot
CAPTCHA
Privacy - Terms

[illegible]
Type the two words:
CAPTCHA
Privacy - Terms

### A Browser for Everything

A quickly built agent used browser automation for everything. Šteimantas describes the result as slow, expensive and unreliable.

[1:29](https://www.youtube.com/watch?v=XsvUhpnHepE&t=89s) [A slide describes an unplanned browser-based approach as slow, expensive and unreliable.](https://assets.ai.engineer/sites/aiecode2025/sha256/192a80a849ef2162e17f7c7c685daf2cc3640d411abc3c7b254828b0e921c32c.webp)

Vibe-Coded. No Plan.
A Browser for Everything

Slow.
Expensive.
Unreliable.

### The Missing Layer in Agentic AI

Giedrius Šteimantas introduces web-scraping infrastructure as the missing layer that helps AI agents access the open web at scale and low cost.

[2:21](https://www.youtube.com/watch?v=XsvUhpnHepE&t=141s) [Oxylabs title slide about web-scraping infrastructure for agentic AI, with a portrait of presenter Giedrius Šteimantas.](https://assets.ai.engineer/sites/aiecode2025/sha256/a6e644a77407195e23a8d5b5b8da2258f0a4064b3db12cee1fde4b572a8d4d8c.webp)

oxylabs®

The Missing Layer in Agentic AI

How Web-Scraping Infrastructure Powers Agentic AI at Scale, at Low Cost.

Giedrius Šteimantas
Director of Scraping Engineering
@ Oxylabs

### Cost Matters

To control scraping costs, use a browser only when needed and prefer lighter content. Validate responses: an HTTP 200 alone does not mean the content is good to go.

[3:15](https://www.youtube.com/watch?v=XsvUhpnHepE&t=195s) [A slide advises using a browser only when necessary and validating content.](https://assets.ai.engineer/sites/aiecode2025/sha256/3c7685184bc77a389a453ff7975d52a949c515cb1029bb29e27c704dce06433a.webp)

Principles From the Scraping World

Cost Matters:
Use a Browser Only When You Have to.
Validate Content.

[3:27](https://www.youtube.com/watch?v=XsvUhpnHepE&t=207s) [Cost matters: use a browser only when necessary, validate content, and prefer lighter content.](https://assets.ai.engineer/sites/aiecode2025/sha256/99d200a62e632ad3295ee63aaaf15f04d5bd28b616c2bb1bf67747a9452423f9.webp)

Principles From the Scraping World

Cost Matters:
Use a Browser Only When You Have to.
Validate Content.
Lighter Content is preferred.

### Four Stages. One Unreliable Agent.

The shopping agent finds product pages, checks what to buy, asks the user to confirm, then makes the purchase. The speaker says it sometimes failed.

[3:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=227s) [A workflow moves from discovery to decision, user confirmation, and execution.](https://assets.ai.engineer/sites/aiecode2025/sha256/5cfc5cf33691c4a70a77b7edeaa7fc55488c434fe550dcae24e2e6126166b322.webp)

The Workflow

Four Stages. One Unreliable Agent.

Discovery → Decision → User Confirms → Execution

### The Browser Tax

A fixed site list limits choices, heavy JavaScript slows discovery, and missing geolocation can leave items unavailable at checkout. Lack of stealth adds CAPTCHAs and retries.

[6:17](https://www.youtube.com/watch?v=XsvUhpnHepE&t=377s) [Four browser drawbacks: no stealth, a fixed list, heavy JavaScript, and no geolocation.](https://assets.ai.engineer/sites/aiecode2025/sha256/4213363a98e0f9be1e038eae8421416f40df316944d14bf6400061c3a72c0232.webp)

Stage 1 - Discovery

The Browser Tax

No stealth
Captchas, retries, runaway cost

A fixed list
Limited choices

Heavy Javascript
Slow and costly

No geolocation
Unavailable at checkout

### Skip the Browser. Search Like an Agent.

The agent formulates queries, searches with Oxylabs’ Fast Search API, and selects relevant URLs. The slide reports <700ms average response time and 99.9% success; the shown search call took 669ms.

[6:43](https://www.youtube.com/watch?v=XsvUhpnHepE&t=403s) [Search metrics show JSON responses, under 700 milliseconds average response time, and a 99.9% success rate, alongside an agent timeline.](https://assets.ai.engineer/sites/aiecode2025/sha256/6e40593af83b5f45497780d148d8d3d3f9416a5a9cf07bcbe3112068e0f5c742.webp)

Stage 1 - Discovery, Rebuilt

Skip the Browser. Search Like an Agent.

JSON
Only 2k tokens per response

<700ms
Avg response time

99.9%
Success rate

Timeline

pick_urls_llm
→ completed (2294ms)

tool_call: oxylabs_search
→ completed (669ms)

formulate_query_llm
→ completed (699ms)

Status: running

### Blocked Into Oblivion

After selecting URLs, the agent visits product pages to check prices, stock and details. Browser blocks at popular retailers leave it with few choices.

[8:03](https://www.youtube.com/watch?v=XsvUhpnHepE&t=483s) [The slide says browser visits to product pages are blocked by many popular retailers.](https://assets.ai.engineer/sites/aiecode2025/sha256/8e187bbd3ccad57b4261fa99fd4d55464c95acddf3a4ba0dc810c0c0d7783945.webp)

Stage 2 - Decision

Blocked Into Oblivion

Visiting product pages with a browser - most popular retailers, blocked.

### Stage 2: The Trap

Checking content size and HTTP codes can let blocked pages reach the LLM. The speaker estimates 70% of tokens are wasted in an example where only three of ten sites return valid content, but all ten are sent to the model.

[8:49](https://www.youtube.com/watch?v=XsvUhpnHepE&t=529s) [The slide says late block detection wastes tokens and highlights a 70% figure.](https://assets.ai.engineer/sites/aiecode2025/sha256/10889214e7e2dd63eea2b4709d2057c300af2b66b234590a4bb5a20f6d1d6ab9.webp)

Stage 2 - The Trap

Detecting blocks by size + HTTP code is too late - you’ve already paid the LLM to read captchas.

70%
of tokens, wasted.

### No Browser. Only Valid Content

The API returns Markdown, flags failed scrapes before the LLM sees them, and can localize results. It handles hundreds of requests in parallel and uses a browser under the hood for dynamic pages.

[11:26](https://www.youtube.com/watch?v=XsvUhpnHepE&t=686s) [Stage 2 slide lists explicit failures, parallel REST requests, Markdown output, and geolocation alongside scraped content previews.](https://assets.ai.engineer/sites/aiecode2025/sha256/d802ff0d467dd778155c64e7eae973b0bf3cadf97851fb0845de6d805ab25ce4.webp)

Stage 2 - Decision, Rebuilt

No Browser.
Only Valid Content

Blocks fail loudly
Skip them before the LLM

Lightweight REST
Hundreds in parallel

Markdown out
Browser only if dynamic

Geolocation
Relevant content

Content previews

https://www.breuninger.com/es/en/women/shoes/sneakers-chunky-sneakers/
https://www.breuninger.com/es/en/women/shoes/sneakers-chunky-sneakers/ | 50
[Skip to main content](#main-content)Skip to search
[Now special offers with up to 50% off](/es/en/sale/?dhkredirect=true)
[€15 for your first order using the app](https://kw5x.eu.adj.st/home?[illegible])
[Breuninger](/es/en/)
Selected designer fashion since 1881
[Safe & convenient payment](https://faq.eu.breuninger.com/hc/en-es/sections/576652[illegible])

https://www.zalando.de/trainers/?q=platform+sneakers
https://www.zalando.de/trainers/?q=platform+sneakers | 50
[Football summer sale: up to 50% + 15% extra on top picks. Code: GER15 >>]([illegible])
* [Women](/women-home/)
* [Men](/men-home/)
* [Kids](/kids-home/)
[Zalando homeZalando home](/)
EN
Switch Language

https://www.schuh.eu/en-de/trends/chunky-trainers/
https://www.schuh.eu/en-de/trends/chunky-trainers/ | 10
[Skip to main content](#main)

### The User Makes the Call

The system presents its decision to the user, who makes the final call. An affirmative decision moves the workflow to purchase.

[11:52](https://www.youtube.com/watch?v=XsvUhpnHepE&t=712s) [Stage 3 handoff slide stating that the user makes the call.](https://assets.ai.engineer/sites/aiecode2025/sha256/bc322bebf04b357c7c74e22ff283b1ea5223f2627b156016e2550cb73b266ab9.webp)

Stage 3 - Hand Off

The User Makes the Call.

### Now You Really Need a Browser

For the purchase stage, both implementations combine Playwright MCP, a browser, and an LLM to process inputs and highly dynamic content.

[12:08](https://www.youtube.com/watch?v=XsvUhpnHepE&t=728s) [Stage 4 execution slide combines Playwright, a browser, and an LLM.](https://assets.ai.engineer/sites/aiecode2025/sha256/5ab617a7c1c7f27036aed3b2034d939a59b81d9dc49026eff394acac4f606514.webp)

Stage 4 - Execution

Now You Really Need a Browser

Playwright + A Browser + LLM

### A Drop-In, Hardened Browser

The Playwright MCP replacement combines source-code stealth, a residential proxy, and geolocation to localize results like the verification stage.

[13:19](https://www.youtube.com/watch?v=XsvUhpnHepE&t=799s) [Three cards describe source-code stealth, a residential proxy, and geolocation, with Playwright MCP support.](https://assets.ai.engineer/sites/aiecode2025/sha256/4123a4778b95dbad2ff1ed57033bcfe64459332c9c4e7dce7d80806d046578f7.webp)

Stage 4 - Execution, Rebuilt

A Drop-In, Hardened Browser

Stealth at the Source-Code Level
Residential Proxy Out of the Box
Geolocation - Localized Like Verification

Supports Playwright MCP - just Swap It In.

### Browser with scraping experience: product selection

The demo shows a Calvin Klein blazer with size 46 selected. The speaker describes automating size selection and adding the item to the cart.

[13:38](https://www.youtube.com/watch?v=XsvUhpnHepE&t=818s) [A browser demonstration shows a clothing product page beside the execution slide.](https://assets.ai.engineer/sites/aiecode2025/sha256/25f9593dac3010d254115bc52588c9a806a966ad42fa5b136f0750dc4b8e4aa9.webp)

Stage 4 - Execution, Rebuilt

Browser with scraping experience

Folge Calvin Klein und gönne Dir -10%

Calvin Klein

Herren / Kleidung / Jacken & Mäntel / Jacken

Slim Blazer Aus Stretch-Wolle
164,00 € (inkl. MwSt.)
Niedrigster Preis der letzten 30 Tage: 164,00 €
Ursprünglich verkauft für: 329,90 €

Farbe: Black

Nur noch 3 in Größe 46 verfügbar. Bestelle so bald wie möglich.

Größe:
44  46  48
50  52  54
56  58  60

Deal
Größen-Guide
Hinzufügen
Ab 15 €/Monat mit Klarna Mehr erfahren

Interface text:
Slim Blazer aus Stretch-Wolle
https://www.calvinklein.de/[illegible]

### Browser with scraping experience: checkout

The browser demo reaches checkout with a size 46 blazer in the cart. The speaker describes selecting the requested size and adding it to the cart.

[13:45](https://www.youtube.com/watch?v=XsvUhpnHepE&t=825s) [The browser demonstration shows a checkout page with delivery options and an order summary.](https://assets.ai.engineer/sites/aiecode2025/sha256/1ed99e9085963724ff6f5c0d4e7bf2aea8b9f8efe3e319f34264d19e2a7eaa2d.webp)

Stage 4 - Execution, Rebuilt

Browser with scraping experience

Calvin Klein
Checkout    2. Details    3. Payment

Express-Kasse
Bezahlen Mit PayPal
Oder

Lieferart
Lieferung    Abholung
Standardversand Kostenlos
Innerhalb von 2-3 Werktagen

Persönliche Angaben
Die Adresse muss in Deutschland sein.
Anmelden
E-Mail-Adresse*
Wir werden deine E-mail nur verwenden, um dir Updates zu deiner Bestellung zu schicken.

Übersicht
Gesamt 164,00 €
Standardversand Kostenlos
innerhalb von 2-3 Werktagen
Hast du einen Gutscheincode?
Gesamt (1 Artikel) inkl. MwSt. 164,00 €

Dein Warenkorb
Slim Blazer aus Stretch-Wolle 164,00 €
Farbe: Black
Größe: 46
Anzahl: 1

Interface text:
Kasse – Versand
https://www.calvinklein.de/checkout/shipping

### An agent that commands real infrastructure

Šteimantas says the agent draws on years of web scraping experience to access the web while saving implementation time and token cost.

[13:48](https://www.youtube.com/watch?v=XsvUhpnHepE&t=828s) [Takeaway slide says the agent opens the web, saves implementation time, and cuts token cost.](https://assets.ai.engineer/sites/aiecode2025/sha256/313615298c79e65630d2c222127b989dd24c6ac4ac7487d9436e5d23cae92d4f.webp)

Takeaway

An Agent That Commands Real Infrastructure

Opens the Web.
Saves Implementation Time.
Cuts Token Cost.

### Lessons for building agents

Šteimantas applies web scraping lessons to agents: use a browser only when necessary, validate content before feeding it to LLMs, and provide the missing infrastructure. He closes with a reminder that cost matters.

[14:08](https://www.youtube.com/watch?v=XsvUhpnHepE&t=848s) [Three takeaways: use the browser only when necessary, validate content before feeding LLMs, and fill the missing layer with proper infrastructure.](https://assets.ai.engineer/sites/aiecode2025/sha256/4d6f22f45f67b096f9168e92fbfb40fec8fc0570b705ea5181105b1d4bf2a100.webp)

Takeaway

Use browser only when absolutely necessary

Validate content before feeding LLMs

Fill the missing layer with proper infra

Interface text:
CC

### AI Engineer World's Fair

[14:51](https://www.youtube.com/watch?v=XsvUhpnHepE&t=891s) [AI Engineer World's Fair title in white on a black background.](https://assets.ai.engineer/sites/aiecode2025/sha256/c7ca0ae54e3bcfc1055c12f52bce4d33b3578fd786059eb5009eb6487d181bb4.webp)

AI Engineer
World’s Fair

HTTPS://AI.ENGINEER

## Full transcript

[0:01](https://www.youtube.com/watch?v=XsvUhpnHepE&t=1s) [music]

[0:13](https://www.youtube.com/watch?v=XsvUhpnHepE&t=13s) What a beautiful voice.

[0:16](https://www.youtube.com/watch?v=XsvUhpnHepE&t=16s) All right, thank you for coming. Um,

[0:18](https://www.youtube.com/watch?v=XsvUhpnHepE&t=18s) today I'm going to talk a lot about

[0:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=20s) about missing layer of Aentic AI and

[0:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=22s) explain a little bit about how web

[0:24](https://www.youtube.com/watch?v=XsvUhpnHepE&t=24s) scraping infrastructure can actually

[0:26](https://www.youtube.com/watch?v=XsvUhpnHepE&t=26s) help you. But first, let me talk uh a

[0:30](https://www.youtube.com/watch?v=XsvUhpnHepE&t=30s) little bit about my friend's idea. So,

[0:32](https://www.youtube.com/watch?v=XsvUhpnHepE&t=32s) my friend had this idea. Uh he built

[0:35](https://www.youtube.com/watch?v=XsvUhpnHepE&t=35s) this AI chatbot that, you know, chatted

[0:38](https://www.youtube.com/watch?v=XsvUhpnHepE&t=38s) with people about their style and it was

[0:40](https://www.youtube.com/watch?v=XsvUhpnHepE&t=40s) supposed to help them pick out new items

[0:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=44s) uh as you know, some sort of a personal

[0:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=47s) shopper. And once those items were

[0:49](https://www.youtube.com/watch?v=XsvUhpnHepE&t=49s) picked out, you know, this uh this this

[0:51](https://www.youtube.com/watch?v=XsvUhpnHepE&t=51s) this chatbot would uh produce prompts

[0:55](https://www.youtube.com/watch?v=XsvUhpnHepE&t=55s) that a shopping agent would then take

[0:57](https://www.youtube.com/watch?v=XsvUhpnHepE&t=57s) and attempt to find them online and

[1:00](https://www.youtube.com/watch?v=XsvUhpnHepE&t=60s) purchase them for uh you know for for

[1:02](https://www.youtube.com/watch?v=XsvUhpnHepE&t=62s) for the customers. Um this idea I know

[1:05](https://www.youtube.com/watch?v=XsvUhpnHepE&t=65s) is not new and uh it could be applicable

[1:07](https://www.youtube.com/watch?v=XsvUhpnHepE&t=67s) to many scenarios but my friend was kind

[1:09](https://www.youtube.com/watch?v=XsvUhpnHepE&t=69s) of you know uh he was u he was good at

[1:12](https://www.youtube.com/watch?v=XsvUhpnHepE&t=72s) building agents uh but u he ran into

[1:15](https://www.youtube.com/watch?v=XsvUhpnHepE&t=75s) different problems and asked me for

[1:17](https://www.youtube.com/watch?v=XsvUhpnHepE&t=77s) advice and when he ran it

[1:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=80s) he he would usually you know instead of

[1:23](https://www.youtube.com/watch?v=XsvUhpnHepE&t=83s) you know product pages or whatever he

[1:25](https://www.youtube.com/watch?v=XsvUhpnHepE&t=85s) would get things like that it's uh you

[1:28](https://www.youtube.com/watch?v=XsvUhpnHepE&t=88s) know he would get captured

[1:30](https://www.youtube.com/watch?v=XsvUhpnHepE&t=90s) you know and uh you know of course you

[1:33](https://www.youtube.com/watch?v=XsvUhpnHepE&t=93s) So he was uh he was doing it very very

[1:35](https://www.youtube.com/watch?v=XsvUhpnHepE&t=95s) quickly. So he wipe coded the whole

[1:36](https://www.youtube.com/watch?v=XsvUhpnHepE&t=96s) thing while having a you know a thought

[1:39](https://www.youtube.com/watch?v=XsvUhpnHepE&t=99s) about you know infrastructure and

[1:40](https://www.youtube.com/watch?v=XsvUhpnHepE&t=100s) underlying layers and how it should

[1:42](https://www.youtube.com/watch?v=XsvUhpnHepE&t=102s) work. I didn't at all. Uh he was using a

[1:46](https://www.youtube.com/watch?v=XsvUhpnHepE&t=106s) browser automation framework for

[1:48](https://www.youtube.com/watch?v=XsvUhpnHepE&t=108s) everything and it was slow,

[1:52](https://www.youtube.com/watch?v=XsvUhpnHepE&t=112s) expensive and unreliable.

[1:55](https://www.youtube.com/watch?v=XsvUhpnHepE&t=115s) So at the end he made a product that uh

[1:58](https://www.youtube.com/watch?v=XsvUhpnHepE&t=118s) uh that does not work and is expensive

[2:01](https://www.youtube.com/watch?v=XsvUhpnHepE&t=121s) to run.

[2:03](https://www.youtube.com/watch?v=XsvUhpnHepE&t=123s) So he asked me for help and you know I

[2:05](https://www.youtube.com/watch?v=XsvUhpnHepE&t=125s) was a little bit reluctant at first

[2:07](https://www.youtube.com/watch?v=XsvUhpnHepE&t=127s) because uh you know I don't like giving

[2:09](https://www.youtube.com/watch?v=XsvUhpnHepE&t=129s) out professional advice you know for

[2:11](https://www.youtube.com/watch?v=XsvUhpnHepE&t=131s) free but uh I took a look at it and uh

[2:15](https://www.youtube.com/watch?v=XsvUhpnHepE&t=135s) you know I got a little curious I have

[2:17](https://www.youtube.com/watch?v=XsvUhpnHepE&t=137s) to be honest. I noticed that he was

[2:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=140s) missing something.

[2:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=142s) Um he was missing a layer an

[2:25](https://www.youtube.com/watch?v=XsvUhpnHepE&t=145s) infrastructural layer that would allow

[2:27](https://www.youtube.com/watch?v=XsvUhpnHepE&t=147s) this agent to operate freely on the open

[2:30](https://www.youtube.com/watch?v=XsvUhpnHepE&t=150s) web.

[2:32](https://www.youtube.com/watch?v=XsvUhpnHepE&t=152s) My name is Gedrus. I I work for Oxyabs

[2:35](https://www.youtube.com/watch?v=XsvUhpnHepE&t=155s) uh where in the past 10 years we've

[2:37](https://www.youtube.com/watch?v=XsvUhpnHepE&t=157s) helped you know companies that trained

[2:40](https://www.youtube.com/watch?v=XsvUhpnHepE&t=160s) large language models uh get their data

[2:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=164s) and now we use this infrastructure to

[2:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=167s) help AI agents to access uh web on scale

[2:53](https://www.youtube.com/watch?v=XsvUhpnHepE&t=173s) and at low cost.

[2:56](https://www.youtube.com/watch?v=XsvUhpnHepE&t=176s) And uh before we go into this agent and

[2:59](https://www.youtube.com/watch?v=XsvUhpnHepE&t=179s) see how we can build it, I wanted to

[3:01](https://www.youtube.com/watch?v=XsvUhpnHepE&t=181s) talk a little bit about the scraping

[3:02](https://www.youtube.com/watch?v=XsvUhpnHepE&t=182s) industry and how we operate. And uh the

[3:06](https://www.youtube.com/watch?v=XsvUhpnHepE&t=186s) principles that we operate on can be

[3:08](https://www.youtube.com/watch?v=XsvUhpnHepE&t=188s) summed up by one uh sentence. You know,

[3:12](https://www.youtube.com/watch?v=XsvUhpnHepE&t=192s) cost matters.

[3:15](https://www.youtube.com/watch?v=XsvUhpnHepE&t=195s) And the first principle is use a browser

[3:18](https://www.youtube.com/watch?v=XsvUhpnHepE&t=198s) when you absolutely have to

[3:21](https://www.youtube.com/watch?v=XsvUhpnHepE&t=201s) validate content. HTTP response 200 does

[3:25](https://www.youtube.com/watch?v=XsvUhpnHepE&t=205s) not mean that we are good to go.

[3:28](https://www.youtube.com/watch?v=XsvUhpnHepE&t=208s) Lighter content is preferred. Websites

[3:31](https://www.youtube.com/watch?v=XsvUhpnHepE&t=211s) are full of JavaScript, CSS,

[3:34](https://www.youtube.com/watch?v=XsvUhpnHepE&t=214s) HTML, and there's a lot of bites that do

[3:36](https://www.youtube.com/watch?v=XsvUhpnHepE&t=216s) not deliver any value whatsoever.

[3:40](https://www.youtube.com/watch?v=XsvUhpnHepE&t=220s) And today I will demonstrate how these

[3:42](https://www.youtube.com/watch?v=XsvUhpnHepE&t=222s) principles are also applicable when

[3:45](https://www.youtube.com/watch?v=XsvUhpnHepE&t=225s) building agents that interact with the

[3:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=227s) web.

[3:49](https://www.youtube.com/watch?v=XsvUhpnHepE&t=229s) So coming back to my friend's agent,

[3:51](https://www.youtube.com/watch?v=XsvUhpnHepE&t=231s) right? Let's uh let's take a look and

[3:53](https://www.youtube.com/watch?v=XsvUhpnHepE&t=233s) see how uh we could do a better job and

[3:56](https://www.youtube.com/watch?v=XsvUhpnHepE&t=236s) uh making this agent run more reliably.

[3:58](https://www.youtube.com/watch?v=XsvUhpnHepE&t=238s) So here's how my friends set it all up,

[4:01](https://www.youtube.com/watch?v=XsvUhpnHepE&t=241s) you know? So four different stages.

[4:03](https://www.youtube.com/watch?v=XsvUhpnHepE&t=243s) Discovery, the agent was supposed to

[4:06](https://www.youtube.com/watch?v=XsvUhpnHepE&t=246s) find products pages on websites where

[4:09](https://www.youtube.com/watch?v=XsvUhpnHepE&t=249s) these items can be bought. Then a

[4:11](https://www.youtube.com/watch?v=XsvUhpnHepE&t=251s) decision stage, right? and uh where an

[4:14](https://www.youtube.com/watch?v=XsvUhpnHepE&t=254s) agent can decide uh what products to buy

[4:16](https://www.youtube.com/watch?v=XsvUhpnHepE&t=256s) based on you know uh the the content of

[4:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=260s) these pages. So the agent has to visit

[4:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=262s) them verify that the the stock is there

[4:25](https://www.youtube.com/watch?v=XsvUhpnHepE&t=265s) the price is right the the description

[4:28](https://www.youtube.com/watch?v=XsvUhpnHepE&t=268s) fits uh you know the prompt and once

[4:31](https://www.youtube.com/watch?v=XsvUhpnHepE&t=271s) that decision is made user is given with

[4:33](https://www.youtube.com/watch?v=XsvUhpnHepE&t=273s) a choice you know whether to go ahead

[4:36](https://www.youtube.com/watch?v=XsvUhpnHepE&t=276s) with the purchase or you know reject it

[4:39](https://www.youtube.com/watch?v=XsvUhpnHepE&t=279s) altogether. The problem was that

[4:42](https://www.youtube.com/watch?v=XsvUhpnHepE&t=282s) sometimes and of course we go to

[4:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=284s) execution right away then execution just

[4:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=287s) making the purchase but the problem was

[4:49](https://www.youtube.com/watch?v=XsvUhpnHepE&t=289s) that sometimes it worked and sometimes

[4:51](https://www.youtube.com/watch?v=XsvUhpnHepE&t=291s) it did not that was a little

[4:53](https://www.youtube.com/watch?v=XsvUhpnHepE&t=293s) problematic.

[4:55](https://www.youtube.com/watch?v=XsvUhpnHepE&t=295s) So let's dissect it step by step and see

[4:58](https://www.youtube.com/watch?v=XsvUhpnHepE&t=298s) how we could build this differently

[5:00](https://www.youtube.com/watch?v=XsvUhpnHepE&t=300s) while improving performance and reducing

[5:02](https://www.youtube.com/watch?v=XsvUhpnHepE&t=302s) the cost dramatically by using the same

[5:05](https://www.youtube.com/watch?v=XsvUhpnHepE&t=305s) principles from the scraping industry.

[5:09](https://www.youtube.com/watch?v=XsvUhpnHepE&t=309s) So the first stage discovery. So my

[5:13](https://www.youtube.com/watch?v=XsvUhpnHepE&t=313s) friend uh you know he chose to go with a

[5:16](https://www.youtube.com/watch?v=XsvUhpnHepE&t=316s) predefined list of websites major

[5:18](https://www.youtube.com/watch?v=XsvUhpnHepE&t=318s) retailers uh and query their search

[5:21](https://www.youtube.com/watch?v=XsvUhpnHepE&t=321s) pages in order to find these products.

[5:23](https://www.youtube.com/watch?v=XsvUhpnHepE&t=323s) He used the browser automation tool for

[5:26](https://www.youtube.com/watch?v=XsvUhpnHepE&t=326s) that. It kind of worked but you know it

[5:28](https://www.youtube.com/watch?v=XsvUhpnHepE&t=328s) did have challenges. So their browser

[5:31](https://www.youtube.com/watch?v=XsvUhpnHepE&t=331s) automation tool lacked what we call

[5:33](https://www.youtube.com/watch?v=XsvUhpnHepE&t=333s) stealth. So they could so they would get

[5:35](https://www.youtube.com/watch?v=XsvUhpnHepE&t=335s) captures and sometimes fail access to

[5:37](https://www.youtube.com/watch?v=XsvUhpnHepE&t=337s) access the sites. all together. This

[5:39](https://www.youtube.com/watch?v=XsvUhpnHepE&t=339s) would break down the flow. So a retry

[5:42](https://www.youtube.com/watch?v=XsvUhpnHepE&t=342s) mechanism would have to be put in place

[5:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=344s) making the whole process very long. Uh

[5:46](https://www.youtube.com/watch?v=XsvUhpnHepE&t=346s) you know costly um and sometimes the

[5:50](https://www.youtube.com/watch?v=XsvUhpnHepE&t=350s) size would not be uh accessed at all and

[5:54](https://www.youtube.com/watch?v=XsvUhpnHepE&t=354s) also you know as a result also became

[5:57](https://www.youtube.com/watch?v=XsvUhpnHepE&t=357s) very difficult to predict the final cost

[5:59](https://www.youtube.com/watch?v=XsvUhpnHepE&t=359s) per transaction.

[6:01](https://www.youtube.com/watch?v=XsvUhpnHepE&t=361s) The list of websites that my friend was

[6:03](https://www.youtube.com/watch?v=XsvUhpnHepE&t=363s) checking was also deterministic. So

[6:05](https://www.youtube.com/watch?v=XsvUhpnHepE&t=365s) selection of items would only be limited

[6:08](https://www.youtube.com/watch?v=XsvUhpnHepE&t=368s) to the few choices he put in.

[6:12](https://www.youtube.com/watch?v=XsvUhpnHepE&t=372s) Websites themselves were heavy on

[6:13](https://www.youtube.com/watch?v=XsvUhpnHepE&t=373s) JavaScript, making the whole process

[6:15](https://www.youtube.com/watch?v=XsvUhpnHepE&t=375s) very slow and costly.

[6:18](https://www.youtube.com/watch?v=XsvUhpnHepE&t=378s) And finally, even if it worked, items

[6:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=382s) ended up being unavailable at checkout

[6:25](https://www.youtube.com/watch?v=XsvUhpnHepE&t=385s) because in the discovery phase, the he

[6:28](https://www.youtube.com/watch?v=XsvUhpnHepE&t=388s) was not able to use energy location

[6:30](https://www.youtube.com/watch?v=XsvUhpnHepE&t=390s) capabilities and a lot of e-commerce

[6:32](https://www.youtube.com/watch?v=XsvUhpnHepE&t=392s) websites are uh you know uh they take

[6:36](https://www.youtube.com/watch?v=XsvUhpnHepE&t=396s) your users location into account when

[6:38](https://www.youtube.com/watch?v=XsvUhpnHepE&t=398s) displaying stock options sizes and

[6:40](https://www.youtube.com/watch?v=XsvUhpnHepE&t=400s) soever.

[6:45](https://www.youtube.com/watch?v=XsvUhpnHepE&t=405s) So now we solve these problems at Oxabs

[6:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=407s) every day. So when scraping you always

[6:50](https://www.youtube.com/watch?v=XsvUhpnHepE&t=410s) want the results to appear on the first

[6:52](https://www.youtube.com/watch?v=XsvUhpnHepE&t=412s) try and to not to use browser unless

[6:55](https://www.youtube.com/watch?v=XsvUhpnHepE&t=415s) absolutely necessary. However, for this

[6:58](https://www.youtube.com/watch?v=XsvUhpnHepE&t=418s) specific discovery phase, you also want

[7:01](https://www.youtube.com/watch?v=XsvUhpnHepE&t=421s) to use to allow your agent to search the

[7:03](https://www.youtube.com/watch?v=XsvUhpnHepE&t=423s) web. Doing so with a browser is very

[7:06](https://www.youtube.com/watch?v=XsvUhpnHepE&t=426s) cumbersome. That is why I chose to use a

[7:09](https://www.youtube.com/watch?v=XsvUhpnHepE&t=429s) product that we built especially for

[7:11](https://www.youtube.com/watch?v=XsvUhpnHepE&t=431s) agents fast search API.

[7:14](https://www.youtube.com/watch?v=XsvUhpnHepE&t=434s) It returns a compact JSON which is less

[7:17](https://www.youtube.com/watch?v=XsvUhpnHepE&t=437s) than 2,000 tokens per response. Has fast

[7:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=440s) response times less than 700

[7:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=442s) milliseconds on average. And it's uh has

[7:25](https://www.youtube.com/watch?v=XsvUhpnHepE&t=445s) a a high success rate at a predictable

[7:28](https://www.youtube.com/watch?v=XsvUhpnHepE&t=448s) low price. And most importantly, it

[7:31](https://www.youtube.com/watch?v=XsvUhpnHepE&t=451s) gives your agent access to the mo to you

[7:33](https://www.youtube.com/watch?v=XsvUhpnHepE&t=453s) know to many popular search engines that

[7:37](https://www.youtube.com/watch?v=XsvUhpnHepE&t=457s) all of these websites have been instant

[7:40](https://www.youtube.com/watch?v=XsvUhpnHepE&t=460s) indexed already a long time ago.

[7:42](https://www.youtube.com/watch?v=XsvUhpnHepE&t=462s) So in the discovery phase instead of

[7:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=464s) predefined list and the browser we give

[7:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=467s) agent a tool to search the web fast

[7:48](https://www.youtube.com/watch?v=XsvUhpnHepE&t=468s) search API agent formulates fan out

[7:52](https://www.youtube.com/watch?v=XsvUhpnHepE&t=472s) queries and selects the relevant URLs

[7:53](https://www.youtube.com/watch?v=XsvUhpnHepE&t=473s) from search results. Since the responses

[7:56](https://www.youtube.com/watch?v=XsvUhpnHepE&t=476s) are quite small and there's no need for

[7:58](https://www.youtube.com/watch?v=XsvUhpnHepE&t=478s) complicated models we can have the agent

[8:00](https://www.youtube.com/watch?v=XsvUhpnHepE&t=480s) run quite quickly in this stage.

[8:05](https://www.youtube.com/watch?v=XsvUhpnHepE&t=485s) Um, yeah. So, so now the agent has

[8:09](https://www.youtube.com/watch?v=XsvUhpnHepE&t=489s) searched the web and selected some

[8:11](https://www.youtube.com/watch?v=XsvUhpnHepE&t=491s) relevant URLs. It is time for those for

[8:14](https://www.youtube.com/watch?v=XsvUhpnHepE&t=494s) for the agent to visit those pages to

[8:16](https://www.youtube.com/watch?v=XsvUhpnHepE&t=496s) see what they're all about in order to

[8:19](https://www.youtube.com/watch?v=XsvUhpnHepE&t=499s) confirm price, stock level, description,

[8:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=502s) and product details and so on.

[8:25](https://www.youtube.com/watch?v=XsvUhpnHepE&t=505s) With this, we can go to in the decision

[8:27](https://www.youtube.com/watch?v=XsvUhpnHepE&t=507s) phase. This is where agent selects the

[8:30](https://www.youtube.com/watch?v=XsvUhpnHepE&t=510s) items we will purchase. For this, my

[8:32](https://www.youtube.com/watch?v=XsvUhpnHepE&t=512s) friend also used the browser. He ran

[8:35](https://www.youtube.com/watch?v=XsvUhpnHepE&t=515s) many browsers on parallel so it could uh

[8:37](https://www.youtube.com/watch?v=XsvUhpnHepE&t=517s) you know so the whole process could

[8:39](https://www.youtube.com/watch?v=XsvUhpnHepE&t=519s) happen faster and that is not a bad

[8:41](https://www.youtube.com/watch?v=XsvUhpnHepE&t=521s) thing. He managed to get some results

[8:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=524s) however many of the results would end up

[8:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=527s) like this

[8:51](https://www.youtube.com/watch?v=XsvUhpnHepE&t=531s) and the result

[8:53](https://www.youtube.com/watch?v=XsvUhpnHepE&t=533s) the agent would be left with very few

[8:55](https://www.youtube.com/watch?v=XsvUhpnHepE&t=535s) choices with the majority of popular

[8:57](https://www.youtube.com/watch?v=XsvUhpnHepE&t=537s) retailers being left out. It's a good

[9:01](https://www.youtube.com/watch?v=XsvUhpnHepE&t=541s) thing he did well with observability. So

[9:03](https://www.youtube.com/watch?v=XsvUhpnHepE&t=543s) he actually noticed when it happened.

[9:05](https://www.youtube.com/watch?v=XsvUhpnHepE&t=545s) But what we see when working with these

[9:08](https://www.youtube.com/watch?v=XsvUhpnHepE&t=548s) types of customers is that they often

[9:11](https://www.youtube.com/watch?v=XsvUhpnHepE&t=551s) fail to detect the failure. They end up

[9:14](https://www.youtube.com/watch?v=XsvUhpnHepE&t=554s) checking only the content size and HTTP

[9:16](https://www.youtube.com/watch?v=XsvUhpnHepE&t=556s) response code and then feeding this

[9:18](https://www.youtube.com/watch?v=XsvUhpnHepE&t=558s) large HTML to an LLM. Now an a large

[9:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=562s) language model of course can distinguish

[9:24](https://www.youtube.com/watch?v=XsvUhpnHepE&t=564s) between valid esop content and a

[9:26](https://www.youtube.com/watch?v=XsvUhpnHepE&t=566s) capture. But we need to spend tokens in

[9:29](https://www.youtube.com/watch?v=XsvUhpnHepE&t=569s) order to do that.

[9:30](https://www.youtube.com/watch?v=XsvUhpnHepE&t=570s) And when we attempt to open 10 websites,

[9:33](https://www.youtube.com/watch?v=XsvUhpnHepE&t=573s) but only three return valid content

[9:38](https://www.youtube.com/watch?v=XsvUhpnHepE&t=578s) but feed all of the 10 to the to the

[9:40](https://www.youtube.com/watch?v=XsvUhpnHepE&t=580s) model, it is a problem.

[9:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=584s) It means that we waste 70% of the tokens

[9:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=587s) and that is a little crazy in my in my

[9:50](https://www.youtube.com/watch?v=XsvUhpnHepE&t=590s) opinion.

[9:53](https://www.youtube.com/watch?v=XsvUhpnHepE&t=593s) So I noticed this problem as well. Uh my

[9:56](https://www.youtube.com/watch?v=XsvUhpnHepE&t=596s) initial hunch was compression was to

[9:59](https://www.youtube.com/watch?v=XsvUhpnHepE&t=599s) compress the output. But then I thought

[10:01](https://www.youtube.com/watch?v=XsvUhpnHepE&t=601s) wait the problem is not the compression.

[10:04](https://www.youtube.com/watch?v=XsvUhpnHepE&t=604s) The problem is that the content is not

[10:06](https://www.youtube.com/watch?v=XsvUhpnHepE&t=606s) valid. We need to make sure that the

[10:09](https://www.youtube.com/watch?v=XsvUhpnHepE&t=609s) content is valid before even attempting

[10:11](https://www.youtube.com/watch?v=XsvUhpnHepE&t=611s) any compression. This will lead to more

[10:13](https://www.youtube.com/watch?v=XsvUhpnHepE&t=613s) options for the agent to choose from and

[10:16](https://www.youtube.com/watch?v=XsvUhpnHepE&t=616s) fewer wasted tokens. And then I remember

[10:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=620s) rule number one of scraping. Use the

[10:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=622s) browser when you absolutely need it.

[10:26](https://www.youtube.com/watch?v=XsvUhpnHepE&t=626s) Otherwise look for other solutions.

[10:29](https://www.youtube.com/watch?v=XsvUhpnHepE&t=629s) So I I tried to rebuild the stage

[10:31](https://www.youtube.com/watch?v=XsvUhpnHepE&t=631s) without a browser and I uh only by using

[10:34](https://www.youtube.com/watch?v=XsvUhpnHepE&t=634s) ox web scraper API and this gave me many

[10:38](https://www.youtube.com/watch?v=XsvUhpnHepE&t=638s) benefits. Uh but firstly only valid

[10:41](https://www.youtube.com/watch?v=XsvUhpnHepE&t=641s) content was returned. In case of

[10:43](https://www.youtube.com/watch?v=XsvUhpnHepE&t=643s) captures or other blocks the request

[10:46](https://www.youtube.com/watch?v=XsvUhpnHepE&t=646s) would fail with an explicit error

[10:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=647s) message. So I know not to include it

[10:49](https://www.youtube.com/watch?v=XsvUhpnHepE&t=649s) when sending to a large language model.

[10:51](https://www.youtube.com/watch?v=XsvUhpnHepE&t=651s) But the success rates are quite high and

[10:54](https://www.youtube.com/watch?v=XsvUhpnHepE&t=654s) even for protected websites. So that

[10:56](https://www.youtube.com/watch?v=XsvUhpnHepE&t=656s) wasn't that much of you know much of a

[10:58](https://www.youtube.com/watch?v=XsvUhpnHepE&t=658s) problem.

[11:00](https://www.youtube.com/watch?v=XsvUhpnHepE&t=660s) So no browser was needed and uh

[11:02](https://www.youtube.com/watch?v=XsvUhpnHepE&t=662s) everything is a lightweight rest API. I

[11:05](https://www.youtube.com/watch?v=XsvUhpnHepE&t=665s) can run hundreds of requests in parallel

[11:07](https://www.youtube.com/watch?v=XsvUhpnHepE&t=667s) and receive content at the same time.

[11:11](https://www.youtube.com/watch?v=XsvUhpnHepE&t=671s) Also the API supports markdown. So no

[11:14](https://www.youtube.com/watch?v=XsvUhpnHepE&t=674s) need to submit raw HTML uh to LLMs. If a

[11:18](https://www.youtube.com/watch?v=XsvUhpnHepE&t=678s) website is dynamic, it runs a full

[11:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=680s) browser under the hood to render the

[11:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=682s) content correctly.

[11:25](https://www.youtube.com/watch?v=XsvUhpnHepE&t=685s) And finally, it supports geoloccation

[11:27](https://www.youtube.com/watch?v=XsvUhpnHepE&t=687s) options. So I can localize my results

[11:30](https://www.youtube.com/watch?v=XsvUhpnHepE&t=690s) and get relevant content.

[11:33](https://www.youtube.com/watch?v=XsvUhpnHepE&t=693s) The best part,

[11:36](https://www.youtube.com/watch?v=XsvUhpnHepE&t=696s) customers only pay for successful

[11:37](https://www.youtube.com/watch?v=XsvUhpnHepE&t=697s) results. So actually, yeah, that's uh

[11:43](https://www.youtube.com/watch?v=XsvUhpnHepE&t=703s) that's what's uh that's what that's what

[11:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=704s) the best thing about it. No cure or no

[11:46](https://www.youtube.com/watch?v=XsvUhpnHepE&t=706s) pay. If if the scraper fails, there's no

[11:49](https://www.youtube.com/watch?v=XsvUhpnHepE&t=709s) cost and it fails loudly.

[11:54](https://www.youtube.com/watch?v=XsvUhpnHepE&t=714s) So now we have all of the information to

[11:57](https://www.youtube.com/watch?v=XsvUhpnHepE&t=717s) make a decision. We present a decision

[12:00](https://www.youtube.com/watch?v=XsvUhpnHepE&t=720s) to the user and the user makes the final

[12:02](https://www.youtube.com/watch?v=XsvUhpnHepE&t=722s) call. Once it's affirmative, we move to

[12:05](https://www.youtube.com/watch?v=XsvUhpnHepE&t=725s) the last stage of the workflow, the

[12:07](https://www.youtube.com/watch?v=XsvUhpnHepE&t=727s) purchase.

[12:09](https://www.youtube.com/watch?v=XsvUhpnHepE&t=729s) So I remember what I said a couple of

[12:11](https://www.youtube.com/watch?v=XsvUhpnHepE&t=731s) times about browsers. This time, but

[12:14](https://www.youtube.com/watch?v=XsvUhpnHepE&t=734s) this time is different. you this time

[12:16](https://www.youtube.com/watch?v=XsvUhpnHepE&t=736s) you absolutely need to use a browser. We

[12:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=740s) need to process inputs and the content

[12:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=742s) is highly dynamic.

[12:24](https://www.youtube.com/watch?v=XsvUhpnHepE&t=744s) Now this time my implementation, my

[12:26](https://www.youtube.com/watch?v=XsvUhpnHepE&t=746s) friend's implementation does not differ

[12:29](https://www.youtube.com/watch?v=XsvUhpnHepE&t=749s) much. We both use playright MCP with a

[12:31](https://www.youtube.com/watch?v=XsvUhpnHepE&t=751s) browser and a large language model.

[12:37](https://www.youtube.com/watch?v=XsvUhpnHepE&t=757s) The main problem my friend faced however

[12:40](https://www.youtube.com/watch?v=XsvUhpnHepE&t=760s) just like in in the previous stages

[12:42](https://www.youtube.com/watch?v=XsvUhpnHepE&t=762s) while using browser was access. Just

[12:46](https://www.youtube.com/watch?v=XsvUhpnHepE&t=766s) like in the beginning as he was using

[12:48](https://www.youtube.com/watch?v=XsvUhpnHepE&t=768s) the browser he was getting captured into

[12:50](https://www.youtube.com/watch?v=XsvUhpnHepE&t=770s) oblivion making it impossible to

[12:52](https://www.youtube.com/watch?v=XsvUhpnHepE&t=772s) automate the flow.

[12:55](https://www.youtube.com/watch?v=XsvUhpnHepE&t=775s) Well the fix was quite easy. I just

[12:58](https://www.youtube.com/watch?v=XsvUhpnHepE&t=778s) connected Oxab's headless browser since

[13:00](https://www.youtube.com/watch?v=XsvUhpnHepE&t=780s) it supports playright MCP is just a drop

[13:03](https://www.youtube.com/watch?v=XsvUhpnHepE&t=783s) in replacement. With this replacement, I

[13:06](https://www.youtube.com/watch?v=XsvUhpnHepE&t=786s) hardened this agent with years of

[13:08](https://www.youtube.com/watch?v=XsvUhpnHepE&t=788s) scraping experience and got proper

[13:11](https://www.youtube.com/watch?v=XsvUhpnHepE&t=791s) stealth done at the browser source code

[13:13](https://www.youtube.com/watch?v=XsvUhpnHepE&t=793s) level, a residential proxy attached to

[13:16](https://www.youtube.com/watch?v=XsvUhpnHepE&t=796s) it out of the box, and most importantly

[13:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=800s) in this in this case, a geoloccation

[13:22](https://www.youtube.com/watch?v=XsvUhpnHepE&t=802s) capability. So my results are localized

[13:25](https://www.youtube.com/watch?v=XsvUhpnHepE&t=805s) the same way as in the verification

[13:29](https://www.youtube.com/watch?v=XsvUhpnHepE&t=809s) stage.

[13:31](https://www.youtube.com/watch?v=XsvUhpnHepE&t=811s) So if we run it,

[13:33](https://www.youtube.com/watch?v=XsvUhpnHepE&t=813s) we actually have a a a a browser that

[13:38](https://www.youtube.com/watch?v=XsvUhpnHepE&t=818s) that access the content and can actually

[13:41](https://www.youtube.com/watch?v=XsvUhpnHepE&t=821s) automate the flow by, you know,

[13:42](https://www.youtube.com/watch?v=XsvUhpnHepE&t=822s) selecting the right size from the

[13:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=824s) prompt, add it to cart and complete the

[13:47](https://www.youtube.com/watch?v=XsvUhpnHepE&t=827s) purchase.

[13:49](https://www.youtube.com/watch?v=XsvUhpnHepE&t=829s) And boom,

[13:51](https://www.youtube.com/watch?v=XsvUhpnHepE&t=831s) we have an agent that commands a

[13:54](https://www.youtube.com/watch?v=XsvUhpnHepE&t=834s) powerful infrastructure hardened by

[13:57](https://www.youtube.com/watch?v=XsvUhpnHepE&t=837s) years of web scraping experience.

[14:00](https://www.youtube.com/watch?v=XsvUhpnHepE&t=840s) Not only does it open the up the web,

[14:03](https://www.youtube.com/watch?v=XsvUhpnHepE&t=843s) but also saves the time on

[14:05](https://www.youtube.com/watch?v=XsvUhpnHepE&t=845s) implementation and token cost.

[14:08](https://www.youtube.com/watch?v=XsvUhpnHepE&t=848s) And if I can leave you with a few

[14:10](https://www.youtube.com/watch?v=XsvUhpnHepE&t=850s) lessons we learned today was that you

[14:15](https://www.youtube.com/watch?v=XsvUhpnHepE&t=855s) know when building agents use the same

[14:18](https://www.youtube.com/watch?v=XsvUhpnHepE&t=858s) principles from the scraping industry.

[14:20](https://www.youtube.com/watch?v=XsvUhpnHepE&t=860s) Use the browser when you absolutely need

[14:23](https://www.youtube.com/watch?v=XsvUhpnHepE&t=863s) to.

[14:24](https://www.youtube.com/watch?v=XsvUhpnHepE&t=864s) You have to validate content before

[14:27](https://www.youtube.com/watch?v=XsvUhpnHepE&t=867s) feeding it to the large language models

[14:30](https://www.youtube.com/watch?v=XsvUhpnHepE&t=870s) and most importantly fill the missing

[14:33](https://www.youtube.com/watch?v=XsvUhpnHepE&t=873s) layer with the proper infrastructure so

[14:36](https://www.youtube.com/watch?v=XsvUhpnHepE&t=876s) you can focus on building stuff. But

[14:39](https://www.youtube.com/watch?v=XsvUhpnHepE&t=879s) remember cost matters.

[14:42](https://www.youtube.com/watch?v=XsvUhpnHepE&t=882s) Thank you very much.

[14:44](https://www.youtube.com/watch?v=XsvUhpnHepE&t=884s) [applause]
