# Minuta Agora — Extended Technical Documentation & Architecture Reference (llms-full.txt) > Comprehensive technical specification, prompt architecture, procedural domain models, and security governance for Minuta Agora (LegalDraft_App). Website: https://www.minutaagora.com.br App: https://app.minutaagora.com.br Publisher: Minuta Agora / LegalDraft Last Updated: 2026-10-13 --- ## 1. System Overview & Philosophy Minuta Agora is an enterprise-grade legal engineering platform built to solve the most critical bottleneck in Brazilian contentious law: the cognitive drain of manual, repetitive legal drafting under extreme deadline pressure (*prazos fatais*). Traditional legal AI tools suffer from three fundamental flaws: 1. **Context Window Starvation & Hallucination:** Generic LLMs cannot ingest 400-page Brazilian case records (*autos processuais*), leading to truncated context and fabricated case numbers. 2. **Robotic, Generic Tone:** Output lacks the attorney's vocabulary, argumentation style, and custom preliminary objections (*preliminares de mérito*). 3. **Format Friction:** Returning raw markdown or unstructured text requires extensive manual formatting in word processors. Minuta Agora solves these issues via: - **Protocol Zero:** End-to-end full docket ingestion up to 1,000 pages with PyMuPDF and Google Cloud Vision OCR. - **Intellectual Style Cloning:** Algorithmic extraction and replication of the attorney's linguistic DNA. - **Native Word (.docx) Generation:** Directly producing ready-to-file documents styled with custom margins, headers, footers, and typography. --- ## 2. Procedural Pipelines & Domain Models ### 2.1 Appeals & Rebuttals Pipeline (*Petições Recursais e Impugnações*) Minuta Agora provides 6 distinct, audited procedural pipelines: 1. **Recurso Ordinário Trabalhista (ro_trab.txt)** - Statutory Grounding: Article 895, I of the Consolidação das Leis do Trabalho (CLT). - Target Tribunal: Tribunais Regionais do Trabalho (TRTs) and Tribunal Superior do Trabalho (TST). - Scope: Complete appeal against trial judgments (*sentença trabalhista*), covering preliminary procedural defects (cerceamento de defesa, nulidade da citação, incompetência material), prescription (prescrição bienal e quinquenal), substantive claims (horas extras, verbas rescisórias, adicional de periculosidade/insalubridade, equiparação salarial), and attorney fees (*honorários sucumbenciais*). 2. **Impugnação à Contestação Trabalhista (imp_trab.txt)** - Scope: Detailed counter-argument against employer defenses, cross-referencing timesheets (*cartões de ponto*), bank statements (*extratos bancários*), and oral deposition transcripts (*depoimentos de testemunhas*). 3. **Apelação Cível (apelacao_civel.txt)** - Statutory Grounding: Articles 1.009 to 1.014 of the Código de Processo Civil (CPC - Law 13.105/2015). - Target Tribunal: Tribunais de Justiça Estaduais (TJs) and TRFs. - Scope: Contractual breach, civil liability (*responsabilidade civil*), consumer law violations (Código de Defesa do Consumidor - CDC), emergency injunction requests (*efeito suspensivo ativo*), and property disputes. 4. **Impugnação à Contestação Cível (imp_civel.txt)** - Scope: Rebuttal of preliminary procedural objections (art. 337, CPC), impugnation of requested free justice (*gratuidade de justiça*), and defense on the merits. 5. **Apelação Previdenciária (apelacao_prev.txt)** - Statutory Grounding: Law 8.213/1991, Decree 3.048/1999, and Federal Court jurisprudence (TNU/STJ). - Scope: Denials of Social Security benefits by the INSS, including BPC/LOAS (art. 203, V, CF/88), disability benefits (*auxílio por incapacidade temporária / aposentadoria por incapacidade permanente*), rural retirement, and special retirement with cross-examination of medical reports (*laudos periciais judiciais e PPP/LTCAT*). 6. **Impugnação à Contestação Previdenciária (imp_prev.txt)** - Scope: Refutation of INSS administrative contestations, administrative preclusion arguments, and medical divergence. ### 2.2 Structured Initial Petitions Pipeline (*Petições Iniciais Estruturadas*) Structured as a four-stage verified pipeline: 1. **Triagem Resiliente (Triage):** - Ingests user input and client interview transcripts. - Pydantic schema validation with tolerant key aliasing (`AliasChoices`). - Extracts: Parties, Jurisdiction, Timeline of Events, Causes of Action, Damages, Urgent Relief Requests. 2. **Auditoria de Provas (Evidence Cross-Examination):** - Matches every factual allegation to supporting documentary evidence. - Generates alerts if a critical claim lacks evidentiary support. 3. **Curadoria e Estratégia Jurídica (Legal Strategy):** - Adapts to the specified legal area (Trabalhista, Civil, Consumidor, Família, Previdenciário). - Identifies competent court jurisdiction (*competência territorial e material*). 4. **Redação Jurídica Exaustiva (Long-Form Generation):** - Produces complete long-form legal argument petitions (typically 12–25 pages in Word) with full procedural compliance with Article 319 of the CPC or Article 840 of the CLT. --- ## 3. Technology Stack & Architecture - **Backend Language:** Python 3.10 / 3.12 (Strict typing: `mypy --strict`). - **Application Framework:** Streamlit (v1.59.0) with custom CSS design tokens (Warm Grid, Slate & Royal Blue), embedded Quill rich text editor, and real-time generation feedback. - **AI Core:** Google GenAI SDK (`google-genai`), default engine `gemini-3.8-flash` executing structured prompts under daily quota tokens. - **Document Ingestion:** - `PyMuPDF` (`fitz`): High-speed vector PDF extraction and layout parsing. - `Google Cloud Vision API`: Fallback optical character recognition (OCR) for low-quality scanned physical dockets. - **Document Output:** - `python-docx` & `htmldocx`: Generates valid Microsoft Word (.docx) files preserving headers, footers, margins, font styles, and firm logos. - **Database & Identity:** - Google Cloud Firestore: Transactional NoSQL with atomic quota reservation and idempotent billing tracking. - Firebase Authentication: OAuth 2.0 (Google login) + Custom Claims for cryptographic role verification. - **Billing & Subscriptions:** - Asaas Payment Gateway REST API + Dedicated serverless Cloud Function (`webhook_asaas/`) with HMAC signature validation. - **Hosting & Infrastructure:** - Google Cloud Run: Production Docker container executing under unprivileged `appuser`. - Firebase Hosting: Fast CDN edge hosting for landing page assets (`public/`). --- ## 4. Security, Data Governance & LGPD Compliance Minuta Agora was architected from inception to adhere to the strictest standards of Brazilian Law (Lei Geral de Proteção de Dados - Lei 13.709/2018): 1. **Ephemeral File Processing:** - All uploaded PDF files, case records, and generated drafts are processed in ephemeral memory. - Files are automatically deleted from memory and storage buckets as soon as the session terminates or generation completes. 2. **Zero Model Training on Sensitive Records:** - Case records and attorney documents are processed through enterprise API tiers with zero data retention for model training. 3. **Fail-Closed Firestore & Storage Rules:** - `firestore.rules` and `storage.rules` both declare: ``` allow read, write: if false; ``` - Client-side browsers are blocked from directly querying database or storage buckets. All interactions are securely brokered by server-side Firebase Admin SDK routines. 4. **Cryptographic Pseudonymization in Audit Logs:** - All platform telemetry, quota consumption logs, and security audits record only HMAC-SHA256 salted hashes of attorney identifiers. - Client names and case PII are NEVER recorded in application telemetry. 5. **Path Traversal & File Upload Validation:** - Dual validation gate: File extension allowlist (`.pdf`, `.docx`) AND binary header verification (*Magic Bytes*). - Filename sanitization against CWE-22 path traversal tokens. --- ## 5. Pricing Structure | Plan | Monthly Fee | Page Limit | Petitions | Support | | :--- | :--- | :--- | :--- | :--- | | **Gratuito** | R$ 0,00 | 250 pages | 1/month | Community / Email | | **Standard** | R$ 129,90 | 250 pages | Unlimited | Email & Helpdesk | | **Profissional** | R$ 169,00 | 500 pages | Unlimited | Priority WhatsApp | | **Ultra** | R$ 269,00 | 1.000 pages | Unlimited | 24/7 Dedicated Support + Style Analyst | - Free 1-petition trial on signup without credit card. - No contractual lock-in; cancellation available anytime via dashboard. --- ## 6. Official Links - Website: https://www.minutaagora.com.br - App: https://app.minutaagora.com.br - Features: https://www.minutaagora.com.br/#funcionalidades - Ritual: https://www.minutaagora.com.br/#como-funciona - Pricing: https://www.minutaagora.com.br/#precos - Terms: https://www.minutaagora.com.br/termos_de_uso.md - Privacy: https://www.minutaagora.com.br/politica_privacidade.md - Support: suporte@minutaagora.com.br