PT EN
Back to site

Appeal Co-pilot — A Real, Substantiated Appellate Brief

Drafting an appellate brief from scratch — identifying the parties, gathering the applicable articles, finding the precedents behind each thesis — consumes hours of the team's most qualified work. The Appeal Co-pilot delivers, in seconds, a complete, real brief ready for filing: with the case's true parties, the applicable legal provisions and the case law associated with each one — not a generic draft full of gaps.

The brief combines three sources:

  1. The case's real parties (appellant, appellee, judges, adjudicating body), read from the correct context database in Neo4j.
  2. The articles of the procedural code applicable to the case — both those cited in the case files and those pertinent on the merits — with the case law associated with each article.
  3. The legal drafting done by an AI model acting as a "learned jurist", guided by configurable instructions.

The result appears in a window in Chat (AnalisarChat) and can be downloaded as Word (.docx). The breadcrumb follows the system standard: DATTA › Analisar › Chat.


How to generate an appeal

The Criar Recurso button appears automatically when you hover over an AI answer that mentions the availability of an appeal — the screen itself recognizes expressions such as "cabe recurso", "apelação", "recurso especial", "agravo de instrumento", "embargos de declaração" or "prazo para recurso".

  1. Click Criar Recurso. The window opens with the loading state: "Gerando o recurso com IA..." and the note "Isso pode levar alguns segundos" — generation involves several analysis steps, so it is not instantaneous.
  2. The platform extracts the case number from the conversation itself and triggers the generation.
  3. When it finishes, the brief is shown in the window with section titles and bold highlights.

The brief follows the standard legal structure: addressing, identification of the parties, timeliness and admissibility, facts, law/grounds — each thesis anchored in an article and a precedent —, requests and a closing with place, date and space for a signature.

The AI is instructed to never invent generic party names (like "EMPRESA XYZ LTDA" or "Fulano de Tal") nor leave [COMPLETAR] markers. If a marker still shows up, it is highlighted in yellow in the text for your review.

Who is the appellant and who is the appellee

Parties reach the model with the procedural role recorded in the graph — ré (defendant), embargante, exequente, procurador (counsel) — and anyone who is merely cited in a document of the case file, without being a party, goes in a separate list labeled as such. Without a recorded role, the prompt says "role not recorded" and the brief qualifies neutrally instead of picking a side. Retained counsel goes in its own list, with the bar number when the graph has it, and a legend explains the roles to the model: procurador and ministerio_publico are representatives of a public body (Treasury, federal prosecution) and do not sign for the private party; judges and the deciding court are never parties nor appellees — the appellee is always the opposing party. Missing data (tax id, address, bar number) never becomes a placeholder of any form: the sentence is written without it. If the model still writes one — [informar], [data da publicação], any text in square brackets — the screen highlights it in yellow, as it already did with [COMPLETAR]. The same entity read from different documents ("… Ltda. - ME" and "… LTDA") reaches the model as ONE party with its roles merged, not as two parties on opposite sides.

Until 2026-09-11 parties went in as flat lists of names and the model decided who was who: in a TRF4 rescissory action, three counsels for the Union and a person merely mentioned in an order came out as "Appellant" in the brief.

A whole brief, never silently cut

The brief asks the model for its own text budget (16k tokens) and an explicit reasoning budget. If the provider still stops at the token limit, the platform asks for one continuation from the last character written and joins both parts; if even the continuation does not finish, the brief ends with a "ATENÇÃO — peça incompleta" (brief incomplete) warning so you review the closing before filing.

Until 2026-09-11 the cut was invisible: the request's 8k tokens were shared with the model's reasoning (on Gemini 3.x it counts against the same cap), and the AI service declared the response complete. An embargos brief came out ending in "precedente inv", with no warning at all.

When the case does not admit an appeal

Screening records, on every case, whether the report recognised grounds for appeal. When it states there are none — a case that reached final and unappealable judgment, for instance — generation is refused, and the window shows the reason instead of producing the document:

Grounds not recognised. The analysis of this case recorded: "Transitado em julgado".

The refusal is not a dead end: the footer offers Gerar assim mesmo next to Cancelar. Whoever confirms gets the document with a warning stamped at the top — and it travels inside the .docx too, not only on screen, so that nobody files a document without knowing the platform itself did not recognise the grounds.

Why it exists. Until 2026-09-10 the platform generated any appeal type for any case, with no criticism. In an audit of six documents generated for the same case that had already reached final judgment, all six came out normally — including an appeal against a judgment that does not exist. The grounds data already reached the service; nothing read it.

When the platform cannot read the case file

There is a second reason for refusal, and it says nothing about grounds: the platform could not read the case. Either it is in no context database, or the read failed. Either way generation is refused, with the matching remedy — check the number and ingest the file, or try again shortly.

This refusal also has a way through: Gerar assim mesmo produces the document, stamped with a stronger warning than the grounds one — nothing in it was checked against the case file: parties, ruling, timeliness and grounds. It is a draft of an argument, not a document ready to file.

Why it exists. The grounds gate reads the field screening writes on the case. A missing field means "screening did not assess it" and generation proceeds — which is correct for a case not yet screened. The problem was that "not assessed" and "could not read the case" reached the gate identically. Measured on 2026-09-10: the case query timed out, the failure was swallowed, and the document came out for a case that had reached final judgment — with no parties and no ruling, because the case data was precisely what had not been read. A read failure does not authorise a write.

Giving up mid-generation

The document takes a while to be drafted. While you wait, the dialog's X — and a click outside it — cancel the generation: the call is genuinely aborted, not merely hidden. The footer button also changes its label to Cancelar geração for the duration.

Until 2026-09-10 those controls were disabled during generation in the process panel, and in Chat they closed the window without cancelling the call — which ran to the end, consuming the generation limit and creating a document nobody wanted any more.

Choosing the appeal type

In the window footer, a selector defines the appeal type. The choice guides both the identification of the applicable articles and the drafting of the brief. The initial default is Apelação.

Displayed optionInternal value
ApelaçãoApelacao
Recurso EspecialRecursoEspecial
Recurso ExtraordinárioRecursoExtraordinario
Agravo InternoAgravoInterno
Agravo de InstrumentoAgravoDeInstrumento
Embargos de DeclaraçãoEmbargosDeDeclaracao

Downloading as Word (.docx)

Once generation is complete, the Baixar Word (.docx) button becomes available in the footer. The file is a real .docx, produced on the server — without depending on external libraries in the browser — with:

  • a centered bold title (appeal type + case number);
  • section headings, inline bold, lists and justified paragraphs.

The file name follows the pattern recurso-<numero-do-processo>.docx. The conversion to .docx reuses the text that was already generated: it does not call the AI again, it is formatting only.

Nothing is lost: if the .docx download fails for any reason, the platform still delivers the content as a .md (markdown) file.

When the environment has Google credentials configured, the Abrir no Google Docs button also appears, leading to an editable copy of the brief in Google Docs. Without those credentials nothing breaks — the text and the .docx download work normally, with no error and no blocked functionality.

Continue in Chat — a conversation starting from the case

When the conversation is born from the case detail panel (the Continuar no Chat button), the AI's answers come as clean text, without the structured document cards that appear in normal search — the focus stays on the case analysis and on the decision to generate the appeal.

In this mode the answers also arrive complete, without the "Expandir" control, so reading the context and deciding are straightforward.

Hands-on example

  1. In the case screening, the case shows up with the appealability field filled in — "Apelação", for instance. Click Continuar no Chat.
  2. Ask the AI: "Quais são os fundamentos para recorrer da sentença?" On the answer, hover and click Criar Recurso.
  3. Wait for the generation and check in the footer that the type is Apelação.
  4. Review the brief — real parties, theses anchored in articles and precedents — and click Baixar Word (.docx) to finish it in your editor.

Configuring the behavior (admin)

The drafting instructions currently apply from the built-in default — one that already requires a complete brief, real parties and zero pending markers.

The tuning screen is gone; the prompt stayed. Until 2026-08-23 the instructions were editable in Sistema › Co-pilots, a screen removed when DATTA Captain replaced the operating copilots. The saved text is still stored and still read when the brief is drafted — anyone who had a customization keeps it, anyone who did not stays on the default.

And the prompt gained a second reader: when DATTA Captain plans an operation for a reasoned brief, it receives this same text as domain knowledge — to gather the right inputs before firing. It does not draft the brief: this service still does that.

The procedural code database from which the articles and case law come, and the context database where the case is stored, are resolved dynamically from the context's settings, never fixed in code. Each context can point to the appropriate procedural code (e.g. CPC, CPP).

Always a clear answer

The feature handles every scenario without exposing technical messages:

  • Loading — "Gerando o recurso com IA..." while the brief is produced.
  • Generation failure — a message in Portuguese inside the window itself: "Erro ao gerar o recurso. Tente novamente."
  • No connection to the service — "Não foi possível conectar ao serviço. Verifique se o sistema está disponível."
  • Usage limit reached — appeal generation has a lower hourly limit than regular chat, because it consumes a lot of AI processing. When it is exceeded, you are warned in a friendly way and can try again later.
  • Case without data or without parties — when the case number is not found in any context database, the brief is drafted in a legally neutral way, without inventing names; review the result before filing.

How it works under the hood (summary)

For administrators and technical teams:

  • Generating the brief and converting it to .docx both require the CHAT_SEND permission.
  • Generation is limited to 20 calls per hour per user by default, configurable in SistemaGeral.
  • The generation flow fetches the case from Neo4j, sweeping the context databases until the number is found; identifies the applicable articles (those cited in the text plus the ones pointed out by the AI); fetches articles and case law from the context's procedural code database; drafts the brief with the AI, removing any conversational preamble; and, optionally, creates the copy in Google Docs.
  • Appeal generation is also available through the API — see the API reference.

Related documents: Case Audit Detail (the source of the final decision and appealability fields) and Search and Chat.