> For the complete documentation index, see [llms.txt](https://docs.opencityitalia.it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opencityitalia.it/ai/come-funziona/base-di-conoscenza-e-istruzioni/le-fonti.md).

# Le fonti

Le fonti sono i documenti e i riferimenti che l'assistente consulta quando elabora una risposta. Più le fonti sono complete e aggiornate, più le risposte sono precise e contestualizzate.

<figure><img src="https://793214105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0AdQysODIf5E7oHfQAtY%2Fuploads%2F2k5rfv6kqtQuKllZolEx%2Fimage.png?alt=media&amp;token=0a933493-88ab-4a91-953c-672dd1b8c2ff" alt=""><figcaption></figcaption></figure>

Le fonti possono essere nazionali (normativa rilevante per la PA, linee guida AgID, documentazione sulle principali piattaforme abilitanti) oppure specifiche dell'ente (regolamenti comunali, delibere, circolari interne e qualsiasi altro documento che l'assistente deve poter consultare per rispondere in modo pertinente al contesto locale).

## Aggiungere una nuova fonte

<figure><img src="https://793214105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0AdQysODIf5E7oHfQAtY%2Fuploads%2F9sBHmUImyYgmJhWXrKKi%2Fimage.png?alt=media&amp;token=7539e722-381c-418a-990f-e7deb09dddac" alt=""><figcaption></figcaption></figure>

Per aggiungere una nuova fonte bisogna accedere alla sezione "Knowledge base" nel menu laterale e premere il pulsante "Aggiungi".

La fonte può essere caricata come file, incollata come testo oppure inserita tramite un link a una pagina web. Per ciascuna fonte è possibile indicare una categoria, che determina quali utenti potranno consultarla: alcune fonti sono riservate a specifici ruoli o uffici, altre sono pubbliche e accessibili a tutti gli assistenti attivi sulla piattaforma.

Per tutte le fonti è inoltre possibile specificarne la natura (normativa, atto, pratica, documento interno o risorsa web).

Una volta caricate, le fonti possono essere ricercate tramite una barra di ricerca o filtrate per tipologia e possono sempre essere modificate o rimosse.

## Lo stato di una fonte

Dopo il caricamento ogni fonte ha uno stato, visibile nell'elenco:

* **In attesa**: la fonte è stata caricata e deve ancora essere elaborata.
* **Elaborazione**: l'assistente sta leggendo la fonte e preparandola per la ricerca.
* **Indicizzato**: la fonte è pronta e l'assistente può trovarla e usarla nelle risposte.
* **Errore**: l'elaborazione non è riuscita, per esempio per un problema temporaneo del servizio. La fonte non viene usata nelle risposte: va caricata di nuovo.

Una fonte viene usata dall'assistente solo quando è nello stato "Indicizzato". Lo stesso vale per l'avviso "già in KB" che compare quando si allega in chat un documento già presente nella Knowledge Base: appare solo se la fonte è indicizzata.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.opencityitalia.it/ai/come-funziona/base-di-conoscenza-e-istruzioni/le-fonti.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
