Table of contents
Official Content
  • This documentation is valid for:

When you interact with a RAG Assistant —either from the Workspace or via API using the Chat API (as shown in RAG samples with Chat API)— the response may include references to the documents used to answer your query.

This article explains how to access those documents, either from the Workspace or via API, provided you have the appropriate permissions.

URL format

Each document can be accessed through a unique URL using its documentId. The base format is as follows:

BASE_URL/v1/document/{documentId}

If the consumer has the required permissions, the file can be accessed from both the Workspace and the RAG Document API. Otherwise, an error message will be returned.

When the consumer interacts with the RAG Assistant through the Workspace, this link appears as a clickable item below the response, labeled with the document's name (e.g., “IRT”):

DocumentURLsRAGAssistants

Clicking on this link opens the document in a new browser tab using the following URL format:

BASE_URL/v1/document/{documentId}/view

Depending on the file extension and browser settings, the file will be either displayed in the browser or downloaded:

  • Files such as .txt, .csv, .json, .pdf, and images (.png, .jpg, etc.) are typically displayed directly in the browser.
  • Other types may trigger a download.

For example, when the consumer clicks on the document labeled "IRT" (as shown in the previous image), and the file has a .txt extension, it is displayed in the browser as shown below:

DocumentURLsRAGAssistants1

Viewing the processed version

Each document uploaded to a RAG Assistant is automatically processed and split into fragments (chunks) for retrieval purposes. The processed version of the document is available through a specific URL. Its format is as follows:

BASE_URL/v1/document/{documentId}/processed

If you're already viewing the document in the browser —at BASE_URL/v1/document/{documentId}/view, as shown in the image above— and want to inspect its processed version, you'll need to modify the URL manually. Simply replace /view with /processed. If you have the necessary permissions, the browser will automatically redirect you to:

BASE_URL/v1/document/{documentId}/view/processed

The following image shows the result of making this change (manually replacing /view with /processed):

DocumentURLsRAGAssistants2

This view reflects how the document was parsed and structured into chunks for retrieval. In this case, only one chunk is shown. The content is displayed in JSON format, including the extracted text (pageContent) and its associated metadata.

Advanced

The behavior for serving documents is controlled by the following System parameter:

  • RAG_DOCUMENT_SERVICE (Default: 1):
    • Set to 1 (or enabled) to use the RAG Document Service for serving the file. (This is the default behavior.)
    • Set to 0 (or disabled) to serve the file directly from the Document Storage location.

You can override the default setting by creating a new parameter with the same name (RAG_DOCUMENT_SERVICE) at the Organization or Project level, specifying a different configuration.

Last update: December 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant