Legal RAG + OpenAI
Query Interface

Legal Research Assistant

Query the locally indexed legal corpus from the browser. The frontend keeps the legal pipeline as the backend source of truth and asks for explicit approval before billable query calls that cross the configured threshold.

Ask The Corpus

Approval Required

This query has projected OpenAI calls above the configured browser approval threshold.
Legal Answer
Ready.

Indexed Chunks

0

Current local FAISS size

Retrieved Chunks

0

Initial FAISS recall set

Reranked Chunks

0

Chunks kept for final answer

References

    Corpus State

    What this system is: this is a dedicated legal retrieval system, not a generic chat window. It is built around a local legal corpus that has already been parsed, chunked, embedded, indexed, and stored on the server. The goal is to ask legal questions against that prepared corpus repeatedly without starting from zero each time.

    What it does: it takes your question, searches the local legal index for the most relevant passages, reranks the candidate excerpts for legal relevance, and then generates an answer grounded in those retrieved sources. The answer is tied to the indexed laws instead of relying only on the model's general background knowledge.

    How it works: the backend first runs embedding search against the local FAISS index, then uses a second OpenAI step to rerank the best excerpts, and finally generates the answer from the reranked legal text. The system also keeps structured metadata locally, so it is working from a prepared retrieval pipeline rather than from a one-off file upload.

    How this differs from just using ChatGPT in the browser with uploaded text: uploading a `.txt` file to ChatGPT is usually ad hoc and session-based. That can work for quick experiments, but it is not the same as having a persistent local legal index, repeatable retrieval behavior, structured references, reusable metadata, and a corpus that stays prepared on the server. This system is closer to a purpose-built legal search and answer layer than to a temporary document chat.

    Practical difference: with plain ChatGPT uploads, the model may rely more on prompt context and less on a stable retrieval pipeline. Here, the corpus is already organized into indexed legal units, which makes the system more reusable, inspectable, and consistent across repeated legal questions.

    • The frontend calls the current local retrieval backend, not a separate hosted vector store.
    • Retrieval uses FAISS first, then GPT reranking, then answer generation from cited excerpts only.
    • Hard caps still apply on the server even after browser approval.

    Loaded Source Files