Inferensys

Integration

Custom AI Development for Relativity Assisted Review

Build and integrate bespoke machine learning models to extend Relativity's native Assisted Review (RAR) for specialized document types, complex legal domains, and higher-precision review workflows.
ML engineer developing custom LLM, model architecture diagrams on screens, technical deep work environment.
ARCHITECTURE AND ROLLOUT

Extending Relativity Assisted Review with Custom AI

A technical blueprint for building and deploying custom machine learning models that integrate directly with Relativity's Assisted Review workflows.

Relativity Assisted Review (RAR) provides a powerful foundation for Technology-Assisted Review (TAR), but its native models are generalized for broad legal language. A custom AI integration allows you to build models trained on your specific matter types—such as M&A due diligence documents, patent litigation technical files, or internal investigation communications—and plug their predictions directly into the RAR workflow. This is achieved by using the Relativity REST API and Event Handlers to create custom objects (like a CustomModelScore object), populate fields with model outputs, and then surface those scores in the Active Learning workspace or as a priority ranking in the document list. The integration acts as a parallel scoring engine, enriching RAR's native prioritization with domain-specific signals.

The implementation typically follows a batch-and-sync pattern: documents are exported from a saved search via the API, processed by your custom model (hosted on your infrastructure or a cloud service like Azure ML), and the results are written back as choice fields or decimal scores. For real-time workflows, an Event Handler can be configured to trigger model inference when a document's Extracted Text field is updated, allowing for immediate tagging. Governance is critical; all model predictions should be stored with audit trail metadata (model version, inference timestamp, confidence score) and integrated into Relativity's RBAC so only authorized reviewers can see or act on the AI-generated tags. A phased rollout starts with a pilot workspace, where model predictions are visible as non-decisive fields, allowing reviewers to provide feedback that retrains the model in a continuous loop.

This approach moves beyond a black-box AI service. It creates a governed, auditable system where custom intelligence becomes a repeatable asset. The result is not just faster review, but more consistent and accurate issue coding for niche document types, turning a general-purpose TAR tool into a specialized expert for your recurring legal challenges.

ARCHITECTURAL SURFACES

Where Custom AI Integrates with Relativity Assisted Review

Ingest and Processing Pipelines

Custom AI models integrate upstream of Relativity Assisted Review (RAR) to enrich documents before they enter the review workflow. This surfaces in the Processing Engine and Data Grid via:

  • OCR Enhancement: Deploying high-accuracy OCR/ICR models for poor-quality scans or handwritten notes, writing extracted text to the Extracted Text field.
  • Language & Domain Detection: Classifying documents by specific legal domain (e.g., M&A, employment, IP) or technical jargon, populating custom fields used later for model stratification in RAR.
  • Metadata Extraction: Using NLP to pull key dates, parties, or referenced matter numbers from document bodies into structured fields, improving RAR's feature set.

These enrichments create a richer feature set for RAR's native model, leading to more precise responsive/non-responsive predictions from the first training round.

SPECIALIZED WORKFLOW AUTOMATION

High-Value Use Cases for Custom RAR Models

Relativity's native Assisted Review (RAR) provides powerful continuous active learning, but custom machine learning models can target specific document types, legal domains, and review strategies that generic TAR workflows miss. These custom models plug into RAR's framework via the Relativity API and custom objects to deliver precision automation.

01

Technical Document & Patent Analysis

Train a custom model to identify prior art, technical specifications, and patent claim language within engineering documents, research papers, and source code. The model feeds prioritized documents into a dedicated RAR queue for IP litigation or M&A due diligence, tagging concepts like 'novelty', 'infringement risk', or 'technical standard'.

Batch -> Targeted
Review focus
02

Financial Communication Triage

Deploy a model fine-tuned on trading chat, earnings call transcripts, and SEC filings to flag potential insider trading, market manipulation, or regulatory disclosure issues. Integrates with RAR to create a stratified review: high-risk communications go to senior attorneys first, while low-risk items are batched for junior review or sampling.

Same day
Risk identification
03

Healthcare PHI & Compliance Screening

Build a model that extends beyond simple PII patterns to understand context-sensitive Protected Health Information (PHI) within patient records, billing notes, and internal communications. The model works alongside RAR's relevance ranking to automatically apply privilege and confidentiality tags, streamlining the 502(d) log process for healthcare investigations.

Hours -> Minutes
Privilege log prep
04

Contractual Obligation & Breach Detection

Create a domain-specific model that reads contracts to extract parties, key dates, termination clauses, and obligations. In a breach-of-contract case, the model can pre-populate a custom object in Relativity linking relevant non-performance emails to the specific contractual clauses at issue, creating a connected fact pattern for reviewers.

1 sprint
Model development
05

Internal Investigation Misconduct Patterns

Train a model on historical HR investigations to identify subtle patterns of harassment, discrimination, or code-of-conduct violations in modern chat and email data. The model augments RAR's learning by providing initial seed sets of nuanced positive examples, accelerating the review of sensitive internal investigations with greater consistency.

Targeted Seed Sets
RAR acceleration
06

Foreign Language & Dialect Specialization

Develop custom models for specific languages (e.g., Mandarin, Arabic) or technical/regional dialects not well-served by generic translation APIs. These models perform initial issue coding and summarization in the native language before translation, preserving nuance. Results are written to Relativity fields, allowing English-speaking reviewers to efficiently triage.

Reduce Reliance
On bilingual reviewers
IMPLEMENTATION PATTERNS

Example Custom AI Review Workflows

These workflows illustrate how custom machine learning models can be integrated with Relativity's Assisted Review (RAR) to handle specialized document types, legal domains, or complex review objectives that fall outside standard TAR capabilities.

Trigger: A new batch of engineering specifications, CAD files, and technical memos is ingested into a Relativity workspace.

Workflow:

  1. A custom model, trained on prior patent matter documents, analyzes the text and metadata of each technical document.
  2. The model scores documents for relevance to specific patent claims (e.g., claim_1_relevance_score: 0.87) and flags potential prior art references.
  3. Via the Relativity REST API, these scores and flags are written to custom fields on the document object.
  4. A Relativity Script or Event Handler automatically applies a High Priority Tech Review tag to documents exceeding a relevance threshold.
  5. These tagged documents are pushed to the top of the reviewer queue in the Active Learning dashboard, ensuring experts review the most critical technical evidence first.

Human Review Point: All model-prioritized documents are reviewed by a subject matter expert (patent attorney or engineer) who can confirm or correct the model's assessment, feeding back into the training loop.

A PRODUCTION BLUEPRINT

Implementation Architecture: Connecting Custom Models to RAR

A technical guide to deploying custom machine learning models that extend Relativity Assisted Review (RAR) for specialized legal domains and document types.

A production integration connects a custom model to RAR via Relativity's REST API and custom objects. The core pattern involves creating a dedicated Custom Object (e.g., Custom Model Prediction) that stores model scores, confidence levels, and metadata, linked to the base Document object. An external AI service, hosted on your infrastructure or a managed cloud, processes batches of documents retrieved via the API. Predictions are written back to the custom object, where they can be surfaced as RAR Fields in the viewer, used to power Saved Searches for prioritization, or drive Batch Sets for reviewer assignment. This architecture keeps the custom model's runtime outside of Relativity's core, ensuring scalability and avoiding performance impact on the review workspace.

Rollout follows a phased, matter-specific approach. Start with a pilot on a closed Batch Set of documents (e.g., 10k technical emails for an IP case). Use the RAR Continuous Active Learning (CAL) framework to compare the custom model's predictions against human reviewer coding, measuring precision/recall for your target issue (e.g., "Relevant to Patent Invalidity"). Integrate the model's top-confidence predictions as Suggestions in the review interface, allowing reviewers to accept/reject them, which feeds back into the model's training loop. Governance is critical: maintain an audit log of all API calls, document IDs processed, and predictions made, and establish a human-in-the-loop checkpoint for any model-driven decisions that affect privilege or final production sets.

This approach is valuable when native RAR classifiers or conceptual analytics lack domain-specific precision. For example, a model trained on SEC filing language can better identify "Forward-Looking Statements" in financial investigations, while a model fine-tuned on clinical trial protocols can spot "Patient Eligibility Criteria" in healthcare litigation. The result is a hybrid review system where RAR manages the workflow and sampling, and your custom model acts as a high-precision specialist, reducing the number of documents reviewers must examine manually for nuanced, case-specific issues. For related architectural patterns, see our guides on AI Integration with Relativity APIs and Scripts and AI for Predictive Coding and TAR in E-Discovery.

CUSTOM MODEL INTEGRATION PATTERNS

Code Patterns and API Integration Examples

Automating Custom Model Inference

Use a Relativity Script to pull documents from a saved search, send them to your custom model API, and write predictions back as choice fields. This pattern is ideal for post-processing enrichment or running a trained model on a stabilized dataset.

Key steps involve:

  • Querying the Relativity.Objects.Models namespace for document fields (Control Number, Extracted Text).
  • Batch processing documents (e.g., 100 at a time) to respect external API rate limits.
  • Mapping model outputs (e.g., "privilege_risk_score": 0.87) to pre-configured Relativity Choice fields (e.g., "Privilege Risk - High").
  • Implementing robust error handling and logging to the Relativity Errors tab for failed records.

This server-side execution is scheduled via the Relativity Agent Manager, ensuring it runs independently of the review interface.

CUSTOM MODEL VS. NATIVE ASSISTED REVIEW

Realistic Time Savings and Review Impact

This table illustrates the potential operational impact of integrating a custom-trained AI model to complement Relativity's native Assisted Review (RAR) capabilities. The comparisons are based on realistic implementations for specific document types or legal domains where off-the-shelf models may underperform.

Review Workflow StageBefore Custom AIAfter Custom AIImplementation Notes

Initial Responsiveness Triage

Manual keyword culling or broad RAR model

Domain-specific model prioritizes 15-25% of corpus

Model trained on past case data to identify case-specific hot docs earlier

Privilege Log Generation

Manual review of flagged docs + spreadsheet population

AI drafts log entries; attorney reviews and approves

Integrates with Relativity's tagging system; human-in-the-loop for final approval

Complex Financial Document Review

Linear review by contract attorneys

AI pre-tags document types and extracts key figures

Custom model trained to recognize loan agreements, trading confirms, and specific clauses

Quality Control Sampling

Random sampling of 5-10% of coded documents

AI-driven sampling targets potential coding inconsistencies

Analyzes reviewer patterns and document characteristics to flag high-risk batches for QC

Foreign Language Document Batch

Sent for external translation, then reviewed

AI provides gist translation and issue spotting in-platform

Enables preliminary review and prioritization before committing to full human translation

Reviewer Work Assignment

Manual assignment based on simple criteria (e.g., custodian)

AI suggests assignments based on reviewer expertise and doc complexity

Leverages custom object data on reviewer past performance and matter needs

Production Set QC

Manual checks for family relationships, duplicates

AI agent runs automated checks and flags exceptions

Scripted agent works off production reports; flags potential errors for human review

ENSURING CONTROLLED, COMPLIANT DEPLOYMENT

Governance, Security, and Phased Rollout

A custom AI model for Relativity Assisted Review is a powerful tool that requires a disciplined approach to security, validation, and user adoption.

Governance starts with the model's training data and intended scope. For a custom model, you must define its legal domain (e.g., antitrust communications, employment policy violations, specific contract clauses) and document the curated training set used, ensuring it's representative and free of privileged material. In Relativity, this model should be deployed as a supplement to RAR, not a replacement, with its predictions surfaced as custom fields or objects. Access controls via Relativity's native security groups are critical to restrict who can train, run, or view the model's outputs, while detailed audit logs track every prediction batch and user interaction for defensibility.

A phased rollout mitigates risk and builds confidence. A typical implementation follows this pattern:

  • Phase 1: Silent Validation. The model runs in the background on a closed matter, comparing its predictions to a human-reviewed control set. Metrics like precision, recall, and reviewer agreement are logged without influencing the active workflow.
  • Phase 2: Assisted Prioritization. The model's outputs are used to pre-populate a review queue or suggest coding, but all decisions require explicit reviewer confirmation. This phase focuses on UX, measuring time savings and user feedback.
  • Phase 3: Conditional Automation. For high-confidence predictions on well-defined issue types, the model can apply tags automatically, but with a defined exception workflow routing low-confidence items for human review. This phase often integrates with Relativity workspace templates and event handlers to automate the setup for new matters.

Security is paramount. The model itself, whether hosted on-premises or via a secure cloud API, must be accessed through a service account with minimal permissions. All data in transit between Relativity and the inference endpoint must be encrypted. For highly sensitive matters, an air-gapped deployment may be necessary. Finally, continuous monitoring for model drift is essential; as case types evolve, the model's performance should be periodically re-validated against new gold-standard sets to ensure its predictions remain reliable and defensible.

IMPLEMENTATION AND INTEGRATION

Frequently Asked Questions on Custom RAR Development

Building and deploying a custom machine learning model to extend Relativity Assisted Review (RAR) requires careful planning around data, integration, and governance. Below are answers to the most common technical and strategic questions from legal teams and developers.

Native RAR is excellent for general responsiveness. Custom models are built for specific, high-value scenarios where domain expertise or unique data patterns matter.

Typical custom model use cases:

  • Specialized Document Types: Analyzing technical patents, engineering schematics, financial derivatives documents, or clinical trial data where standard language models underperform.
  • Narrow Legal Issues: Identifying documents relevant to a specific clause (e.g., "best efforts," "change of control") or a particular regulatory violation (e.g., specific FTC rule language).
  • Non-English Language Review: Building a model specifically tuned for a language where pre-trained models have limited legal corpus training.
  • Prioritizing Subtle Concepts: Surfacing documents indicating "consciousness of guilt," "negotiation tension," or specific emotional sentiment not captured by keyword searches.

Integration Point: The custom model's scores are typically written back to a Relativity custom field (e.g., Custom_AI_Score). This allows reviewers to sort, filter, and create saved searches based on the custom model's predictions, operating in parallel with native RAR.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.