About the Project - LexFlow

Inspiration

Brazil faces one of the most complex and extensive legal systems in the world.
Since 1988, over 7.8 million laws and regulations have been enacted — an average of 860 new rules per business day.
There are over 15,000 federal ordinary laws since the 1946 Constitution, plus thousands of decrees, resolutions, and normative acts.

This legal overproduction has created a landscape of fragmentation and inaccessibility, characterized by:

  • Dispersed legislation across multiple government sites;
  • Unstructured formats, such as PDFs and HTML pages that are hard to process;
  • Lack of version control, making updates untraceable;
  • Overly technical language, inaccessible to the public;
  • No automation, as the data is not structured for AI processing.

The result is a societal and institutional burden:

  • Citizens struggle to understand their rights and duties;
  • Companies spend massive resources on compliance;
  • Lawyers depend on expensive tools for legal research;
  • Public managers find it difficult to map the regulatory framework;
  • Researchers face barriers to analyzing legislative evolution.

LexFlow was created to simplify, structure, and analyze legal text locally and privately, using built-in browser AI, without exposing data to external servers.
It introduces a faster, more accessible, and privacy-preserving way to interact with the law.


What is LexFlow

LexFlow is a Google Chrome extension powered by Gemini Nano (Built-in AI) that can:

  • Analyze and summarize law excerpts, articles, and rulings directly on web pages;
  • Compare legal texts, such as articles from different codes or constitutions;
  • Perform contextual legal analyses, identifying similarities, differences, and normative hierarchies;
  • Save and version results in a GitHub repository, securely synced through Cloudflare Workers;
  • Ensure local privacy, since all inference runs on the user’s device.

LexFlow turns the browser into an AI-assisted legal workspace, allowing lawyers, researchers, and students to explore and interpret laws without exposing sensitive data.


How We Built It

LexFlow combines open, privacy-focused technologies:

  • Frontend: Chrome Extension (Manifest V3 + Service Workers);
  • Local AI: Gemini Nano via Chrome Prompt API;
  • Backend: Cloudflare Workers for secure GitHub synchronization;
  • Document structure: Markdown with metadata for human- and machine-readability;
  • Testing environments: Linux, macOS, Windows, and VMs for cross-platform validation.

We learned how to set up and test Gemini Nano in multiple environments, evaluating performance and technical limitations.
The system supports different legal analysis templates, such as Executive Summary, Legal Analysis, and Legal Comparison, each generating contextual and explainable outputs.


What We Learned

  1. Local AI is the future of legal privacy.
    Running inference directly on the browser eliminates any risk of data exposure.

  2. Laws must be readable by humans and machines.
    Markdown with metadata (type, number, tags) enables structured, automated legal reasoning.

  3. Context matters more than complexity.
    AI should act in the exact moment of need — during reading or comparison — without changing the lawyer’s workflow.

  4. Standardization enables interoperability.
    A public, versioned repository of Brazilian legislation allows integration with APIs and open AI agents.


Challenges Faced

  • Gemini Nano’s prompt length limitations;
  • Installation difficulties on Linux, requiring manual dependencies;
  • Non-standard legal data sources, with different formats per institution;
  • Maintaining legal accuracy while simplifying outputs;
  • Designing for low-tech users in the legal field;
  • Balancing collaboration and security while keeping all data local.

Impact

LexFlow aims to democratize access to law and legal interpretation, lowering barriers for both professionals and citizens.
It enables users to:

  • Analyze laws and rulings quickly and privately;
  • Perform comparisons and summaries directly in the browser;
  • Contribute to an open, versioned legal repository;
  • Work offline, syncing results later through Cloudflare.

Conclusion

LexFlow stands at the crossroads of Law, Artificial Intelligence, and Local Privacy.
It’s more than a browser extension — it’s an intelligent legal curation platform that transforms how laws are read, compared, and interpreted.

LexFlow = Local AI + Structured Legislation + Privacy and Efficiency

Share this project:

Updates