Publicado em Aug. 18, 2022


The tax area needs automation, learn about a success case with Machine Learning


Currently, Artificial Intelligence (AI) is already applied in several functional sectors of wholesale and retail companies. However, the fiscal area still lacks automation, making operability difficult and, consequently, productivity. For this reason, new tools have been made available on the market, with AI being the pinnacle of technology.

Unsurprisingly, the wholesale and retail sector is required to comply with numerous tax obligations, namely, tax payments, compliance with ancillary obligations, issuing tax coupons, fiscal inventory control, among others. 

On the other hand, the level of demand, applied to the regulatory-tax complexity, causes serious problems for business prosperity, essentially in Brazil. The high cost of tax bureaucracy is automatically passed on to products and services, considerably reducing competitiveness.

In this sense, the World Bank reveals that the time spent by companies with tax obligations on Brazilian soil varies from 1,483 to 1,501 hours/year. In addition, in a survey carried out by the Brazilian Institute of Planning and Taxation (IBPT), it was found that there are more than 97 ancillary obligations in force in Brazil (set of documents, records and statements that are sent to the Tax Authorities), culminating in the of more than R$ 60 billion per year to maintain personnel, systems and equipment to monitor changes in legislation.

In this way, the implementation of technologies capable of acting beyond human activity has never been so necessary, guaranteeing the reliability of operations and reducing the time spent on tax obligations.


The wholesale and retail sectors, today, incur different expenses in the hiring and maintenance of professionals able to deal with the most diverse tax obligations. Noteworthy, for example, are accountants, tax analysts, tax auditors, as well as tax lawyers, etc.

This is because, in addition to more than 97 ancillary obligations to the main taxes (a set of documents, records and statements that are sent to the Tax Authorities), there is a need to control fiscal stock, in order to avoid any assessment by the Federal Revenue Service. from Brazil (RFB).

As a result, approximately R$ 60 billion/year is spent on the maintenance of personnel, systems and equipment to monitor changes in legislation.

Given this scenario, it is clear that Artificial Intelligence came to meet the fiscal needs of the wholesale and retail sector, automating all processes, either by the abrupt decrease in human activity, or by reducing the time taken in compliance by more than 90%. of ancillary tax obligations. 


Given the enormous amount of accessory obligations, in addition to those arising from fiscal stock control, it is clear that the human contribution to the fiscal sector, at the moment, becomes essential and unavoidable.

However, this circumstance undoubtedly leads to procedural delay, a high number of errors and uncertainties when complying with these obligations, in addition to the consequent difficulty of corporate cash flow control.

Thus, the allocation of Artificial Intelligence is the cause of the competitive differential for the company that benefits from it. This is because, with this technology, tax processes become more reliable and faster, bringing clarity and certainty to entrepreneurs of the costs involved in the operation, also making it possible to plan the company's cash and the destination of investments.


result of the Brazilian tax complexity, risks in non-automated operations are predictable, but not 100% valid.

For this reason, based on the preventive work of AI, in which all items of each coupon or invoice are detected in detail, in line with tax obligations, it is possible to fulminate the repressive action of the Tax Authorities. 

This is because Artificial Intelligence can predict and avoid numerous situations capable of giving rise to fines, fines, stock attachment and operation stoppage. Consequently, AI is able to guarantee legal and factual security to the entrepreneur, the company, employees and customers themselves, contributing to the benefit of the entire production chain.


To illustrate the potential of Artificial Intelligence in the wholesale and retail sector, it is interesting to analyze a real case audited by TAK.

This is the tax subpoena, by SEFAZ, for errors in the fiscal stock of the company MAC Supermercados Ltda. 

In this case, a short period of 10 (ten) days was opened for the company to carry out an analysis of the 5 (five) retroactive years of the fiscal stock itself, whose value of the assessment was close to a few million reais.

However, given the volume of data, it became impossible, by human hands, to carry out such an analysis in record time.

The company then decided to contact TAK. That's when Artificial Intelligence came into action, processing, in a few minutes, more than millions of NF-es/NFC-es, in the face of hundreds of millions of items. As a result, TAK was able to fully identify incorrectly entered inputs and outputs, whether by code or conversion and typing factors.

Finally, TAK, after investigating the problem, was still able to adjust all tax obligations and rectify, within the deadline established by the Tax Authorities, such needs. With that, the company MAC Supermercados Ltda was not assessed, avoiding an extremely high financial loss.

Example of the simplest Supervised ML Models used by TAK:


Classification is one of the most important and popular categories of Machine Learning problems and the goal of the algorithm is to learn a general rule that maps inputs to outputs correctly to identification of fraudulent data:

Example: Taxpayers of the same segment with similar size and billing, who collect their taxes in a totally discrepant way.

From these models, each taxpayer can understand how their collection is outside the standard, and thus may be drawing the attention of the tax authorities to themselves.


The KNN algorithm (k-Nearest Neighbors or k-Nearest Neighbors. Its main idea is to consider that the neighboring examples are similar to the example whose information we want to infer, an idea similar to “Tell me who you hang out with and I'll meet you” I'll tell you who you are!", that is, in this model, we can tell the taxpayer in a very simple way, which products are sold together, like, every customer who buys meat consequently buys beer, so he could adjust the store layout leaving both nearby products, and thus substantially increase their sales volume.

There are also several other types of models such as Linear Regression for estimating credits that can be calculated in the future by the taxpayer, PLN (Natural Language Processing) for understanding the legislation applied to each item busy and data informed in the fields of each tax document generated or received by the company.

Tak also includes unsupervised models, for other types of detection methods, specifically for tax credits, which are constantly evolving.


In view of the information presented, which wholesale and retail entrepreneurs are unequivocally aware of, the fiscal area of ​​this productive field needs rapid changes.

In this sense, the application of AI in the tax area is capable of solving all the problems faced by these sectors, whether preventively or repressively.

Thus, TAK, which opened its doors to the world in January of this year and already has more than 20 satisfied customers, including the issuance of certificates of technical capacity, presents itself to the market as an essential tool in wholesale and retail automation. , given that its operation takes place entirely through AI.

1797 reads 287 Likes

About the author

Menndel Macedo

Menndel Macedo


Menndel Macedo possui experiência de mais de 10 anos na área tributária e fiscal, atuando para grandes empresas em todo o Brasil e no exterior, sendo um dos pioneiros na integração entre a prestação de serviços jurídicos e a inteligência artificial para o setor tributário e fiscal, possui especialização em Direito, Estado e Constituição, com MBA em gestão jurídica aduaneira e internacional realizado no Massachussetts Institute of Business - MIB, possuindo grande expertise em tributos federais e estaduais e sua recuperação tributária bem como na regularização fiscal das empresas de todo o Brasil.
Menndel, além de diretor da Menndel & Associados, também é CEO da Tak, empresa de inteligência artificial voltada para otimização fiscal e tributária para os segmentos de atacado e varejo

Read too

1797 reads 287 Likes
Café com o Presidente
Próximo Evento
March 21, 2024

Café com o Presidente

Uma conversa com o Presidente da I2AI - Onédio S. Seabra Júnior - para falarmos sobre os temas mais quentes de Transformação Digital e Inteligência Artificial, num bate-papo informal com