About LegalSearch PH
A free, open, citation-graph-first research tool for Philippine Supreme Court decisions. Built for people who can't afford paid legal research platforms.
Who this is for
- Law students and bar reviewees
- Solo practitioners, especially in the provinces
- Public defenders and legal-aid lawyers
- Paralegals and legal researchers
- Journalists covering legal stories
- Researchers, teachers, curious citizens
What's in the corpus
Philippine Supreme Court decisions, pulled from two public sources: the official Supreme Court E-Library and the Arellano Law Foundation's lawphil.net. Each ingested decision is passed through gpt-4o-mini to extract structured fields — title, G.R. number, date, doctrine, summary, topics, division, ponente, disposition, dispositive paragraph, statutes cited, and references to other cases.
The corpus grows daily via automated crawlers. Historical cases are being backfilled in parallel, walking backward from the oldest entry in the database toward 1901.
What's NOT in the corpus
- Court of Appeals decisions — massive volume, lower precedential value. We may add them later as a secondary index.
- Trial court (RTC, MTC, MeTC) decisions— these aren't published in any public database because they aren't binding precedent. No free or paid service carries them comprehensively.
- Statutes, IRRs, administrative issuances — not yet. Different document structure and usually looked up by exact citation rather than by meaning. Potentially a later phase.
- SC minute resolutions — mostly one-line dismissals. Low research value per token.
How it's extracted
- Crawler finds new case URLs on Lawphil or E-Library's monthly index pages
- The page is cleaned by Jina Reader to strip ads and navigation
- The first 18,000 characters are sent to gpt-4o-mini with a strict JSON prompt
- Only the doctrine and summary (about 200 tokens total) are embedded for semantic search — we never embed full case text, for cost reasons
- Citation references are extracted and their G.R. numbers recovered by a regex pass over the full markdown
- Rows are upserted, dedup-ed cross-source by G.R. number
Important: this is not legal advice.
Doctrine summaries are generated by AI and can be wrong. Every claim on this site should be verified against the original decision before you rely on it in legal work. We deliberately link every case to its source on Lawphil or E-Library so verification is one click away.
Open source, open data
- Code — MIT. github.com/jeromeadmana/ai-law-ph
- Structured corpus— CC BY-SA 4.0. Attribute “LegalSearch PH” and share alike.
- Weekly JSONL dumps published as GitHub releases. Anyone can fork the dataset.
- Public HTTP API — see /api-docs. No key, no login.
Sustainability
There is no paid tier and no plan to add one. Infrastructure is paid out of pocket on the Supabase and Vercel free tiers. OpenAI calls are funded from a small personal prepaid balance, protected by a daily and monthly cost cap — if the cap is exceeded, expensive features (ingestion, the research assistant) pause until the budget resets. Search always stays on because it's effectively free.
If you find this useful and want to see it grow faster, tell a colleague, link to it, or fork the data. Grant applications and sponsorship from a law school or bar review center would help us cover a bigger OpenAI budget.
Built in the open by a Filipino developer. Not affiliated with the Supreme Court of the Philippines.