# How to Add AI to Lotus Notes and HCL Domino Databases On-Prem

> Source: https://netray.co/erp-help/private-ai-layer-lotus-notes-domino-on-prem-architecture
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: ERP Help

## Short answer

Notes and Domino applications hold years of quality records, quotes, approvals and email in NSF databases that no modern tool reads easily. A private AI layer can read them through the Domino REST API, Domino Access Services or DQL on a replica, extract rich text and attachments, honor ACLs and Readers fields, and serve an open-weight model on local GPUs, so nothing leaves the Domino network.

## Kind

advanced

## System

on-prem-apps

## Erp

Lotus Notes / HCL Domino

## Module

NSF databases and applications

## Query

how to add AI to Lotus Notes or HCL Domino databases

## Alternate Queries

- HCL Domino REST API AI integration
- search Notes NSF databases with an LLM on-prem
- Lotus Notes application modernization with private AI

## Applies To

Domino 9.x to 14.x servers. The Domino REST API and DQL need a recent server release; older servers use DAS, DXL export or NotesSQL.

## Steps

### Add a private AI layer to Domino applications

**Items:**

- Inventory databases with the Domino Administrator client or a catalog scan: replica ID, size, last modified, ACL and the forms and views each uses. Retire what nobody opens.
- Create a read-only replica on a separate Domino server for AI use, so extraction never loads the production server.
- Choose the access route: Domino REST API or DAS for documents and views, DQL for queries, DXL export for bulk extraction.
- Extract items from forms, convert rich text to plain text, and pull attachments ($FILE items) to run through text extraction.
- Record for each document its Readers and Authors fields and the database ACL, and store them as principals on each chunk.
- Run the incremental job by modified time or replication events, applying deletions as well as updates.
- Put approved read tools behind an MCP or HTTP server and serve a local open-weight model, with every call logged.

## Sections

### Data access paths

**Body:**

A Notes database (NSF) is a document store, not a relational one. Data lives as items on documents, each document uses a form, views build sorted indexes, and agents hold logic in LotusScript, Java or formulas. There is no table to SELECT from in the usual sense. The data you want is in item names that only the application designers know, so start by exporting a few documents and mapping items to meaning.

The main read paths are the Domino REST API (the current HTTP and JSON interface, with scopes, schemas and query support), Domino Access Services (the older REST interface using /api/data/ paths), the Domino Query Language (DQL) for item-based queries on newer servers, DXL export for XML of documents and design, the Notes C, Java and LotusScript APIs, and NotesSQL for ODBC read access. For an AI layer, REST or DQL on a replica is usually the cleanest.

**Code:**

# Domino Access Services: documents from a view (enable DAS on the server and database)
GET https://domino.corp.local/quality/ncr.nsf/api/data/collections/name/OpenNCRs?start=0&count=100

# DQL: item-based query run against a database (syntax per HCL documentation)
Form = 'NCR' and Status = 'Open' and Created > @dt('2025-01-01')

# DXL export for bulk extraction (LotusScript NotesDXLExporter or Java API) yields XML with items and rich text

### Reference architecture

**Body:**

Reference architecture used on every page of this series: (1) a read-only replica or reporting copy of the data, (2) change capture so the index stays current, (3) a retrieval index with the source ACLs stored beside every chunk, (4) a tool server (MCP or plain HTTP) that exposes only approved read actions, (5) an open-weight model served with vLLM or Ollama on local GPUs, (6) an append-only audit log. For Domino, native replication gives you the read-only replica for free: replicate selected databases to a dedicated server and point the extraction job at it.

The extraction job converts each document to a record: form, item values, rich text as plain text, attachments extracted, the modified time and the access control metadata. Rich text can include embedded objects, doclinks and images, which need handling rules. The vector index stores chunks with their principals, and the tool server returns the document URL (notes:// or a web link) so users can open the original. Air-gapped: the replica server, extraction job, index and model sit in the same closed network, with updates arriving by hash-verified transfer.

### Permissions: ACLs and Readers fields

**Body:**

Domino security has layers. The database ACL assigns levels from No Access up through Reader, Author, Editor, Designer and Manager, with roles. Documents can also have Readers fields, which restrict who can see the document even if the ACL would allow it, and Authors fields, which limit editing. An extraction account with Manager rights sees everything, which is exactly why a naive index leaks.

Capture the effective reader list for every document: the Readers items if present, otherwise the ACL entries that can read. Store these on each chunk, expand groups from the Domino Directory at question time and filter retrieval. Encrypted fields and encrypted documents cannot be read without the key, so exclude them explicitly. Test with a user who is not on a document's Readers field and prove that it never appears in an answer.

### Sizing, rollout, write-back and limits

**Body:**

Domino estates vary widely. A shop with 200 databases, 1 million documents and 600,000 attachments yields a few million chunks, a modest index. Many users are occasional, so a single GPU serving a 7B to 14B model often supports a pilot; scale with concurrency. The extraction of rich text and attachments is the long job.

Phase one: cited search and Q&A over a few databases. Phase two: summaries and drafts, for example summarizing a long approval history. Phase three: approved actions, such as creating a document or advancing a status, through the Domino REST API or an agent, with a named approver. Limits: poorly structured rich text yields poor answers, lost design knowledge slows mapping, HCL has been adding its own AI features to recent Domino releases and may be enough for email-centric needs, and a database nobody uses should be archived rather than indexed.

## Pitfalls

- Extracting as a Manager account and ignoring Readers fields. This is the classic Notes data leak.
- Hitting the production server with bulk reads. Use a dedicated replica.
- Dropping attachments. Many quality and engineering records live only in $FILE items.
- Treating rich text as plain. Tables, embedded objects and doclinks need conversion rules.
- Not handling deletions and replication conflicts. Stale or duplicate documents confuse answers.
- Indexing encrypted documents you cannot read. Exclude and report them.

## Ai Angle

DataRay was built for sources like this: chat across databases, file stores and documents on-prem, with visible sources and read-only access. For Domino, Netray writes the extraction, the Readers-aware index and the tool server with your Notes administrators, then serves the model on your hardware. If you need only email search, HCL's own capabilities may suffice.

## Faq

### Which interface should we use to read NSF data?

**Answer:** Prefer the Domino REST API or DAS for documents and DQL for queries, run against a dedicated replica. Use DXL for bulk export and NotesSQL only when ODBC is a hard requirement.

### How are Readers fields handled?

**Answer:** Capture each document's Readers items and the database ACL, store the resulting principals on its chunks, expand groups at question time and filter before retrieval. Never index as an all-seeing account without keeping this metadata.

### Can attachments be searched?

**Answer:** Yes. Pull $FILE items, run text extraction and OCR for scans, and index them with the parent document's access metadata. This is often the most valuable content in quality and engineering databases.

### Do we need to migrate off Domino first?

**Answer:** No. Reading through supported interfaces on a replica works against the current system, and the same extracted data helps if you migrate later.

### What if nobody understands the old application?

**Answer:** Start with the forms and views, export sample documents and map item names to meaning with the last users. If a database has no active users and no retention duty, archive it and leave it out of the index.

## Search terms

lotus notes ai, hcl domino ai integration, domino rest api ai, notes nsf search llm, domino dql query, domino readers fields security, private llm lotus notes, domino application modernization

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
