Overview
URL Retrieval lets the AI read the content of a specific URL the user shares in chat. Powered by Firecrawl, it scrapes the page and returns clean markdown — title, description, and body — injected directly into the AI’s context. This is distinct from Web Search: URL Retrieval fetches a known URL, while Web Search queries the web to discover relevant pages.Quick Start
Enable URL Retrieval inchat.config.ts:
How It Works
When a user pastes a URL into the chat, the AI invokes theretrieveUrl tool automatically. The tool:
- Calls the Firecrawl
scrapeUrlAPI on the provided URL - Extracts the page title, description, and body as clean markdown
- Falls back to Firecrawl’s
extractAPI if any field is missing from the scrape response - Returns the structured result into the AI’s context
URL Retrieval does not stream intermediate results. The AI waits for Firecrawl
to return content before generating a response.
Usage
Paste any URL directly in the chat message:“Summarize https://example.com/article”
“What does this page say about pricing? https://example.com/pricing”The AI will read the page and respond based on its content. No special syntax is required — the model invokes the tool when it determines a URL is present and content retrieval is appropriate.
Tool Output
The tool returns a structured result:Configuration
| Setting | Value |
|---|---|
| Config key | features.urlRetrieval |
| Required env var | FIRECRAWL_API_KEY |
| Tool name | retrieveUrl |
| Tool file | apps/chat/lib/ai/tools/retrieve-url.ts |
Customization
The tool description controls when the AI decides to invoke it. Editapps/chat/lib/ai/tools/retrieve-url.ts to adjust: