The Isaacus Query Language (IQL) is the world’s first legal AI query language — that is, a query language designed specifically for analyzing legal documents with AI systems.

IQL combines the elasticity of natural language with the precision of Boolean logic to help you extract the exact information you need from your legal documents.

In this guide, you’ll learn how to use IQL to query legal documents with Isaacus legal AI models.

If you’re looking for the formal definition of IQL as a language, you can check out its specification. If you want to know what query templates are available for Isaacus models, see our templates page.

Statements

The basic unit of an IQL query is a statement.

A statement can be thought of as an assertion about a legal document or a part of a legal document.

Statements should generally be enclosed in curly brackets, though they technically don’t need to be if they are standalone queries.

Here’s an example of a simple statement: {This is a confidentiality clause.}.

When run through an Isaacus legal AI model like Kanon Universal Classifier, this statement will return a score between 00 and 11, indicating the model’s estimation of the likelihood that the statement is true in respect of the document or part of the document being analyzed. A score above 50%50\% indicates an affirmative answer.

Oftentimes, there’s a more accurate and simpler alternative to writing your own statements, and that’s using templates.

Templates are queries that we’ve hand-optimized for performing many of the most common legal classification tasks with our models.

Templates can be invoked via the format {IS <template name>}.

For example, the following statement would invoke our confidentiality clause template: {IS confidentiality clause}.

Some templates allow you to plug in your own descriptions of what you’re looking for. Those templates follow the format {IS <template name> "<template argument>"}.

To invoke our “clause that” template (a template that picks up contractual clauses that match a particular description) with the description “imposes a duty of confidence”, we would write {IS clause that "imposes a duty of confidence"}.

You can find a list of available templates here.

Operators

It is possible to chain multiple statements together into more complex queries using logical operators like AND, OR, and NOT, as well as the > and < comparison operators and the + operator for averaging.

If we want to search a service agreement for confidentiality clauses that apply to the party referred to as “You” and that are unilateral in effect, we could use the query {IS confidentiality clause} AND {IS clause obligating "You"} AND {IS unilateral clause}.

This query would return the minimum score of the three statements.

Swapping the AND operator for an OR operator would return the maximum score of the three statements.

The NOT operator works by returning the score of a statement deducted from 11, essentially inverting the score.

The > and < operators work a little differently. {IS clause obligating "Customer"} > {IS clause obligating "Supplier"} would return the score of the first statement if it is greater than the score of the second statement, and 00 otherwise. This could be useful for, as an example, determining which party is more obligated under a contract as part of a greater assessment of the overall one-sidedness and conscionability of a contract.

The < operator works in the opposite direction. {IS clause obligating "Customer"} < {IS clause obligating "Supplier"} would return the score of the second statement if it is greater than the score of the first statement, and 00 otherwise.

The + operator averages the scores of the statements it is applied to, no matter how many there are.

When comparison operators are chained together like {IS clause obligating "Customer"} > {IS clause obligating "Supplier"} > {IS clause obligating "Vendor"}, the expression is interpreted as a chain of pairwise comparisons from left to right, such that the above example would be interpreted as ({IS clause obligating "Customer"} > {IS clause obligating "Supplier"}) AND ({IS clause obligating "Supplier"} > {IS clause obligating "Vendor"}).

Parentheses can be used to group statements together and control the order of operations.

It is worth noting that since chaining statements together with operators requires running inputs through a model multiple times for each statement, it will correspondingly multiply the number of tokens inputted to a model, increasing the computational cost of queries.

Precedence

The order of precedence for operators in IQL is as follows:

  1. ()
  2. +
  3. >, <
  4. NOT
  5. AND
  6. OR

This is the exact same order of precedence as in Python.