KARTILYA.PH

§ Technology

How it works

KARTILYA.PH retrieves from a bounded statutory corpus, composes cited answer points, and reports the result of a separate source-text check for each one. Related decisions follow a distinct topic-screening path and do not form part of the statutory synthesis.

8,297 provisions · 57 instruments · 4,164 jurisprudence records · Gate 1 grounds statutory points and case holdings in retained source text

THE CORPUS · BUILT ONCETHE ANSWER · PER QUESTIONSourcesLawPhil · manual rulesStructuredprovisions + casesEmbedlegal vectorsQuestionin plain wordsExpandstatutory rewriteRetrievecosine top-kSynthesizegrounded + citedFirewallverify vs sourceAnswercitation status shownexact cache · completed verified answers may replay
The diagram includes an optional semantic-cache branch. Semantic reuse is disabled by default and, if explicitly enabled, is limited to fully verified cached answers. Exact-repeat cache entries likewise require full verification and a matching canonical question; all other requests proceed through retrieval, synthesis, and reported source-text checks.
01

One corpus, structured

The statutory corpus contains 8,297 provisions across 57 instruments: the 1987 Constitution, major Codes, and selected statutes and rules. Most instruments reproduce text published by The LawPhil Project; procedural rules were sourced separately. A deterministic pipeline parses the material into addressable provisions and preserves instrument, chapter, and section context as structured metadata. Some base texts are enacted versions rather than current consolidated editions; the relevant reading pages carry currency notes.

02

A bounded jurisprudence snapshot

The jurisprudence catalog contains 4,164 records in a dated, incomplete snapshot from 2019 through April 29, 2026. Links between a decision and a statute record extracted citations; they do not by themselves establish a holding or application. Jurisprudence retrieval remains separate from the statutory synthesis described below.

03

Meaning-based retrieval

Statutory provisions and retained opinion-text chunks are embedded for semantic retrieval, so candidate materials can be matched by meaning rather than exact phrase. At query time the question is embedded and compared by cosine similarity with the statutory provisions. The question is also rewritten into denser statutory terminology, and the original and rewritten searches are interleaved. Thus, “can an arrested person stay silent?” can retrieve the custodial-investigation clause even though the question uses different terms.

your question+ statutory rewritenearest provisions by meaningevery provision + opinion, embedded oncecosine similarity · legal embedding space
Retrieval proposes candidate provisions by meaning; it does not determine whether a proposition is legally supported.
04

Grounded synthesis

The statutory synthesis model receives retrieved provisions, not related-decision metadata. It is instructed to use only the supplied statutory text, divide the answer into discrete points, and attach the cited provision to each point. A separate case-analysis path works only from bounded retained-opinion excerpts: it screens relevance and selects a concise verbatim holding passage. Where the retrieved corpus does not address the question, the response reports that coverage limit.

05

The citation firewall

Each statutory citation is resolved against the corpus, and every cited answer point is checked against the corresponding corpus passage. Case holding excerpts pass a separate boundary: the selected text must be found verbatim in the retained opinion; deterministic source-role checks reject quoted-authority blocks; then an independent check must confirm that it is the decision's relevant majority holding or application. The displayed holding is constructed from the canonical source passage, not separately generated. A failed, malformed, incomplete, or misattributed excerpt is omitted; the already-screened case card may remain without one.

CLAIM“A confession without counselis inadmissible.”CITED SOURCEConst. Art. III, Sec. 12(3)verification passreads the statementagainst the real text✓ verifiedshown with cite attached⚑ flagged · ? unavailablemarked in plain view, never hidden
Each cited statutory point reports a check result. Unsupported points are flagged; incomplete or unavailable checks remain unavailable.
06

Caching after complete verification

An exact repeat can reuse a cached answer only when the prior response had substantive coverage and all cited claims were verified. Flagged, unavailable, malformed, and incomplete results are not cached. The cache also confirms that the stored canonical question matches the request. Semantic answer reuse for differently worded questions is disabled by default; if explicitly enabled, it is limited to fully verified cached answers. Related-decision screening may run concurrently with statutory retrieval.

Questionnormalized exact keyexact key matchsemantic reuse off by defaultexact matchcompleted answer replayverified citations · canonical questionno matchrun the full pipelineretrieve → synthesize → firewall → exact cache
Exact repeats may reuse fully verified answers. Semantic reuse is an explicit opt-in and is disabled by default.

§ See it work

This fixed example illustrates a statutory answer whose two cited points completed the source-text check and were reported as verified. Other results may be flagged or unavailable.

§ Can an arrested person stay silent?

Yes, under the Constitution.
  • A person under custodial investigation has the right to remain silent and to competent, independent counsel, preferably of their own choice. ✓ 1987 Constitution · Art. III, Sec. 12(1)
  • Any confession or admission obtained in violation of this right is inadmissible in evidence against the person. ✓ 1987 Constitution · Art. III, Sec. 12(3)
Citation firewall✓ 2 verified

A fixed example for illustration. Open the research page →

§ Why the firewall matters

A general-purpose AI model asked about Philippine law will answer confidently, and sooner or later it will invent something: an article number that does not exist, a holding a case never reached, a penalty a statute never prescribed. None of it needs to be deliberate. It is simply what happens when a model is asked to be the authority on facts it was never given the source text to check. For law, that is disqualifying.

The firewall assigns each cited statutory point a reported status after comparison with its corpus passage: verified, flagged, or unavailable. Failed and incomplete checks remain unavailable rather than receiving a verified status. Case holding excerpts are separately grounded in exact passages located in a retained opinion excerpt, then independently checked against those passages. Unsupported summaries are omitted.

Statutory and case synthesis remain separate: each uses its own retained source material and independent verification boundary. Try a question →