Skip to content
Fan Luo edited this page Dec 14, 2025 · 1 revision

Welcome to the Legal-RAG Wiki

This wiki documents the design, architecture, and evolution of Legal-RAG.

It complements the source code by providing:

  • architectural explanations and design rationale
  • implementation notes and engineering trade-offs
  • project roadmap and current status
  • usage notes that are intentionally kept out of the README

Legal-RAG is an open-source engineering reference implementation for law-grounded, traceable Retrieval-Augmented Generation (RAG) systems, with a focus on Chinese Contract Law (《民法典·合同编》).

⚠️ Legal-RAG is not a legal advisory service.
It provides legal information assistance for research, education, and engineering purposes only.


What you’ll find here

This wiki will grow gradually and may include:

System Architecture

  • End-to-end RAG pipeline overview
  • Hybrid retrieval (FAISS + BM25)
  • Routing logic and law_graph usage
  • Offline vs. online data flow

Design Decisions

  • Rationale behind architectural choices
  • Why certain defaults are used
  • Prompt constraints and safety considerations
  • Trade-offs between simplicity, correctness, and extensibility

Roadmap & Status

  • Implemented features
  • Planned extensions
  • Explicit non-goals (what the project intentionally does not do)

Advanced Usage Notes

  • Indexing strategies and metadata design
  • PDF ingestion and incremental indexing
  • Conversation-aware retrieval (when applicable)

How to use this wiki

  • New readers: start with the architecture overview.
  • Code readers: refer to design notes to understand why the code is structured this way.
  • Questions or ideas: please use GitHub Discussions.
  • Bugs or actionable tasks: please use GitHub Issues.

Clone this wiki locally