The minimal pipeline
Keep onlyMainContent: true
Reader’s default extraction strips navigation, sidebars, cookie banners, and footer boilerplate. Your LLM doesn’t need those tokens, and they confuse questions like “what’s the author’s main argument?”.
Tokens and truncation
Long articles can blow through your model’s context window. Two strategies: Truncate the content if you just want a summary and don’t need every word:Prompt shape
Reader returns clean markdown with headings, lists, and code blocks preserved. Let your LLM see that structure; don’t flatten it to plain text:Citing sources back to the user
Reader’s response includesurl (canonical, after redirects) and metadata.title. Keep those around so your LLM output can cite:
Caching is your friend
Reader caches every successful scrape for 24 hours. If you’re iterating on a prompt against the same URL, every request after the first is free. Leavecache: true on (it’s the default).
Error handling
A failed scrape means your LLM has no content to reason about. Decide what to do:- Fail loudly. Propagate the error to the user; better than an LLM hallucinating an answer to an empty prompt.
- Fall back to search. If scrape fails, the user at least gets a “I couldn’t read this, here’s what I could find” response.
- Retry once with a different mode. If
standardfailed, forcestealthand try again.

