TreeMap
무료 오픈소스 디스크 사용량 시각화 도구로, 사각형 트리맵·중복 파일 탐색·디스크 가득 예측·정리 시 파일을 휴지통으로만 이동한다
아일랜드 등기 안내서용 인용 우선 법률 RAG 파이프라인으로, 하이브리드 검색·Claude 질의 재작성·인용 검증·별도 평가를 수행합니다
Citation-first legal RAG for an Irish conveyancing handbook: hybrid search, Claude query rewriting, fail-closed citation checks, and held-out evals.
생산성PythonGitHub @Ahsan-ire온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
Legal RAG Pipeline — a first-line sweep of the conveyancing handbook
▶ Live interactive demo — no install, runs in the browser.
Ask a procedure question in plain English. Get a grounded answer with chapter/paragraph/page
citations whose locators are checked against the retrieved text, or an honest refusal. Then open the handbook at the cited
page and reach your own conclusion.README 전문 보기 ↗▶ Live interactive demo — no install, runs in the browser.
Ask a procedure question in plain English. Get a grounded answer with chapter/paragraph/page citations whose locators are checked against the retrieved text, or an honest refusal. Then open the handbook at the cited page and reach your own conclusion.
That last step is the whole point. This tool is not built to replace reading the source: it's a
first-line sweep before diving into an ~800-page manual. The answer orients you. The
citation is the product: before you see the answer, each citation is matched against the chunks
retrieved for your question. The cited paragraph and a retrieved chunk's section must be equal, or one
must nest inside the other, and the cited page must fall within that chunk's pages, so
[Handbook, para 6.3.2, p.214]
lands you on retrieved text. That check does not prove the exact paragraph number exists, and it does
not prove the passage supports the claim. A sentence with no citation is not checked at all. An answer
whose citations cannot be verified is withheld, not shown, and an answer that was cut off,
declined by the model, or otherwise did not finish is withheld too. The system fails closed rather
than guessing confidently.
I work with a small legal team specialising in conveyancing, and the reference for almost everything is one ~800-page handbook. Finding the right paragraph is rarely hard law; mostly it's paging. A general-purpose AI answers instantly but leaves you wondering whether to trust it, which in legal work means you end up checking the book anyway. This is the middle path: an answer that arrives already pinned to chapter, paragraph and page, so the check takes seconds instead of a search.
It has been in real use since mid-July 2026: mostly me, sometimes colleagues on their own questions, always on real work, never as the final word. Two things in this repo came directly out of that use: the "realistic" evaluation slice is built from colleagues' actual phrasing, which failed badly against a system that scored perfectly on my own polished test questions (see the evaluation section), and the Phase 14 comparison-question work started as one colleague's complaint about one bad answer. I haven't measured time saved and won't invent a number. What I can say is that the failures users found became the roadmap.
Every query ends in exactly one outcome. None of them is a confident, unchecked guess:
| Outcome | When | What you see |
|---|---|---|
✅ Verified (CITATIONS_VERIFIED) | Every citation resolves to a retrieved chunk | Answer + citations, a Source: label naming the handbook title(s), and a research-aid disclaimer |
⚠️ Partially verified (PARTIALLY_VERIFIED) | Some citations couldn't be checked | Answer + a warning naming each unverified citation, plus the Source: label and disclaimer |
⛔ Unverified, blocked (CITATIONS_UNVERIFIED) | No citation could be verified | The draft is withheld; retrieved source headers shown so you can still look. --show-unverified reveals the draft, branded as an unverified draft |
🚫 Refusal (REFUSAL) | The question is outside the corpus | The exact sentence "not covered in the source material" |
✂️ Answer truncated (ANSWER_TRUNCATED) | The model hit its output limit mid-answer | Withheld, with a notice to try a narrower question. No sources, no override |
🙅 Model declined (MODEL_DECLINED) | The model declined the request | Withheld, with a notice to rephrase or consult the handbook. No sources, no override |
❓ Generation incomplete (GENERATION_INCOMPLETE) | Generation stopped for any other abnormal reason | Withheld, with a notice to retry. No sources, no override |
(none) no_results | Retrieval returned nothing | A no-results message; no answer is generated |
The three withheld terminal outcomes take precedence over every citation outcome, including
--show-unverified: a cut-off or declined draft is never printed. If the model returns no stop
reason at all, the citation gate still decides whether the answer is shown; when it is shown, it
carries a warning that its completion status could not be confirmed.
What the verified outcomes do and don't claim: the check matches each cited paragraph/page against
the chunks retrieved for that question (a related section number, and a page inside that chunk's
pages). It does not check that the exact paragraph exists or that it supports the sentence it
follows, and it does not check statements that carry no citation. As a display-only hint, the output lists sentences that appear to have no citation
under "These statements may not be backed by a citation (heuristic)". It is a heuristic, it never
changes the outcome, and it can miss cases (for example sentences starting in lowercase). Verified
and partially verified answers, and an unverified draft shown with --show-unverified, end with
"Research aid — check the cited paragraphs; not legal advice; the source edition may predate current
law." (the Source: label appears on the verified and partially verified answers only).
(These are the pipeline's outcomes, the first four of which the demo below illustrates. The answer
text itself is separately graded — direct answer, partial answer naming its gaps, closest-related
guidance under an explicit caveat, or the refusal — detailed in ABOUT.md.)
Why each step exists, in one line each:
--no-rewrite).(paragraph, page)
the model cites is checked against the chunks actually retrieved. A citation pointing outside
what was retrieved doesn't pass.
Before the gate runs, the generation's stop reason is read: a truncated, declined or otherwise
incomplete answer is withheld without being shown.
To be precise about what that proves: the citation falls inside real retrieved text (a related
section, on a page that chunk covers). It does not prove the exact paragraph number exists, or
that the passage legally supports the claim; that judgment is yours, which is why every answer
ends at the book.Open the live demo — or open
Demo/demo.html locally in any browser. It runs the pipeline's logic as a guided
simulation over the wholly synthetic sample handbook (a fictional jurisdiction, no real corpus
text), and shows the four citation-gate outcomes above (the three withheld terminal outcomes are not simulated), including watching the gate catch a fabricated citation.
The real corpus is copyrighted and never in this repo, so the quickstart runs against the same
synthetic sample handbook (scripts/sample_corpus.py) that exercises the identical chunker grammar:
python3 -m venv .venv && source .venv/bin/activate # tested on Python 3.12
pip install -r requirements.txt # installs torch/sentence-transformers (heavy, one-time)
python -m pytest tests/ -q # full suite, offline, no key
python scripts/build_sample_index.py # builds ./sample_chroma_db/ (downloads MiniLM ~90MB once)
python -m src.pipeline eval \
--golden eval/sample_golden_set.jsonl \
--persist-dir sample_chroma_db \
--skip-refusals --skip-completeness # keyless retrieval-only eval → 7/7 on the sample set
This is exactly what CI runs (.github/workflows/ci.yml) — no ANTHROPIC_API_KEY anywhere.
With an API key (cp .env.example .env, set ANTHROPIC_API_KEY) you can generate real answers
and index your own handbook:
python -m src.pipeline query "How is a Windlass Charge created?" --persist-dir sample_chroma_db --top-k 6
python -m src.pipeline query "What are the requirements for making a valid will?" --persist-dir sample_chroma_db # → refusal (succession law, not conveyancing)
python -m src.pipeline index ./data/your-handbook.pdf --type handbook # --reset to rebuild
ABOUT.md. With n=20, read both as indicative, not a
benchmark.docs/phase14-rubric-spotchecks.md).Full ablation tables, refusal accuracy, methodology, and provenance:
ABOUT.md and the canonical report eval/results.md.
The handbook is copyrighted, so the PDF, the index, and all logs are gitignored and never
committed: this public repo ships only code, tests, the synthetic sample, and scrubbed eval
reports (questions and section numbers, never corpus text). The audit log records SHA-256 hashes
of queries rather than their text, because legal queries can reveal client matters. Full detail in
ABOUT.md.
ABOUT.md — architecture, full evaluation, deployment notes, limitations,
troubleshooting, roadmap.docs/decisions.md — design rationale, one entry per meaningful choice,
append-only (D1–D52).docs/harness.md — the development workflow itself (gates, fresh-context
critics, eval-judged bake-offs).IMPLEMENTATION_PLAN.md — phase-by-phase build plan.MIT © 2026 Ahsan Malik — covers everything in this repository, including the wholly synthetic sample corpus. The real conveyancing handbook is never distributed here.