All case studies

Legal tech

An AI engine that reviews contracts rule by rule

For Neo.Law's AI platform, we built the engine that reviews contracts against a company's negotiation playbook and explains every finding.

Client
Neo.Law
Industry
Legal tech
Period
2025–2026
Status
Completed

How it works

  1. Contract
  2. sourcecast Split and retrieve relevant passages
  3. sourcecast Check every playbook rule with a language model
  4. Finding, reasoning and suggested wording

The starting point

Neo.Law builds an AI platform that legal teams use to review contracts. It is based on a company's playbook, which describes the topics a contract must cover, which clauses are unacceptable and which values for liability, payment terms or notice periods are fine. We were engaged through Weyv Technology as the platform's engineering team and took over the AI engine in early 2025.

The product needed to check every rule of a playbook individually, explain each result in a way lawyers can follow, propose concrete wording and handle German and English contracts. The legal team needed to change rules without a developer. And because a single contract triggers dozens of language model calls, cost mattered too.

What we built

We moved the engine into the core platform and then rebuilt it step by step, without the web app or the Word add-in having to change their interface. Contracts are split into sections that follow the structure of legal texts and are stored for search. For each rule, the engine retrieves the relevant passages and asks the language model a clear yes-or-no question. The answer is stored together with the reasoning and the passages it relied on, so every result can be traced back.

Depending on the result, the engine rewrites a clause, drafts a missing one or recommends removing a prohibited one. The roles of the contracting parties are part of the prompts, so the same rule works from the buyer's and the supplier's side. Every rule has a complexity level that decides which model checks it, and a separate pass reads the whole contract for relevant clauses that no playbook topic covers.

Outcome

The platform runs one configurable review engine for the web app, for automated uploads from the document management system and for the Word add-in. Legal experts change topics, rules and model tiers without a deployment, and every finding comes with its reasoning and source. An automated test suite runs on every pull request.

I have never been able to launch a digital product this fast. Malte and Fabian think along actively, solve problems with confidence and always keep the long-term roadmap in view. This foresight was very valuable for our project.
Daniel Schaffeld · Managing Director, WEYV Technology GmbH
Technical details
  • A text splitter for German and English contract structures. Headings and tables of contents are excluded from retrieval so they do not crowd out real clauses.
  • Embeddings live in PostgreSQL with pgvector, so business data and vectors share one transactional database.
  • Retrieval runs per rule with two thresholds, so narrow rules still get enough relevant passages.
  • Structured language model outputs are parsed into typed objects.
  • Topics are evaluated in parallel as Celery task groups, with explicit handling of retries and race conditions.
  • Model tiers and providers are configurable per organisation.
work with us
get in touch