Relativity's architecture is built for extension, providing three primary surfaces for AI integration: its REST API for programmatic data access and object manipulation, Event Handlers for triggering AI workflows on data changes, and Relativity Scripts for executing custom logic within the application context. This means AI can be wired to act on specific objects—like documents, fields, or custom objects—at defined moments in a review workflow, such as after ingestion, on field update, or before production.
Integration
AI Integration with Relativity APIs and Scripts

Where AI Connects to Relativity's Extensible Platform
A technical blueprint for injecting AI directly into Relativity's data model, automation layer, and user workflows via its core extensibility surfaces.
For a production implementation, you typically architect a middleware service (often using Python or .NET) that listens for webhooks from Relativity Event Handlers. This service calls your AI models—for summarization, classification, or entity extraction—and then uses the Relativity API to write results back as field values, apply tags, or create related custom object records. Common integration patterns include:
- Batch Enrichment: Processing a saved search of documents via the API, applying AI analysis, and populating a custom field for reviewer guidance.
- Real-time Trigger: An Event Handler on a
Documentfield change fires a webhook to an AI service that analyzes the new text and updates aRisk Scorefield. - Agent Workflow: A Relativity Script presents a UI button for reviewers; when clicked, it calls an external API to summarize the current document and displays the result inline.
Governance is critical. All integrations should leverage Relativity's native audit trails and RBAC. AI services should be deployed as containerized microservices with their own logging, and prompts, model versions, and confidence scores should be stored in a dedicated Relativity custom object for traceability. Rollout follows a phased approach: start with a pilot workspace, use the API for non-destructive field writes, and implement human-in-the-loop review steps before full automation. This ensures the AI augments—rather than disrupts—the rigorous legal process Relativity is designed to support.
Primary Integration Surfaces in Relativity
Programmatic Data Enrichment
The Relativity REST API provides the most direct path for integrating external AI services. Core integration patterns involve using the /workspace/{workspaceArtifactId}/object endpoints to create, read, update, and delete custom objects that store AI-generated insights.
Key Use Cases:
- Batch Processing: After an AI service analyzes a document set, results (like extracted entities, summaries, or classification scores) are written back to Relativity as fields on the
Documentobject or a related custom object (e.g.,AI_Analysis). - Real-time Enrichment: For user-triggered actions, a middleware service calls the AI model and immediately updates the document's layout with the result via a PATCH request.
Example Payload for Adding an AI-Generated Summary:
json{ "ArtifactTypeID": 10, // Document Artifact Type "ArtifactID": 1023456, "FieldValues": [ { "Field": {"Name": "AI_Summary"}, "Value": "This email chain discusses Q4 budget projections, with key figures proposed by John Smith (Finance)." } ] }
This enables AI outputs to become first-class, searchable data within the platform's ecosystem.
High-Value AI Use Cases for Relativity
Connect custom AI models and LLMs directly into Relativity's core workflows via its REST API, Event Handlers, and Relativity Scripts. These patterns extend native analytics, automate manual review tasks, and create intelligent custom objects for faster, more consistent legal outcomes.
Automated Privilege Log Generation
Deploy an AI agent that analyzes document content and metadata to identify privileged communications (attorney-client, work product). The agent uses Relativity's API to tag documents, populate a custom object with privilege rationale, and auto-generate a privilege log spreadsheet, reducing manual review from days to hours.
Dynamic Concept Clustering & Tagging
Augment keyword search by integrating a semantic AI model via a Relativity Script or Event Handler. As documents are ingested, the model creates dynamic conceptual clusters (e.g., 'regulatory compliance discussions', 'pricing negotiations') and applies them as Smart Fields, enabling reviewers to pivot instantly to thematic document groups.
AI-Powered Production QC Agent
Build a pre-export QC workflow using an AI agent triggered via Relativity's Event Handler system. The agent validates Bates numbering consistency, checks for broken family relationships, and flags potential redaction errors by comparing native files to produced images, catching costly mistakes before delivery.
Deposition Transcript Summarization
Integrate an LLM via the REST API to process loaded deposition transcripts. The AI generates concise summaries with speaker-specific Q&A, extracts key factual assertions, and creates linked Relativity Custom Objects for chronology building. Reviewers can query the transcript via natural language directly in the workspace.
Predictive Custodian Ranking
Leverage communication pattern analysis AI to score and rank custodians at case onset. The model analyzes To/From/CC metadata and content themes via the API, outputting results to a Custom Object for custodian management. This guides legal hold and collection strategy, focusing resources on the most relevant individuals.
Continuous Active Learning (CAL) Enhancement
Extend Relativity Assisted Review (RAR) by integrating a custom machine learning model via Relativity Scripts. The external model provides additional scoring signals (e.g., sentiment, specific clause detection) that are fed back into the review queue as weighted fields, improving prioritization for complex document sets.
Example AI-Enhanced Workflows
These workflows demonstrate how to connect custom AI services to Relativity's extensibility points, automating review tasks and enriching case data. Each pattern includes the trigger, data flow, AI action, and system update.
Trigger: A Relativity Saved Search is executed on a document set marked for privilege review.
Data Flow:
- A Relativity Script or external service polls for new results in the saved search via the REST API (
/Relativity.REST/api/Relativity.Objects/workspace/{workspaceId}/object/query). - For each document, the system retrieves key metadata (Control Number, Family ID, Custodian) and the extracted text field via the API.
- This payload is batched and sent to a privilege classification AI service.
AI Action: The AI model analyzes each document's text and metadata to:
- Classify the privilege type (e.g., Attorney-Client, Work Product).
- Extract the basis for the claim (e.g., "Communication seeking legal advice").
- Identify the privileged participants.
System Update:
- Results are posted back to Relativity using the API to update a custom object type (e.g., "Privilege Log Entry"), linking to the source document.
- A CSV report is auto-generated via the Relativity Scripts API and attached to the workspace.
- The source document's "Privilege Status" choice field is updated.
Human Review Point: The generated log is routed to a senior reviewer's queue in Relativity for final approval before production.
Implementation Architecture and Data Flow
A technical blueprint for wiring custom AI services into Relativity's extensible framework using its REST API, Event Handlers, and Relativity Scripts.
A production-grade AI integration for Relativity typically follows an event-driven, asynchronous pattern to avoid blocking core review workflows. The architecture centers on Relativity's REST API for CRUD operations on documents, fields, and custom objects, and its Event Handler system for triggering AI processing. Common entry points include:
/Relativity.REST/api/endpoints to push enriched data back into workspace fields or custom objects.- Post-Save Event Handlers on the
Documentobject or a custom "AI Processing Queue" object to trigger analysis when new data arrives or statuses change. - Relativity Scripts executed via the API or console for batch operations, such as sending a set of prioritized documents to an external AI service for summarization or issue coding.
The data flow for an AI-assisted review agent often looks like this:
- Trigger: A document is saved with a
PENDING_AI_REVIEWstatus (set by a reviewer or an ingestion script). A Post-Save Event Handler fires. - Extract & Queue: The handler bundles the document's extracted text, metadata (Author, Sent Date), and Relativity Artifact ID into a JSON payload, posting it to an external message queue (e.g., AWS SQS, RabbitMQ) or directly to an AI orchestration service. This keeps Relativity responsive.
- Process: The AI service (hosted on your infrastructure or a cloud provider) retrieves the payload, runs the document through configured models (e.g., for privilege detection, concept tagging), and generates results.
- Write Back: Using a service account with appropriate permissions, the AI service calls the Relativity REST API to update the source document. This involves:
- Patching choice fields (e.g.,
AI_Issue_Codes) with multi-select values. - Updating long text fields with generated summaries or extracted clauses.
- Creating related custom object records (e.g.,
AI_Extracted_Entities) to store structured findings without altering the native document table.
- Patching choice fields (e.g.,
- Audit: All API calls and field changes are logged within Relativity's native audit trail, and the external service maintains its own execution logs for traceability.
Governance and rollout require careful planning. Start with a single-workspace pilot, using a dedicated custom object as a processing queue for better control and error handling. Implement rate limiting and retry logic in your external service to respect Relativity API thresholds. For sensitive data, ensure your AI service is deployed in a compliant environment and that prompts are configured to avoid generating sensitive information. Use Relativity's RBAC to restrict which users can trigger AI jobs or view AI-generated fields, and establish a human-in-the-loop review step for critical tags like privilege before they are used in production sets. This architecture provides the foundation for scalable, maintainable AI enhancements that feel native to legal teams.
Code and Payload Examples
Creating Custom Tags via Relativity REST API
Use Relativity's REST API to programmatically create and apply tags based on AI analysis. This pattern is ideal for batch processing after an external AI service analyzes a document set. The API call creates a Tag object associated with specific documents.
Example Payload (POST to /Relativity.Rest/api/Relativity.Objects/workspace/{workspaceId}/object/create)
json{ "objectType": { "artifactTypeID": 1000017 }, "fieldValues": [ { "field": { "name": "Name", "artifactID": 1003667 }, "value": "AI-Privilege-Review" }, { "field": { "name": "Documents", "artifactID": 1003668 }, "value": [ { "artifactID": 10234567 }, { "artifactID": 10234568 } ] } ] }
This creates a new tag named "AI-Privilege-Review" and applies it to two specific documents. You would populate the document artifactID array from your AI service's output.
Realistic Time Savings and Operational Impact
This table illustrates the operational impact of integrating AI with Relativity via its APIs and Scripts, focusing on specific review and data management tasks. Metrics are based on typical pilot implementations and assume proper integration with existing Relativity objects and workflows.
| Workflow / Task | Before AI Integration | After AI Integration | Implementation Notes |
|---|---|---|---|
Initial Document Triage & Tagging | Manual review for responsiveness; 2-4 hours per GB | AI pre-tags for responsiveness & issues; QC review in 30-60 min per GB | Uses Relativity Event Handlers to trigger AI on ingestion; outputs to custom objects or choice fields. |
Privilege Log Generation | Manual extraction of key fields and descriptions; 8-12 hours per case | AI drafts privilege descriptions & extracts metadata; attorney review in 2-3 hours | Scripts call AI service via REST API, populate a custom Relativity object; final export to spreadsheet. |
Email Thread Analysis | Reviewer manually identifies root emails and key messages | AI identifies root messages, summarizes threads, flags sentiment shifts | Analysis runs via background agent; results stored as thread-level custom fields for reviewer sorting. |
Concept Clustering & Search | Keyword-based searches; manual review of results for relevance | Semantic search finds conceptually related docs; dynamic clusters created on-the-fly | Integrates with Relativity's search index via API; clusters appear as saved searches or dynamic folders. |
Production Set Quality Control | Manual spot-check of Bates ranges, families, and redactions | AI agent validates numbering, checks family integrity, flags potential errors | Runs as a pre-production Relativity Script; generates a QC report within the workspace. |
Deposition Transcript Summarization | Manual reading and highlighting of key testimony | AI generates summary with Q&A, key quotes, and speaker attribution | Transcript load file triggers processing; summary and tags are imported as a related document set. |
Custodian Communication Pattern Analysis | Manual review of To/From fields and date ranges | AI maps communication networks, identifies central custodians, ranks by relevance | Leverages Relativity's communication data model; outputs visualizations and custodian ranking reports. |
Governance, Security, and Phased Rollout
A production-ready AI integration for Relativity requires a structured approach to security, data governance, and incremental rollout.
Integrations should leverage Relativity's robust security model. AI services are invoked via the Relativity REST API using service accounts with role-based access control (RBAC) scoped to specific workspaces. All data exchanges are encrypted in transit, and sensitive PII/PHI can be processed in a private, VPC-isolated AI environment. Audit trails are maintained by logging all AI actions—such as tag creation via Relativity Scripts or object updates via Event Handlers—back to Relativity's audit system, ensuring a complete chain of custody for AI-assisted decisions.
A phased rollout mitigates risk and builds stakeholder trust. Start with a non-production workspace to validate API calls, prompt effectiveness, and output formatting. Phase 1 often targets a single, high-volume workflow like email threading analysis or initial batch tagging for a defined custodian set. Use Relativity's batch processing capabilities to queue documents for AI review, allowing for human QC of the AI's output before tags are committed. Phase 2 expands to real-time processing via Event Handlers for new document ingestion, and Phase 3 introduces more complex, multi-step agent workflows for timeline generation or privilege prediction.
Governance is maintained through a feedback loop. Establish a review committee to approve AI use cases and monitor performance metrics like precision/recall on a sample set. Implement a human-in-the-loop approval step for critical actions, such as applying Privileged tags, which can be managed through a custom Relativity object and workflow. Regular reviews ensure the AI agents align with matter strategy and evolving review protocols. This structured approach allows legal teams to harness AI's efficiency while maintaining the defensibility and control required for complex litigation and investigations.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Technical questions for developers and architects planning to connect AI services to Relativity via its REST API, Event Handlers, and Relativity Scripts.
You can integrate AI at three main layers within Relativity:
-
REST API: For external orchestration. Use it to:
- Pull document text and metadata in batches for processing by an external AI service.
- Push AI-generated tags, summaries, or custom object data back into Relativity fields.
- Trigger workflows or check job statuses programmatically.
-
Event Handlers: For real-time, in-platform reactions. Deploy a custom Event Handler to:
- Intercept events like
Document SavedorField Updated. - Call an AI model synchronously or asynchronously via an HTTP request.
- Immediately update the document with AI-derived insights (e.g., auto-tagging for PII upon upload).
- Intercept events like
-
Relativity Scripts: For user-initiated, batch AI operations. Write scripts that:
- Operate on a saved search or selection of documents.
- Call out to your AI endpoint, handle pagination and rate limits.
- Update fields and provide progress feedback to the reviewer in the UI.
Key Consideration: The REST API is best for high-volume, scheduled batch jobs. Event Handlers enable real-time automation but must be performant. Scripts offer user control and are ideal for on-demand analysis.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us