
Implementation Demonstration of a Legal RAG Control Architecture Technical Note / Implementation Architecture for Controlled Legal RAG Systems Subtitle Edge-based Legal Initial Support AI with Internal Legal Database, Query Separation, and Auditable RAG Overview This document presents an implementation demonstration of a RAG control architecture for legal initial support AI. In recent years, RAG (Retrieval-Augmented Generation) in the legal domain has gained attention as a technology that retrieves laws, case law, and contracts, and connects LLM responses to supporting materials. However, in practical legal operations, simply retrieving relevant documents is insufficient. It is necessary to distinguish whether the input concerns "legal risk assessment," "inquiries about systems or procedures," or "statutory confirmation," and to control at what depth RAG should be executed and at which stage the process should return to human judgment. In this implementation, an edge-based legal initial support AI was constructed by integrating an internal legal database, structured preprocessing, query phase separation, target statute anchoring, multi-lane retrieval, case law search support, and audit logging. The system does not automatically determine legal conclusions; instead, it assumes final human judgment and provides relevant laws and statutes, procedural overviews, process flows, missing facts, and points requiring confirmation. The distinguishing feature of this research lies not in the construction of a legal RAG database itself, but in the control structure that determines under what conditions, at what depth, based on which evidence, and to what extent AI should process legal RAG, and from which point it should return to human decision-making. This enables separation and verification of search results, inference results, and raw JSON logs, thereby improving the ability to distinguish errors in retrieval and reasoning, as well as enhancing auditability. This implementation is positioned as an applied example of semantic structure control, based on the foundational philosophy of the Thought Chemistry System, including previously published materials. Note that the current integrated version contains subsequent refinements and is not identical to previously published materials; therefore, prior publications are treated not as direct specification references but as prior disclosures of the underlying conceptual framework. This publication is intended for research demonstration purposes. Use for research purposes is permitted; however, operational use in practice is not guaranteed. Commercial use and derivative commercial products require a separate licensing agreement. Therefore, this architecture should be understood not merely as an enhancement of legal RAG, but as an implementation example of judgment control structures in legal AI systems. Keywords Legal AI, RAG, Legal Database, Auditable AI, Edge AI, Legal Support, Generative AI, Human-in-the-loop, Legal Technology, Retrieval-Augmented Generation # 法務RAG制御アーキテクチャの実装実証 ## 副題 内部法令DB・問い合わせ分離・監査可能RAGによるエッジ型法務初動支援AI ## 概要 本資料は、法務初動支援AIにおけるRAG制御アーキテクチャの実装実証を整理したものである。 近年、法務領域におけるRAGは、法令・判例・契約書等を検索し、LLMの回答を根拠資料に接続する技術として注目されている。しかし、法務実務においては、単に関連文書を検索するだけでは不十分であり、入力内容が「法的リスク判定」なのか、「制度・手続きの問い合わせ」なのか、「条文確認」なのかを分離し、どの深度でRAGを実行し、どの段階で人間判断に戻すかを制御する必要がある。 本実証では、内部法令DB、構造化前処理、問い合わせフェーズ分離、目的条文アンカー、複数検索レーン、判例検索支援、監査ログを組み合わせたエッジ型法務初動支援AIを構成した。システムは、法的結論を自動決定するものではなく、人間による最終判断を前提に、関連法令・条文、制度概要、手続きの流れ、不足事実、確認事項を提示する。 本研究の差別化点は、法務RAGDBの構築そのものではなく、法務RAGをどの条件で、どの深度で、どの根拠に基づき、どこまでAIに処理させ、どこから人間に戻すかを制御する構造にある。これにより、検索結果、推論結果、生JSONログを分離して確認でき、誤検索・誤推論の切り分けと監査可能性を高める。 本実証は、発表済み資料を含む思想化学体系の基盤思想を背景とし、意味構造制御の応用実装例として位置付けられる。なお、現在の統合整理版に含まれる後続整理は、発表済み資料と完全同一ではないため、既発表資料は直接の仕様根拠ではなく基盤思想の先行発表として扱う。 本公開は研究実証を目的とする。研究目的の使用は許可するが、実務運用は保証しない。商用利用および商用派生品については別途ライセンス契約を必要とする。 本実証は、法務RAGの検索精度そのものではなく、処理構造・責任分界・人間復帰点の制御を主対象とした実装実証である。 ## キーワード 法務AI, RAG, 法令DB, 監査可能AI, エッジAI, 法務支援, 生成AI, human-in-the-loop, legal technology, retrieval augmented generation
