# How to add a private AI layer to Infor LX / BPCS on-prem

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

## Short answer

BPCS and Infor LX run on IBM i with their data in Db2 for i, in files that carry short coded names by module. A private AI layer reads those files through read-only SQL views over a replica, indexes documents and attachments separately, exposes approved queries through a tool server, and serves an open-weight model on local GPUs. Writes, if any, go through the supported transaction programs with human approval.

## Kind

advanced

## System

on-prem-apps

## Erp

Infor LX and BPCS (IBM i)

## Module

Private AI / Integration Architecture

## Query

Infor LX BPCS AI integration without cloud

## Alternate Queries

- how to use AI with BPCS on AS/400
- Infor LX chatbot Db2 for i
- local LLM for BPCS data

## Applies To

Infor LX 8.x and BPCS 6.x on IBM i; file names and library layout vary by release and by customer modification.

## Steps

### Reference build for Infor LX / BPCS

**Items:**

- List the BPCS or LX modules in use and the physical and logical files behind your first five questions.
- Confirm file and field meanings against your release documentation and your own modifications.
- Create read-only business-named SQL views in a separate library.
- Set up a replica or scheduled extract so the assistant never queries production.
- Serve an open-weight model on local GPUs and put a tool server in front with parameterised queries only.
- Map users to facilities and warehouses and apply the filter in the tool server.
- Pilot read-only questions, add drafts later, and keep an audit log of every query.

## Sections

### Data access paths in Infor LX / BPCS

**Body:**

BPCS uses a three-letter file naming convention by module. Commonly documented examples are IIM for the item master, ITH for inventory transaction history, ILI for item location inventory, ECH and ECL for customer order headers and lines, HPH and HPO for purchase order headers and lines, FSO for shop orders, and AVM and RCM for vendors and customers. Treat these as a starting list and confirm each against your own library and release before building views, because customers often add fields, logical files and entire custom files.

Access is plain SQL to Db2 for i through ODBC or the JTOpen JDBC driver, or through RPG and CL programs the customer already runs. Where a release provides an ION connector or documented interface files, those are the supported route for writes and event-driven feeds. For reads, SQL views with business names on top of the physical files keep the model away from cryptic field names.

**Code:**

-- Business-named read-only view over a BPCS item master (verify names in your library)
CREATE OR REPLACE VIEW AIREAD.ITEM_MASTER AS
SELECT IPROD AS ITEM_NUMBER, IDESC AS DESCRIPTION, IITYP AS ITEM_TYPE
FROM BPCSDATA.IIM;

-- Find which libraries and files carry a field before mapping it
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLUMN_TEXT
FROM QSYS2.SYSCOLUMNS
WHERE COLUMN_NAME = 'IPROD'
ORDER BY TABLE_SCHEMA, TABLE_NAME;

### Reference architecture, including the air-gapped option

**Body:**

A workable private AI layer for Infor LX / BPCS has six parts. First, a read-only data path: Db2 for i views over a replica or reporting copy so production is not queried. Second, a retrieval index over the documents and attachments people actually search, built with an open embedding model and stored in a vector database that runs on your servers. Third, a tool server, for example an MCP server, that exposes a short list of approved read actions with typed parameters. Fourth, an open-weight model served with vLLM or Ollama on local GPUs. Fifth, an identity layer that carries BPCS profile, facility and warehouse into every request. Sixth, an audit log of who asked what, which queries ran and which documents were retrieved.

The model never receives a database connection string. It asks the tool server to run a named action, and the tool server builds the parameterised query, applies the user's visibility filter and returns rows. This keeps free-form SQL generation out of production paths and makes every answer traceable to a query you can show the user. For an air-gapped site, all six parts run with no outbound route; model weights and updates arrive on approved media and are scanned and checked before use.

Point the assistant at a replica or a scheduled extract, not the production partition. Planners and customer service work during the day while MRP and batch runs hit the same files overnight, so isolating the AI workload protects both. A journal-based replica gives near-real-time data; an hourly extract into PostgreSQL is simpler and often enough for question answering.

### Permissions: the assistant must never show more than the user may see

**Body:**

BPCS security is largely driven by IBM i authority, menu and program-level controls, and facility or warehouse conventions in the application. A language model has no knowledge of these rules, so the tool server must apply them: resolve the user to their IBM i or BPCS profile, look up the facilities and warehouses they may see, and inject that filter into every query.

Keep cost, margin and pricing columns out of the default views and add them only for the roles that already see them on green screens.

### Write-back only through supported interfaces

**Body:**

Writes to BPCS tables should never come from the model directly. If you want drafted purchase orders or order comments, generate a structured draft, display it, and submit it through the vendor's supported transaction programs or interface files under the approving user's profile. Record who approved what and the posting result.

### Sizing, phased rollout and honest limits

**Body:**

Sizing depends on concurrency, not on headcount. A pilot of 10 to 20 users with a 7B to 14B class model can run on one workstation-class or datacentre GPU with 24 to 48 GB of memory. A site with 100 to 300 named users, of whom a third use it daily, often needs one to four GPUs depending on model size and answer length. Retrieval indexes for tens of thousands of documents are typically in the single to low double digit gigabytes. Use the sizing calculator for your own numbers and treat results as ranges.

Roll out in three phases. Phase one is read-only questions over a small set of views and documents, with every answer showing the query or sources. Phase two adds drafts, such as a summary, a message or a prepared transaction, that the user reviews but that nothing posts. Phase three adds approved actions through Infor LX / BPCS's supported interfaces, always under the approving user's identity, with an audit record.

Naming is the biggest obstacle. Without a dictionary of what each file and field means in your installation, models guess, and wrong guesses on money fields are costly. Plan the mapping as a real work item.

If the questions you need are fixed and repetitive, a few well-built queries or a report writer may serve you better than a language model. LX and BPCS releases that are far behind on IBM i level may also constrain driver versions, which is another reason to read from a replica.

## Pitfalls

- Assuming file names from public lists match your installation without checking.
- Letting the model write free-form SQL against production physical files.
- Ignoring customer-modified fields that change what a column means.
- Skipping facility and warehouse filters because the pilot team can see everything.
- Treating dates stored as numbers (such as century-based formats) as real dates without conversion.

## Ai Angle

ERPray and Netray's custom build work follow this pattern: read-only by default, the query is shown to the user, Infor LX / BPCS roles and visibility are respected, and everything runs on your hardware with open-weight models. Where a vendor's own AI or standard reporting already answers the question, we say so; the private layer earns its place for cross-system questions, document search and sites that cannot send data off premises.

## Faq

### Does this work for older BPCS releases?

**Answer:** Usually yes for reads, because the pattern needs only SQL access to Db2 for i. Older releases may constrain driver versions and journaling options, so a replica or extract is even more advisable there.

### Can the assistant create orders?

**Answer:** Not directly. It can prepare a draft that a user reviews, and the draft is then posted through supported transaction programs under that user's profile. That keeps the ERP's own validation and audit in the loop.

### How long does the data dictionary take?

**Answer:** Plan weeks, not days, for the first modules. Start with the 20 to 40 tables behind the first use cases and expand as questions demand it.

### Do we need a vector database?

**Answer:** Only for documents and attachments such as specifications and procedures. Structured questions over order and item data are answered by SQL, not by embeddings.

## Search terms

Infor LX AI, BPCS AI integration, BPCS AS/400 chatbot, Infor LX Db2 for i, AI for BPCS data, local LLM IBM i ERP, private AI BPCS, Infor LX reporting replica, BPCS file naming IIM ITH

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