Legal RAG Presentation Layer
Structured Legal Retrieval

A Legal Research Assistant Built On Structured Retrieval

Designed for legal questions over a prepared corpus, this system retrieves relevant law first, then generates grounded answers from indexed legal text instead of relying on a blank chat session.

The result is a more controlled legal workflow: repeatable retrieval, source-backed responses, and a corpus that stays prepared on the server for repeated use.

legal-rag-assistant :: overview
$ corpus.status
documents: 2
legal_units: 10380
faiss_index_size: 10500

$ retrieval.pipeline
1. embed question
2. search local FAISS index
3. rerank candidate passages
4. generate answer from retrieved legal text only

$ active.models
embedding: text-embedding-3-large
rerank: gpt-5-mini
answer: gpt-5.4-2026-03-05

What makes this different

This app is not just a model plus an uploaded file. It keeps a persistent legal corpus prepared in advance, with structured legal units, local retrieval, and server-side controls around the query flow.

Who it is for

It is meant for demos, internal legal research workflows, and structured question answering over a known set of laws where consistency and traceability matter more than generic conversation.

Grounded Answers
Source-Backed
Answers are generated from retrieved legal excerpts, not a blank prompt.
Structured Legal Units
10380
The indexed corpus is broken into reusable legal units for retrieval.
Persistent Corpus
2
The server keeps the legal corpus prepared between sessions and users.
Server-Side Retrieval
10500
The retrieval index is already built and ready before the question is asked.

What It Is

A legal search-and-answer system built on a prepared corpus. The backend parses legal source files, stores structured metadata, and queries a local retrieval index before the model produces a final answer.

How It Works

Documents are converted, structured, embedded, and indexed ahead of time. At query time, the app retrieves candidate passages, reranks them for legal relevance, and answers from the narrowed legal context.

Why It Matters

That pipeline makes the system more reusable, inspectable, and presentation-ready than one-off document chats. The corpus stays prepared, so repeated legal questions can run against the same structured base.

Example Questions

A visitor should quickly understand the kinds of tasks this deployment is meant to handle. These are examples of the type of questions the app is designed to answer against the indexed laws.

This Legal Retrieval System

  • Works from a persistent indexed legal corpus already prepared on the server.
  • Retrieval happens before generation, which gives the answer a narrower legal basis.
  • Structured references and legal metadata remain attached to the indexed material.
  • More suitable for repeatable demos and controlled legal question-answering flows.
  • Server-side approval prompts and hard caps remain part of the system behavior.

Plain ChatGPT With Uploaded Text

  • Useful for quick experiments and broad conversation.
  • Usually more ad hoc and session-driven than a maintained retrieval pipeline.
  • Less explicit structure around persistent indexing and prepared legal units.
  • Harder to present as a dedicated product with a stable legal corpus behind it.
  • Better for general-purpose interaction than for a controlled legal retrieval stack.

What This Deployment Knows

This deployment currently answers questions over the indexed legal documents listed here. Those files form the retrieval base used by the app.

  • 20260130_CODCIVIL.DOC
  • 30112018_CODIPROCI.DOC

Corpus Coverage

The current deployment is intentionally narrow: it focuses on the legal texts already indexed on the server. That makes the scope explicit and the retrieval behavior easier to explain during a presentation.

  • Indexed documents: 2
  • Structured legal units: 10380
  • Retrieval entries: 10500
  • Live query interface remains available at /app

Request Access

This legal app is available by controlled access. To request a username and password for the demo, contact ogracia@uabc.edu.mx.

Email To Request Access