Skip to content

Introduction

Juca (Jurisprudence Understanding for Contextual Analysis) is the frontend hub for the sens.legal platform — a legal AI ecosystem designed to replace fragmented research tools with a single, intelligent interface for Brazilian legal professionals.

Brazilian legal research is fragmented across dozens of disconnected tools. Lawyers spend hours searching court databases, cross-referencing decisions, and manually extracting legal reasoning — only to produce analyses that may miss critical precedents or contain hallucinated citations from AI tools.

Existing AI legal tools either lack domain depth (generic chatbots) or lack usability (dump raw results without structure). None provide adversarial analysis, progressive disclosure, or graph-based reasoning traces.

Juca is a conversational frontend hub — not a monolithic application. It provides:

  1. A clean, Fintool/Perplexity-style interface where lawyers type natural-language queries
  2. Progressive disclosure via the Briefing Progressivo (4-phase system that reveals analysis incrementally)
  3. Orchestration of specialized backend agents that handle the heavy lifting (search, LLM processing, knowledge graph queries)
  4. Structured output through the Block System — 11 typed UI blocks that render diagnoses, precedents, risk analyses, and strategic recommendations

Juca itself is intentionally lightweight. The intelligence lives in the backend agents.

sens.legal consists of three projects, each with a distinct responsibility:

ProjectRoleStackStatus
Juca (this project)Frontend hub + lightweight orchestratorNext.js 16, React 19, TypeScript, Tailwind v4Active development (v0.3)
ValterBackend agent for STJ jurisprudencePython, FastAPI, PostgreSQL, Qdrant, Neo4j Aura, RedisProduction (valter-api-production.up.railway.app)
LeciBackend agent for federal legislationTypeScript, Next.js, Drizzle ORM, PostgreSQL + pgvectorEarly stage (v0.1-pre, DB schema only)

Juca communicates with Valter via REST API. Leci integration is planned for v0.6+.

This documentation serves four audiences:

  • Legal professionals — End users who interact with the Juca interface to research case law
  • Developers — Engineers contributing to the codebase (human or AI)
  • AI agents — Claude Code, Codex, and future agents that operate on the codebase via CLAUDE.md instructions
  • Stakeholders — The project owner and potential investors evaluating the platform

Before diving deeper, familiarize yourself with these core concepts:

ConceptDefinition
BlockA typed UI content unit. Juca has 11 block types (message, diagnosis, precedent, risk_balance, delivery, etc.). Blocks are the fundamental building unit of the interface.
Briefing ProgressivoA 4-phase progressive disclosure system: Diagnosis → Precedents → Risks → Delivery. Each phase produces specific block types.
WorkCanvasThe main content area that renders blocks in sequence.
ComposerThe input component where users type queries. Behind it, an intent detector routes queries to specialized tools.
PhaseRailA visual navigation rail showing the current briefing phase and allowing navigation between completed phases.
Tool RegistryA pattern that maps detected user intents to specialized handler functions (juris, ratio, analyzer, compare, insights).
HubJuca’s architectural role — a thin frontend that delegates backend intelligence to external agents (Valter, Leci).