PT EN
Back to site

CARF Case-Law Ingestion (precedents and rulings)

Paste the address of the CARF case-law section and DATTA brings in every súmula (binding precedent statement) — with the approving body, binding effect, status, subject, panel and founding rulings — plus the rulings with their full text, ready for search and chat. The section of the Administrative Council of Tax Appeals website is not a single page: it is more than twenty HTML pages that repeat and complete each other, plus a set of PDFs. The URL tab of the Upload page recognizes that address and crawls the whole section in the background, with a real progress bar.


What the CARF ingestion does

When it receives https://www.gov.br/carf/pt-br/jurisprudencia (or any page of that section), the platform:

  • crawls every page of the section: the general table "Consolidated Precedents with Founding Rulings", the precedents by subject (personal income tax, corporate income tax, social contributions, statute of limitations, bank deposits, excise and foreign trade, rural property tax, interest and penalties, general tax rules, refund and offset, Simples), the precedents by panel (Plenary and the 1st, 2nd and 3rd panels of the Higher Chamber) and the CARF Rulings list;
  • consolidates each precedent from every page it appears on: the statement comes from the general table; subject and panel come from the grouping pages, which are the only source of those two facts;
  • stores each precedent as a document of the context, with number, approving body and date, effective date, statement, binding effect (and the ordinance that granted it), status (in force or revoked) and the list of founding rulings;
  • stores each ruling of the list as a document, downloading the published PDF and extracting the full text; when the PDF cannot be read, the document keeps the list metadata (number, case, taxpayer and link);
  • stores the ordinances and minutes published alongside the precedents (binding effect, revocations) as normative documents;
  • indexes the full text and the semantic vectors in the context index, with the active embedding model, so everything shows up in Search and Chat;
  • builds the graph: each precedent links to its founding rulings, subject, approving body and binding-effect ordinance; each ruling, when entity extraction is on, gains the parties, norms and topics identified by the model configured for the context.

The load is idempotent: repeating the URL updates what changed and never duplicates — each precedent has a fixed code (CARF_SUM_<number>), as does each ruling (CARF_AC_<number>) and each file (CARF_ARQ_<name>).

What does not come in this way: the complete CARF rulings database (582k decisions) lives in a separate repository outside the case-law section of the portal and is not a page that can be crawled. It is loaded by the Case law — CARF package of Datta Extract, into the same context: the package brings the statement, operative part, rapporteur, judging body and full text of each ruling, embedded in chunks, and enriches the founding rulings this ingestion created. See the administrator guide Case-law sources. The "Binding Opinions" page requires a portal login and is left out.


Before you start

PrerequisiteWhy
Being signed inIngestion requires a valid session.
The Jurisprudência-CARF context registeredThe context defines the graph database, the search index and the prompts (chat, entity extraction and audit) specific to precedents and rulings. It ships in the installer catalog and can also be created in SystemContexts or with the scripts/seed-contexto-jurisprudencia-carf.sh script.
Document upload permission (DOCUMENT_UPLOAD)Without it the operation is denied, with a message in Portuguese.

The registered name is Jurisprudencia-CARF, without the accent, because the context registry only accepts letters, digits, hyphen and underscore; the label shown on screen is Jurisprudência-CARF.


Step by step

1. Open the Upload page

Go to ProcessUpload. The breadcrumb confirms where you are: DATTA › Process › Upload.

2. Choose the target context

In the Target Context block, select Jurisprudência-CARF. Loading the case law into a legislation context (CPC, CDC) would mix precedents with law articles in the same index — always pick the dedicated context.

3. Select the URL tab and paste the address

Paste https://www.gov.br/carf/pt-br/jurisprudencia. As soon as the platform recognizes a CARF address, a note appears under the field saying the whole section will be crawled and that the Article filter does not apply (precedents have no articles).

Any page of the section works as a starting point — for example a subject page (.../sumulas-carf/irpf): the crawl always covers the whole section.

4. Start

Click Load URL. Ingestion starts in the background and you can leave the screen; when you come back, the bar reconnects to the progress.


What happens after you click

The load runs through five phases, reflected in the bar and the live feed:

PhaseWhat the platform does
1. Crawling pagesReads every page of the section (the feed shows each one by name) and consolidates the precedents and the rulings list.
2. Storing precedentsFor each precedent: chunking, vectors, graph document, indexed text, entities (founding rulings, subject, body, ordinance).
3. Storing rulingsDownloads each PDF (up to four in parallel), extracts the full text, stores the document and, if requested, runs entity extraction.
4. Storing normative filesOrdinances and minutes in PDF published alongside the precedents.
5. DoneThe final message says how many precedents, rulings and files were stored and from how many pages — and how many items failed, if any.

The model diagram shows the node types being created (Document, Case law, Topic, Judging body, Norm) and the edges between them.

You can cancel at any time; items already stored remain and the next load resumes without duplicating.


How to query afterwards

  • Search: search by text ("bank deposits of unproven origin") or by number ("Súmula CARF nº 26"). Results show the document type (precedent, ruling or normative act) and the carf source.
  • Chat: with the Jurisprudência-CARF context active, ask "which precedent covers the statute of limitations when there was an advance payment?" or "is Súmula 12 binding?". The assistant quotes the number, the literal statement, the binding effect with its ordinance and the status, and never answers from memory.
  • Graph: the precedent is a Documento of type sumula_carf linked by DOCUMENTO_CITA_JURISPRUDENCIA to each founding ruling, by DOCUMENTO_CITA_TEMA to the subject, by DOCUMENTO_JULGADO_POR_ORGAO to the approving body and by DOCUMENTO_CITA_NORMA to the binding-effect ordinance.
  • Screening: the context is born flagged as a rules corpus. A context of administrative tax cases can declare it among its rules, and the report then checks the filing against the binding precedents in force.

Frequently asked questions

How long does the load take? The precedents (a little over two hundred) take a few minutes. The rulings depend on downloading and extracting the PDFs and on entity extraction by the model; with extraction on, expect tens of minutes.

A precedent came without subject or panel. Those two facts come from the grouping pages of the site, which CARF keeps "under update". A recent precedent may not be listed there yet; the next load fills it in.

I repeated the URL and the number of precedents did not change. Expected: the load is idempotent. It updates the text of what changed and adds what is new; it does not recreate what already exists.

A ruling ended up with metadata only. The published PDF had no extractable text (scan without OCR) or exceeded the configured size limit. The document exists, with the full-text link to open on the site.


Automation and limits

The same load can be triggered by automation, through the same endpoint the URL tab uses: provide the address of the CARF section and the target context (Jurisprudencia-CARF); the response returns the task identifier, used to follow the progress or cancel. The entity-extraction option (on by default) controls whether the context model reads the full text of the rulings. The route, the fields and the response codes are in the URL ingestion API reference, in the API section of the portal.

Limits adjustable through environment variables of the document service: DATTA_CARF_MAX_PAGES (HTML pages, default 80), DATTA_CARF_MAX_PDFS (default 400), DATTA_CARF_MAX_PDF_BYTES (default 30 MB), DATTA_CARF_MAX_PDF_TEXT_CHARS (default 400 thousand characters), DATTA_CARF_DOWNLOAD_CONCURRENCY (default 4) and DATTA_CARF_INDEX_CONCURRENCY (default 6).