<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: gcrawl ai</title>
    <description>The latest articles on DEV Community by gcrawl ai (@gcrawl_ai).</description>
    <link>https://dev.to/gcrawl_ai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4125537%2F4912a460-f357-41a0-ac94-cfa4edfe0ef3.jpg</url>
      <title>DEV Community: gcrawl ai</title>
      <link>https://dev.to/gcrawl_ai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gcrawl_ai"/>
    <language>en</language>
    <item>
      <title>Give Your AI Chatbot Real-Time Web Data with GcrawlAI</title>
      <dc:creator>gcrawl ai</dc:creator>
      <pubDate>Fri, 09 Oct 2026 10:02:36 +0000</pubDate>
      <link>https://dev.to/gcrawl_ai/give-your-ai-chatbot-real-time-web-data-with-gcrawlai-2dnf</link>
      <guid>https://dev.to/gcrawl_ai/give-your-ai-chatbot-real-time-web-data-with-gcrawlai-2dnf</guid>
      <description>&lt;p&gt;Language models have a training cutoff, so they guess when asked about prices, news or product changes. Give your chatbot a web tool and it can look things up, read the page and answer with a source. This guide adds that tool in a few lines.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Expose GcrawlAI as a tool&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Define one function the model can call. It searches, reads the top results and returns clean text.&lt;/p&gt;

&lt;p&gt;`python&lt;br&gt;
import os, requests&lt;/p&gt;

&lt;p&gt;API = "&lt;a href="https://api.gcrawlai.com/v1" rel="noopener noreferrer"&gt;https://api.gcrawlai.com/v1&lt;/a&gt;"&lt;br&gt;
HEADERS = {"Authorization": f"Bearer {os.environ['GCRAWLAI_API_KEY']}"}&lt;/p&gt;

&lt;p&gt;def gcrawl(endpoint, payload):&lt;br&gt;
    r = requests.post(f"{API}/{endpoint}", json=payload, headers=HEADERS, timeout=60)&lt;br&gt;
    r.raise_for_status()&lt;br&gt;
    return r.json()&lt;/p&gt;

&lt;p&gt;def web_lookup(query, k=3):&lt;br&gt;
    hits = gcrawl("search", {"query": query, "limit": k})["results"]&lt;br&gt;
    out = []&lt;br&gt;
    for h in hits:&lt;br&gt;
        md = gcrawl("scrape", {"url": h["url"], "formats": ["markdown"]})["markdown"]&lt;br&gt;
        out.append({"url": h["url"], "text": md[:3000]})&lt;code&gt;&lt;br&gt;
    return out&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Decide when to search&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Not every message needs the web. Let the model call the tool only for fresh or factual questions.&lt;/p&gt;

&lt;p&gt;Search for prices, availability, news and recent releases&lt;br&gt;
Skip search for greetings, coding help and general knowledge&lt;br&gt;
Scrape a specific URL directly when the user pastes a link&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ground the answer and cite&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Pass the returned text back to the model and instruct it to answer only from that text. Show the URLs to the user so they can verify.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python&lt;br&gt;
def chat(user_msg):&lt;br&gt;
    if needs_web(user_msg):                      # simple classifier or model tool-call&lt;br&gt;
        ctx = web_lookup(user_msg)&lt;br&gt;
        return ask_llm(f"Answer from this context only and cite URLs:\n{ctx}\n\nQ: {user_msg}")&lt;br&gt;
    return ask_llm(user_msg)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note: Cache results for a few minutes. Repeated questions then cost nothing and respond faster.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Combine with your own knowledge&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use your indexed docs from the &lt;a href="https://gcrawlai.com/usecase/onboarding" rel="noopener noreferrer"&gt;onboarding &lt;/a&gt;assistant for product questions and live web search for everything else. For long multi-step questions, hand over to a &lt;a href="https://gcrawlai.com/usecase/deep-research/" rel="noopener noreferrer"&gt;deep research agent&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
