# Use case – Automatic update: your Agent always connected to the web

AIsuru offers the powerful ability to enrich your Agent's conversations with real-time information from external websites. This feature lets your virtual assistant provide up-to-date data on a variety of topics, significantly improving the quality and relevance of interactions.

In this guide, we'll walk through a concrete implementation example: we'll create a function to retrieve and analyze HTML content from a web page in real time. This lets us process the HTML code and extract useful content through generative AI.

### Implementing a function to retrieve live web content

Let's walk step by step through creating a function that retrieves HTML content from a website and analyzes it:

1. **Access and creation**
   * Go to your Agent's management panel in AIsuru;
   * Navigate to "Functions" > "Advanced functions";
   * Click "New function".
2. **Function configuration**
   * **Name**: give your function a short but descriptive name (e.g. site\_questions — no spaces);
   * **Description**: copy and paste this description: "This function retrieves the HTML content of a specific web page. Use it when a user asks for information or updates from a particular website."
   * **Webhook**: enter the link to the page to analyze;
   * **HTTP method**: use the already-selected GET method.
3. **Testing the function**
   * Scroll to the bottom and press Test > Run;
   * Verify the function works: you should see the page's HTML code as the response.

✅ If everything looks good, you can save your function.

#### Integrating into the Agent's instructions

Now that your function is ready, you'll need to add it to the Agent's Instructions:

1. Go to your Agent's Settings > AI > Instructions;
2. Add these instructions:

```
You are an assistant specialized in analyzing web content in real time. When a user asks for information from a specific website:

1. Use the [function name] function with the page URL as a parameter;
2. Analyze the received HTML content and extract the relevant information;
3. Present the information clearly and concisely, organized in an easy-to-read format;
4. If requested, provide further details or in-depth information about the analyzed content.
```

### Practical example: the Verona Municipality blog

Let's look at a concrete example of how to use this function to create an Agent that shows users real-time articles from the Verona Municipality blog.

#### Specific configuration:

* **Name**: comune\_verona\_blog
* **Description**: "Use this function when the user asks for content from the Verona Municipality blog. Analyze the information to respond clearly and in an organized way."
* **Webhook**: <https://www.comune.verona.it/nqcontent.cfm?a\\_id=70461>

{% hint style="warning" %}
**Always respect the terms of service of the websites you intend to analyze**.\
\
If the Agent can't extract the information, make sure you're not exceeding the [context window](https://github.com/memori-ai/docs/blob/main/en/generative-ai/advanced/providers-api-keys/providers.md#what-is-context) (if the page is particularly long and complex) and that the site's robots.txt file isn't blocking access to the language model.
{% endhint %}

#### Specific instructions for the Agent

Add these specific instructions to the Agent's prompt:

```
You are an assistant specialized in the Verona Municipality blog. When a user asks about recent articles:

1. Use the comune_verona_blog function to get the HTML content of the blog page;
2. Analyze the content and extract titles and short descriptions of recent articles;
3. Present an organized list of articles to the user, including the title and a brief summary for each;
4. Offer to provide further details on specific articles if requested.
```

#### Example interaction

> ***User**: "What are the latest articles on the Verona blog?"*
>
> *\[The Agent uses the* comune\_verona\_blog *function]*
>
> ***Agent**: Of course! Let me check the latest updates from the Verona Municipality blog.*
>
> *Here's a list of the most recent articles published on the Verona Municipality blog:*
>
> 1. ***Pre-school: Welcoming children aged 3–6***
>    * *The Municipality announces new initiatives for welcoming children in pre-schools, with a focus on educational activities and socialization.*
> 2. ***City Council: Opening of 2nd session 2024***
>    * *Announcement of the date and agenda for the upcoming City Council session, with discussions on important city issues.*
> 3. ***Tender no. 23/24: Appointment of the evaluation committee***
>    * *Information on the appointment of the evaluation committee for a recent municipal tender, including details on the selection process.*
>
> *Would you like more information on any of these articles in particular, or would you prefer a general overview of recent Municipal activities?*

With this implementation, **your Agent becomes a reliable source of up-to-date information from specific websites**. This web content analysis function is just the beginning: you can apply the same approach to integrate data from various websites, further expanding your Agent's capabilities! 🌟


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aisuru.com/en/advanced-features/integrations/functions/advanced-functions/best-practices/use-case-automatic-update-agent-always-connected.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
