PH LABS

Capability / Retrieval & knowledge · search, ranking, citation

Find it.Prove it.

We build retrieval systems that search very large document collections by meaning and by exact words, rank what they find, and hand an AI only passages it can cite.

Fig. 04 — Retrieval pipeline

Choose a button to read its note, or press Run a query.

01 — What it does

A collection, made answerable.

A retrieval engine takes a collection of documents and makes it answerable. It loads and cleans the sources, splits them into passages, indexes them twice (by meaning and by words), and at question time returns the passages that matter, ranked, with the evidence an AI needs to answer and cite.

02 — The problem it solves

Three gaps, closed.

Keyword search misses a document that says the same thing in other words. Search by meaning alone misses the exact term, name or section number a professional types. An assistant that answers from its own memory will cite things that do not exist. Hybrid retrieval with verified citations closes all three gaps.

03 — What we have built

The engine behind MayaClerk.

The engine behind MayaClerk, a legal research service on the web and iPhone. It searches court opinions and the U.S. Code.

In MayaClerk
Live
MayaClerk publishes its collection as 10.6 million opinions and more than 105 million passages; the passage count matches the engine's index build files.
  • Every stage in the figure is in that engine's code: bulk ingestion, extraction, normalisation, chunking, embedding, a sharded pgvector HNSW index, full-text search, reciprocal rank fusion, authority-aware ranking, context expansion through the citation graph, source verification, and retrieval-augmented generation.
  • Structured metadata on every passage: court, jurisdiction, case name, date, precedential status and how often the case is cited. Statutes carry title, chapter, section and their place in the Code.
  • Deduplication by construction: a repeated run cannot create a second copy of a passage, and results keep one best passage per case.
  • Citation-aware search: typing a U.S. Code citation pins that section first; a case citation resolves straight to the opinion.
  • A research assistant on top that must search before it answers and may cite only what it retrieved.
  • A document reader for a user's own files (PDF, Word, email, web pages) that quotes with page references.
  • A developer API for search and opinion lookup, with keys that are stored only as hashes and per-call metering.
Outside law
Built and tested
The same pipeline outside law: the chunker and the fusion step are reused unchanged in our knowledge kit, with a recorded run that indexed 1,329 documents into 8,036 passages.
Beyond law

Where the same engine applies.

Compliance and policy libraries; contracts; technical manuals and documentation; research literature; support knowledge bases; company-wide search with cited answers.

04 — What can be customised

Tuned to your field.

The sources (your documents, databases and feeds). The metadata and filters that matter in your field. The ranking signals (what counts as authority, how much recency matters). The verification rule (what counts as a citable source). The application on top: a search page, an assistant, an API.

05 — How it is delivered

Hosted, embedded, or on your servers.

As a hosted API that we run, with keys and usage metering. Inside a web or iPhone application we build for you. Or deployed in your own environment: it runs on PostgreSQL.

06 — Demonstrations

See it work.

The figure above. MayaClerk itself, live at mayaclerk.com.

mayaclerk.com / clerk
Legal Clerk listing the first of twenty ranked court opinions for a plain-English question about a city's liability for failing to train its police
A live query on mayaclerk.com on 14 November 2026: a plain-English question, answered with ranked opinions. Open at full size
mayaclerk.com / clerk
A search result opened to show the matching passage from City of Canton v. Harris
The passage that matched, in the court's own words. Open at full size
MayaClerk on iPhone: search results with a statute and a Supreme Court opinion
iPhone app, test data
an opinion open in the reader
iPhone app, test data
the document reader answering a question about an uploaded file
iPhone app, test data
07 — Start a project

Have a collection in mind?

Start a project