🧪 Automate your Document Management with ChatGPT: How to Create a GPT that Interacts with Athento step by step

🤖Learn how to automate document management with ChatGPT by integrating it with Athento. Save time, reduce errors and improve your processes 🚀#Automation #ArtificialIntelligence.
Automatiza tu Gestión Documental con ChatGPT: Cómo Crear un GPT que Interactúe con Athento paso a paso / Automate your Document Management with ChatGPT
Picture of Veronica Meza

Veronica Meza

Document management with ChatGPT represents a quantum leap in how we interact with information systems and automate key tasks. On this occasion, we explore an exciting digital transformation project: the creation of a customized GPT that interacts with Athento -your intelligent document management tool– to facilitate our daily tasks. Through a specific case study, we will demonstrate how this tool can be adapted to various applications. Imagination sets the limit!


The example use case of Document Management with ChatGPT

Let’s imagine that we use Athento as a customized CRM for our company. In Athento, we store information about sales opportunities, proposals sent and the follow-up done. And to store that information, we use an “Opportunity” form. As we are going to see, this implementation represents a clear example of how to apply document management with ChatGPT to enhance business processes.

Our goal is to create a wizard that helps us to progress and better qualify these business opportunities, while simplifying the account tracking process.

This use case is just an example. You can define your own use case based on your processes, types of content stored and other factors specific to Athento. Learn more about the AI applications you can already use in Athento.

Below is the diagram describing the integration.

Automatiza tu Gestión Documental con ChatGPT

Athento has native integration with OpenAI, which will also allow you to use ChatGPT functionalities from within Athento. This connection enhances document management with ChatGPT by allowing contextual queries, information analysis and task automation directly in the document platform.

In this case, the integration is the other way around. We will use information stored in Athento in ChatGPT.


A little context…🧠 What is a Custom GPT and how does it work?

A GPT Custom is a customized instance of the OpenAI language model (ChatGPT), designed to fulfill a specific function within an organization. When applied to document management with ChatGPT, the model adapts to the document logic, providing accurate responses based on metadata, forms and stored documents.

Unlike the base model, a GPT Custom can:

🔧 1. Incorporate internal knowledge

You can upload documentation, technical manuals, policies or any text that you want the GPT to “know”. These documents are indexed and become part of the context that the AI uses to respond.

⚙️ 2. Connecting to systems via APIs

By defining custom actions, you can make the GPT:

  • Query databases.
  • Make REST calls (GET, POST, PUT, DELETE).
  • Execute business logic from tools such as Athento, CRMs, ERPs, etc.

🧠 3. Have personality and context of use

The behavior of the GPT is also adjusted. You can:

  • Set tone, writing style, language.
  • Limit what you can do or respond to.
  • Prioritize objectives: inform, assist, execute, etc.

🔍 What makes it different from a traditional bot?

While a classic chatbot works with rigid flows and predefined responses, a GPT Custom:

  • ✅ Understands natural language.
  • ✅ Generates free text adapted to each context.
  • ✅ Learns from your documents and operating context.
  • ✅ Is easier to scale and maintain (less code, more configuration)

💡 Technical overview:

A Custom GPT is a configurable wrapper on top of OpenAI’s GPT-4 model, with contextual memory, plugins connected via HTTPS to external systems, and controlled access to private knowledge sources.

Important: Custom GPTs are a paid functionality, which can be made public, or shared only with users of your choice.



🛠️ How we build the GPT step by step

On the left side of the screen, you have the Explore GPTs option. Click on it.

Automatiza tu Gestión Documental con ChatGPT

Once there, click on the Create option.

Automatiza tu Gestión Documental con ChatGPT

Configuring the GPT options

Next, OpenAI will show us a series of options that we will proceed to configure:

Automatiza tu Gestión Documental con ChatGPT

🔖 1. Description

Text that defines in a single sentence the main function of the GPT. It is the first thing users will see.

Recommended example:

This GPT is designed to help sales teams qualify opportunities, generate personalized emails, query opportunities from the API and recommend the best next action.

🧾 2. Instructions

This is the configuration that defines how the GPT should behave: pitch, targets, what it can or cannot do, etc.

Example of instructions:

This GPT is designed to assist in lead qualification and determine the best next action for each lead. It analyzes responses, suggests strategies to advance the sales cycle and writes effective emails to move the lead to the next stage. 
Also provides insights on lead quality and helps optimize the conversion process.

Tone: Professional, persuasive, direct and results-focused.
Must use knowledge of Athento, business qualification criteria and product functionality.
May consult the Athento API for real-time feedback on opportunities.
If unable to perform an action, suggests alternative steps.

💬 3. Conversation starters

These are examples of input that the user will see when starting the GPT.

They serve as a starting point or inspiration for what can be asked of the GPT.

Examples of conversation starters:

  • “Rate this business opportunity to see if I should advance to demo.”
  • “Write me an email for a lead that showed interest but hasn’t responded.”
  • “What next step should I take with this account?”
  • “What pricing plan fits this opportunity?”
  • “Check with Athento to see if we have already sent proposal to this company”
  • “Retrieve the opportunity from the company…”

📚 4. Knowledge

📥 What documents can help the GPT have a better context and respond better?

Here we upload materials that the GPT should know and use as context.

In the case of the example, we can upload documents such as:

  • 🧩 Business Qualification Template.
  • 📄 Athento technical description.
  • 📌 Functionality guide
  • 💸 Pricing and plan guide

💡 Tip: It is best to upload documents in accessible text format (PDF, .docx or markdown).

🧠 5. Capabilities – What can your GPT do?

Capabilities allow you to enable advanced functionality that extends the capabilities of the GPT beyond text processing. Below, we explain each of these capabilities.

🌐 Browsing (Real-time web browsing).

Allows the GPT to search the Internet or query web pages in real time for fresh information.

When to enable it?

  • When the assistant needs changing public data (news, prices, links, online documentation).
  • Useful for research assistants or updated content.

 

To consider if you activate this capability:

  • GPT slows down.
  • You will have potential access to unverified sources.

 

📊 Code Interpreter (or Advanced Data Analysis / Python sandbox)

Allows the GPT to run Python code to:

  • Analyze data (CSV files, Excel…).
  • Make calculations, graphs, statistical analysis.
  • Generate PDFs or process structured text.

 

When to activate it?

  • If you are going to analyze massive files with structured data.
  • To automate ROI calculations, performance analysis, etc.

 

🎨 DALL-E / Image Generation

Allows GPT to generate images through text, using the DALL-E model.

When to activate it?

  • If you are creating a wizard that needs to generate visual presentations, illustrations or rapid prototypes.
  • For example: marketing, design or education wizard.

🔌 6. Actions

Allow the GPT to make calls to external services defined by you (for example, to Athento’s REST API). This is the capability that really takes document management with ChatGPT to another level by allowing the GPT to read or write real data into Athento, for example:

  • Search for documents (in this case opportunities).
  • Query fields or metadata.
  • Get files or execute transitions.
  • Even, create documents or comments.

 

How it works technically:

  • You define an OpenAPI file or manual endpoints.
  • Authentication is configured (Bearer token, Basic Auth, etc.).
  • The GPT receives and processes the response as JSON and can use it in its reasoning or redaction.

How do we generate the actions that the GPT can do in Athento?

In the ‘Actions’ we are going to stop more because this is where the real power of the theme is. Fortunately, there is a specific OpenAI GPT that you can use to generate the OpenAPI file that is required. The GPT is called ActionsGPT.

Automatiza tu Gestión Documental con ChatGPT

I anticipate that you will have to be patient in this step, as you will have to refine the file as you test the actions. Do not despair!

Create a new action

In the ‘Actions’ section, click on the button to create the new action:

Automatiza tu Gestión Documental con ChatGPT

You will see a screen like this.

Automatiza tu Gestión Documental con ChatGPT

Below the schema, you have the button to open the ActionsGPT.

Authentication

Although Actions support other types of authentication, for simplicity in this tutorial, we will use BasicAuth.

Automatiza tu Gestión Documental con ChatGPT

In API Key we will pass the user and password in user:password format in base64.

Schema

Create this file with the help of ActionsGPT. I found it easier to work in JSON although other formats are supported. At the time of this tutorial, the OpenAPI 3.1 specification was used.

You can give the ActionsGPT the instructions in natural language and it will generate the code, although sometimes the generated code is incompatible with the OpenAPI specification. In that case, you simply tell it the error and the GPT will try to solve it.

Next, we review the main components of the OpenAPI to be generated.

In our example case, the code defines two Athento API endpoints to use from a GPT:

/search/query/ → we will use it to search for opportunities with an ATQL query.
/file/{uuid}/ → we will use it to query the full details of a specific opportunity.

You can use any of the Athento API V1 services.

At the beginning of the schema we will have general information about it:

Automatiza tu Gestión Documental con ChatGPT

Then we will have the servers section that defines the base server where the API lives. All the paths in paths are built on this base URL.

"servers": [

    {

      “url”: “https://mycompany.athento.com/api/v1”

    }

  ],

 

In the “paths” section, you define the endpoints that the GPT will be able to use. For example, here is the complete code for the search endpoint.

"/search/query/?fetch_mode=extended": {

      “post”: {

        “operationId”: “searchOpportunities”,

        “summary”: “Buscar oportunidades en Athento”,

        “description”: “Convierte la consulta en lenguaje natural a ATQL. Si el usuario pregunta por la oportunidad de la empresa Acme, genera: SELECT * FROM oportunidad WHERE metadata.nombre_empresa ILIKE ‘%Acme%’.”,

        “requestBody”: {

          “required”: true,

          “content”: {

            “application/json”: {

              “schema”: {

                “type”: “object”,

                “properties”: {

                  “query”: {

                    “type”: “string”,

                    “description”: “Consulta ATQL generada automáticamente.”,

                    “example”: “SELECT * FROM oportunidad WHERE metadata.nombre_empresa ILIKE ‘%Acme%'”

                  }

                },

                “required”: [“query”]

              }

            }

          }

Let’s explain this code a little more in detail.

1. /search/query/?fetch_mode=extended

  • Method: POST
  • operationId: “searchOpportunities” ← This is the name that the GPT will use internally
    Function: Search for opportunities from an ATQL query automatically generated by the GPT.
    Request body:
  •  

{

  “query”: “SELECT * FROM oportunidad WHERE metadata.nombre_empresa ILIKE ‘%Acme%'”

}

As you can see, in the body of the request, we search for the opportunity by company name.

The magic

Of course, if this GPT is going to be used by a marketer, we can’t expect them to ask us in ATQL about opportunities. This is where we are going to see the magic and power of GPT. In this example, the “magic” of document management with ChatGPT lies in how the model can convert a simple natural language query into a technical request compatible with the document system. This reduces technical barriers and expands access to key stored information.

On a technical level, the “magic” is not so much in the API endpoint, but in how we define the operationId and its description within the OpenAPI plugin, in addition to what we put in the GPT instructions.

🔍 Where are we telling it to translate to ATQL?

In the JSON, this is in the description field of the /search/query/ endpoint:

"description": "Converts the natural language query to ATQL. If the user asks for the Acme company opportunity, it generates: SELECT * FROM opportunity WHERE metadata.company_name ILIKE '%Acme%'."

This text acts as a semantic instruction for the model. GPT interprets it as a rule that must be followed to correctly use that action.

🧠 How does the model understand it?

When you define a plugin, OpenAI combines:

  1. 🔧 The definition of the endpoints (OpenAPI).
  2. 🧾 The instructions of the system (Instructions).
  3. 💬 What the user says at the prompt.
  4. 💡 The context of the previous conversation.

 

GPT evaluates the user’s intent and, if it detects that you are looking for something that can be solved with the defined endpoint (for example, “show me Acme opportunities”), it automatically prepares the query in ATQL, according to the example you gave it.

 

PRO Level Tip

In the path we use for the search of opportunities, we are using a very powerful API V1 parameter /?fetch_mode=extended

This parameter allows us to retrieve the complete information of the opportunity. For example, if we have economic offers associated, the GPT will now be able to read them and we will have a fantastic context that will help the agent to be more precise in what we are asking for.

Also, I recommend that when you are building your OpenAPI, you upload to the ActionsGPT an example of the response you are going to get with each service call. It will use this information to better describe and process the response.

See your GPT in Action

It is very important to test and refine your GPT. You will probably have to adjust your scheme many times until you get the expected result. The actions offer a debug mode, which will facilitate testing. Once the tests return a satisfactory result, you can save your GPT and start using it. Below, in this video, you can see the example case GPT in action:

This type of implementation demonstrates that document management with ChatGPT is not just a trend, but a natural evolution in the digitization of processes. Organizations that integrate AI into their document flows will be better positioned to scale, innovate and compete in the digital era.

Do you want to optimize and modernize your document management model? Discover how to implement your own GPT in Athento and transform the way you interact with your documents.

💬 Do you have doubts or want a demo? Write us and start your way to intelligent automation!

Accede al asistente legal de IA

Déjanos tus datos y te enviaremos el acceso por email

De conformidad con el art. 13 del RGPD y el art. 11 de la LOPDGDD, tus datos personales van a ser tratados por ATHENTO EUROPA S.L. con la finalidad de atender las consultas realizadas por los usuarios, siendo el consentimiento nuestra base legal para el tratamiento de tus datos personales. Sólo trataremos los datos que nos proporciones y podrán ser cedidos a terceros para poder cumplir la finalidad, como a ActiveCampaig u Open AI. Existen automatizaciones a través de Open AI, no obstante, hay intervención por lo que no se trata de decisiones automatizadas. Puedes ejercer tus derechos de acceso, rectificación, oposición, supresión, portabilidad y limitación de sus datos de carácter personal a través del email: dpo@athento.com. Puedes consultar la información adicional y detallada sobre Protección de Datos en nuestra Política de Privacidad.