Connect ChatGPT to the Internet
Published: 2023-07-05 14:03:01

As of today we can connect our [ChatGPT-based AI chatbots](https://ainiro.io/chatgpt-website-chatbot) to the internet, allowing you to use our AI chatbot technology to search the internet, and discuss real-time live information from the web with ChatGPT.

From before our [AI chatbots already displays images](https://ainiro.io/blog/the-ai-chatbot-that-displays-images) of course, and hyperlinks, references, lists, emojis, etc. Our new _"browse the web with ChatGPT feature"_ obviously takes advantage of these features.

To understand why this is such a big deal, you can go to [ChatGPT](https://chat.openai.com) and ask it the following question:

> Who won the US Open in 2023

At which point you'll get the following result.

![ChatGPT real live internet data](https://ainiro.io/assets/images/chatgpt-live-internet-data.jpeg)

If you ask our chatbot the following question:

> Find me information for the following query "Who won the US Open in 2023?" and give me a summary with some images

You'll get the following answer:

![ChatGPT connected to the web](https://ainiro.io/assets/images/connect-chatgpt-to-the-internet.jpeg)

Notice, it is important that you start out your question with _exactly_ the following:

> Find me information for the following query "QUERY_HERE"

This is because we're semantically matching your prompt towards our training snippets, where one of our training snippets contains Hyperlambda. This training snippet will kick in for the above sentence as your first hit most of the time, and be dynamically executed and return the result of your search query as _"context"_.

## Implementation

The way it's implemented is to some extent described in our [ChatGPT with real time information](https://ainiro.io/blog/chatgpt-with-real-time-information) article and our [connect ChatGPT to your SQL database](https://ainiro.io/blog/connect-chatgpt-to-your-sql-database) article. And since we already had [ChatGPT with DuckDuckGo support](https://ainiro.io/blog/integrating-chatgpt-with-duckduckgo), and a [kick ass web scraper](https://ainiro.io/blog/have-chatgpt-scrape-your-website) - The rest was just a matter of connecting the dots.

The way it works, is that we've got a training snippet that starts out with the words _"Find me information for the following query"_. This training snippet contains Hyperlambda that basically searches and scrapes the result originating from DuckDuckGo. If you phrase your question such that this training snippet bubbles to the top, it will execute its Hyperlambda, which resembles the following:

Prompt - **Find me information for the following query**

**Completion**

```
{{
.query
strings.split:x:@.arguments/*/prompt
   .:"\""
set-value:x:@.query
   get-value:x:@strings.split/1
unwrap:x:+/*
signal:magic.ai.create-search-context
   query:x:@.query
   max_tokens:int:3500
.result
set-value:x:@.result
   strings.concat
      .:"While searching the internet for \""
      get-value:x:@strings.split/1
      .:"\" the following is what I found:"
      .:"\r\n"
      .:"\r\n"
      get-value:x:@signal
return:x:@.result
}}
```

Once executed the above Hyperlambda will return whatever it found related to your query as Markdown, and us this as a _"context"_ for ChatGPT. This allows ChatGPT to answer your question using real time data from the internet. Notice, only the parts between the double quotes (") will be sent to DuckDuckGo, while the _whole_ question will be sent to ChatGPT. This allows you to ask questions such as for instance:

> Find me information for the following query "Steve Jobs" and show me all images of Steve

Or ...

> Find me information for the following query "Bill Gates" and write a 5 paragraph article about Bill's life

Etc ...

The scraping is done in parallel, and you can configure how many context tokens you want to use, and/or how many results you want to have DuckDuckGo return, etc. The parallel parts makes it surprisingly fast, since it will scrape (for instance) 5 web pages in parallel, and not sequentially, and aggregate the results of your query.

It also keeps the _"source"_ for where it found the data, and will (most of the time) automatically display this. If you must have the source, you can also explicitly tell ChatGPT that it must provide its source.

## Conclusion

This implies that as of today, we can deliver internet access to your ChatGPT AI chatbot if required. The feature is a little bit _"BETA'ish"_ still, and we're still discussing pricing internally, and we'll probably not offer this in our _"basic"_ package, but only from _"professional"_ and up - Since I assume this would be most interesting for our [AI Expert Systems](https://ainiro.io/ai-expert-systems) allowing you to aggregate whatever you can figure out how to search for into your AI querying.

However, if you want to discuss this with us, we'd be happy to [have an email from you](https://ainiro.io/contact-us#demo) and help you out getting a ChatGPT chatbot connected to the web 😊