OracleERP Platform

SuiteScript generative AI

SuiteScript N/llm: Building Generative AI Inside NetSuite, and Knowing Its Limits

Short answer

The SuiteScript N/llm module lets server-side scripts call large language models hosted on Oracle Cloud Infrastructure Generative AI directly from NetSuite, to generate text, run Prompt Studio prompts, ground answers in supplied documents and create embeddings. It suits small, in-context features inside NetSuite; larger retrieval, private model or cross-system needs usually belong outside.

ERP
NetSuite SuiteScript 2.1, N/llm module, NetSuite Prompt Studio, OCI Generative AI
Industries
Manufacturing, Distribution, Software, Retail
Written for
SuiteCloud Developer

Before N/llm, adding generative AI to a NetSuite customization meant calling an external API from SuiteScript with N/https, storing an API key somewhere, and hoping legal had reviewed where the data went. N/llm gives SuiteCloud developers a native module instead. A Suitelet, RESTlet, user event or scheduled script can send a prompt to a model running on OCI Generative AI and get text back, with Oracle handling the model hosting.

That makes certain features almost trivial: summarizing a long case thread on a support case record, drafting a customer email from a sales order, classifying an incoming vendor bill memo, or answering a question over a handful of documents passed in as context. Developers who know SuiteScript can ship these in days, and the data stays within Oracle's cloud rather than going to a separate AI vendor.

The limits are worth knowing before you design around it. There is a monthly free usage allowance per account, after which you either stop or connect your own OCI Generative AI account and pay Oracle for usage. Model choice is limited to the families Oracle offers through the module. Scripts still run under NetSuite governance limits and timeouts. And document grounding means passing the documents in yourself; there is no managed vector store or search index across your whole account.

This page covers what the module does, the patterns that work, the ones that strain it, and how to decide between N/llm, the AI Connector Service and an external retrieval layer with your own models.

What usually gets in the way

The problems we hear most from suitecloud developer teams running NetSuite SuiteScript 2.1.

Free usage runs out in production

A feature that works well in sandbox can exhaust the monthly free allowance once hundreds of users trigger it. Without a plan for OCI billing or usage caps, the feature fails at month end.

No account-wide retrieval

N/llm can ground an answer in documents you pass to the call, but it does not search your account for you. Building retrieval over thousands of records needs embeddings, storage and search that you design.

Governance and timeouts

Model calls take seconds. In a user event script or a busy RESTlet, that latency and the governance cost per call can make record saves slow or hit limits.

Prompt sprawl across scripts

Prompts hard-coded in many scripts are hard to review and change. Prompt Studio helps, but only if the team adopts it consistently.

Limited model choice

You use the model families Oracle exposes. If you need a specific model, a fine-tuned model or an on-prem model for data reasons, N/llm is not the path.

Where AI earns its place in NetSuite SuiteScript 2.1

Each use case names the ERP objects it reads or writes, so your ERP team can judge the integration effort before anyone commits budget.

Case and thread summaries

A Suitelet or client-triggered RESTlet summarizes a support case's messages so the next agent sees the history in a paragraph.

Touches: SupportCase, Message records, N/llm generateText

Outcome: Cuts the read-in time on long cases; a natural first feature because the input is already text.

Customer communication drafts

Drafts an order confirmation, delay notice or collection reminder from sales order, fulfillment or invoice fields for a user to edit.

Touches: SalesOrder, ItemFulfillment, Invoice, N/llm generateText or evaluatePrompt with a Prompt Studio prompt

Outcome: Faster, more consistent messages; keep a human send step.

Vendor bill memo classification

Classifies free-text memos or descriptions on vendor bills into expense categories or flags ones that need review.

Touches: VendorBill, expense lines, custom list for categories, N/llm

Outcome: Speeds coding of routine bills; low-confidence results go to a reviewer.

Grounded Q&A over a few documents

Answers a question about a policy or contract by passing the relevant document text to the call as source documents and asking for cited answers.

Touches: File Cabinet documents, N/llm createDocument and generateText with documents

Outcome: Works well when the right documents are known in advance; not a substitute for search across many files.

Semantic matching with embeddings

Creates embeddings for item descriptions to find likely duplicates or match a customer's free-text request to catalog items.

Touches: Item records, N/llm embed, custom record to store vectors

Outcome: Useful for moderate catalogs; large catalogs usually need an external vector index.

Item and description enrichment

Generates or tidies sales descriptions, web copy and attributes from engineering fields, for review before publishing.

Touches: Item, custom item fields, N/llm generateText

Outcome: Saves writing time for catalog teams; Text Enhance may already cover simple cases without code.

Scheduled digest generation

A scheduled or map/reduce script assembles exception lists and asks the model to write a short plain-language digest for a manager.

Touches: Saved search results, scheduled script, N/llm, email via N/email

Outcome: Turns a raw exception list into something people read; watch usage volume.

Reference architecture

SuiteScript calls N/llm, which sends prompts to models hosted on OCI Generative AI and returns responses. Prompts can be managed in Prompt Studio. Anything beyond small in-context tasks typically moves to an external layer.

  1. 1

    Trigger script

    Suitelet, RESTlet, user event, scheduled or map/reduce script written in SuiteScript 2.1 that gathers record data and decides when to call the model.

  2. 2

    N/llm calls

    generateText for free-form prompts with optional chat history and documents, evaluatePrompt for Prompt Studio prompts with variables, embed for vectors, and functions to check remaining free usage.

  3. 3

    Prompt Studio

    Central place in NetSuite to manage prompts and their variables, so changes do not need script deployments and prompts can be reviewed.

  4. 4

    Model hosting

    OCI Generative AI models selected through the module's model family options; usage beyond the free allowance is billed through an OCI account you connect.

  5. 5

    External layer when needed

    For account-wide retrieval, private models, cross-system data or heavy volume, an external service calls NetSuite through SuiteQL and RESTlets and runs its own models.

Integration notes for your ERP team

  • N/llm is server-side SuiteScript 2.1; call it from Suitelets, RESTlets or server scripts, not from client scripts directly.
  • Check remaining free usage in code and fail gracefully when the allowance is exhausted, or connect your own OCI Generative AI configuration for paid usage.
  • Avoid model calls in synchronous user event scripts on high-volume records; move them to scheduled or map/reduce processing where latency does not block saves.
  • Use Prompt Studio and evaluatePrompt for prompts business users may want to adjust, so a wording change does not require a deployment.
  • When grounding with documents, pass only the relevant excerpts; large inputs cost more and dilute the answer.
  • Store embeddings in a custom record only for modest volumes; beyond that, use an external vector index.
  • Check Oracle's release notes for model family availability and regional support in your data center.

Deployment options

N/llm only

Small features inside NetSuite records and screens

Native, fast to build, data stays in Oracle's cloud, within free usage or OCI billing.

N/llm plus Prompt Studio governance

Teams shipping several AI features

Prompts managed centrally, usage tracked, and a review step for prompt changes.

External retrieval and private models

Account-wide Q&A, sensitive data, multi-system answers

Open-weight models on vLLM in a private cloud or on-prem, with retrieval over NetSuite and documents, calling NetSuite through an integration role.

Compliance and data control

How the architecture supports your obligations. Certification and accountability stay with your organisation; the design keeps the evidence straightforward.

Data handling

Review Oracle's terms for OCI Generative AI usage through N/llm and document which record fields your scripts send in prompts.

SOX

Keep model output advisory for financial fields; scripts should not post journals or change amounts based on model output without approval.

Privacy (GDPR, CCPA)

Minimize personal data in prompts; send IDs and needed fields only, not whole customer records.

Change management

Treat prompts as code: version them, review changes, and test in sandbox before production.

How an engagement runs

Phase 1 . 1 week

Use-case selection

  • -Shortlist of in-record AI features
  • -Volume and usage estimate against free allowance
  • -Decision on N/llm versus external layer per use case

Phase 2 . 2-4 weeks

Build

  • -SuiteScript with N/llm calls
  • -Prompt Studio prompts with variables
  • -Usage checks and graceful failure

Phase 3 . 1-2 weeks

Test

  • -Sandbox test set with expected outputs
  • -Latency and governance measurements
  • -User acceptance with a pilot group

Phase 4 . Ongoing

Operate

  • -Usage monitoring and OCI billing review
  • -Prompt change process
  • -Release-note review each NetSuite release

Questions to ask any vendor, including us

A short list that separates real NetSuite SuiteScript 2.1 AI work from a chatbot demo.

  1. How many calls per month will this feature make, and what happens when the free allowance runs out?
  2. Which record fields go into prompts, and are any sensitive?
  3. Is the model call synchronous to a record save, and what is the latency impact?
  4. Who owns prompts, and how are changes reviewed?
  5. Does this need account-wide retrieval, and if so where will the index live?
  6. Would a built-in feature such as Text Enhance cover this without code?

Frequently asked questions

What is the SuiteScript N/llm module?

N/llm is a SuiteScript 2.1 module that lets server-side scripts call large language models hosted on OCI Generative AI. It supports generating text from a prompt, continuing a chat with history, grounding responses in documents you supply, running prompts managed in Prompt Studio, and creating embeddings. It brings generative AI into NetSuite customizations without a separate AI vendor.

Is N/llm free to use?

Each account gets a monthly free usage allowance, and scripts can check how much remains. Beyond that, you can connect your own OCI Generative AI account so usage is billed by Oracle, or design features to stop gracefully. Exact allowances and pricing change, so check current Oracle documentation and estimate your volume before rolling a feature out widely.

Which models does N/llm use?

It uses model families that Oracle offers through OCI Generative AI and exposes in the module, which have included Cohere and Meta Llama models. The list has changed over releases. If you need a particular model, a fine-tuned one, or a model running in your own environment, you will need an external integration instead.

Can N/llm answer questions across all my NetSuite data?

Not on its own. It answers from what you put in the prompt and the documents you pass. To answer questions across your account, you need retrieval: queries or searches that find the right records first. For broad Q&A, an external layer with SuiteQL access and its own index is usually more practical.

How is N/llm different from the NetSuite AI Connector Service?

N/llm runs inside NetSuite and lets your scripts use a model to build features in records and screens. The AI Connector Service runs the other way: it lets an external AI client, such as Claude, call into NetSuite through MCP. Many companies will use both for different needs.

What is Prompt Studio in NetSuite?

Prompt Studio is where administrators manage prompts used by NetSuite generative AI features and by scripts calling evaluatePrompt. It lets you edit prompt wording and variables without redeploying scripts and gives you one place to review what the model is being asked to do.

When should I not use N/llm?

Skip it when data cannot be processed in Oracle's generative AI service under your policies, when you need a specific or private model, when the feature needs retrieval across thousands of records or other systems, or when call volume would make OCI costs or governance limits a problem. An external layer handles those better.

Related guides

Talk it through with an engineer who knows NetSuite SuiteScript 2.1

Bring one real question your team cannot answer from the ERP today. We will map the data path, the model, and where it runs, and tell you honestly if AI is the wrong tool for it.

Try it here, free

NetSuite SuiteScript 2.1 RESTlet Skeleton Generator

Open full tool

Fill in a script name, record type and fields to get a SuiteScript 2.1 RESTlet with GET lookup, POST create, logging and error handling.

Get NetSuite alerts

Support and maintenance deadlines, release changes that affect NetSuite sites, and new free NetSuite tools. A couple of emails a month at most.

Free. Unsubscribe with one click from any email.

ArchRay builder
Design the on-prem AI stack for NetSuite: model, GPUs, RAG pipeline, guardrails
See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
Open the builder

New to NetSuite? Start with the NetSuite guide and toolkit, or plan with NetSuite Cost Calculator, Training Path Builder, ERP Certification Study Planner.

Keep exploring

Free tools

ERP fixes and how-tos

Runs with your ERP

AI on your ERP

Integrations

Comparisons

Software