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
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
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
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
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
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.
- How many calls per month will this feature make, and what happens when the free allowance runs out?
- Which record fields go into prompts, and are any sensitive?
- Is the model call synchronous to a record save, and what is the latency impact?
- Who owns prompts, and how are changes reviewed?
- Does this need account-wide retrieval, and if so where will the index live?
- 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
NetSuite Agentic AI: SuiteAgents, Connector Agents and When to Build Your Own
NetSuite agentic AI explained: what SuiteAgents and connector-based agents can do, where approvals belong, and when a custom NetSuite AI agent is worth it.
NetSuite + grounded AIAI for NetSuite, Beyond the Built-In Text Tools
NetSuite's built-in AI covers text generation, not grounded answers on your own data. See how a private LLM over SuiteQL adds real Q&A and controls.
NetSuite AI readinessIs Your NetSuite Data Ready for AI? A Practical Readiness Check for Admins and Controllers
How to get NetSuite data ready for AI assistants and agents: custom fields, saved search sprawl, duplicate items and customers, segments, roles, definitions.
NetSuite ARM + SuiteBilling AIAI for NetSuite Revenue Recognition and Billing That Explains Every Revenue Plan
AI for NetSuite revenue recognition and billing: ask about revenue arrangements, plans and billing schedules, and trace ASC 606 exceptions without exports.
NetSuite + procurement AINetSuite Procurement With AI for Purchase Orders, Receipts and Vendor Bills
AI for NetSuite procurement: query purchase orders, item receipts and vendor bills with SuiteQL, flag three-way match breaks, and draft vendor follow-ups.
Oracle EBS + private AIHosting Oracle EBS on Private Cloud or On-Prem, With Private AI
Hosting Oracle EBS 12.2 on-prem or in a private cloud? Add a private LLM over concurrent programs, interface tables and AP/PO data without moving to Fusion.
Plan it with numbers
NetSuite SuiteScript Governance Units Estimator
Estimate how many records a SuiteScript execution can process under its governance limit and how many runs a batch will need.
Free ToolNetSuite SuiteScript 2.1 RESTlet Skeleton Generator
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.
Free ToolLLM Token Cost Calculator
Turn request volume, prompt length, and per-million token pricing into a defensible monthly and annual LLM budget, including the effect of prompt caching.
GuideLLM Integration Patterns for Enterprise ERP
Integrate large language models with enterprise ERP systems using RAG, fine-tuning, function calling, and prompt engineering patterns for production deployment.
GuideAgentic RAG Patterns for Production Systems
Agentic RAG patterns: query rewriting, iterative retrieval, self-correction, and tool-calling agents that decide when and what to retrieve, not just once.
GuidePII Redaction Pipelines for LLM Workloads
Design PII redaction pipelines for LLM workloads: NER-based detection, human review loops, and audit logging that satisfies compliance teams.
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
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.
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
- NetSuite SuiteScript 2.1 RESTlet Skeleton GeneratorFill in a script name, record type and fields to get a SuiteScript 2.1 RESTlet with GET lookup, POST create, logging and error handling.
- SuiteScript 1.0 to 2.1 Migration Checklist for NetSuiteA five-stage checklist for moving NetSuite scripts from SuiteScript 1.0 to 2.1: inventory, design, code changes, deployment cutover and testing.
- SuiteScript 2.1 RESTlet Skeleton GeneratorFill in a few fields and get a SuiteScript 2.1 RESTlet starter with all four handlers, logging and structured error responses.
ERP fixes and how-tos
- N/query versus N/search: choosing the right SuiteScript data access moduleCompare NetSuite's N/query (SuiteQL) and N/search modules for performance, governance cost and capability, and decide which to use for joins, aggregation, sublist reads and large exports in SuiteScript 2.1.
- Fix NetSuite MODULE_DOES_NOT_EXIST in SuiteScript 2.xMODULE_DOES_NOT_EXIST means NetSuite cannot resolve a define() dependency. Check the file path, file cabinet location, extension and SDF deployment order.
- Fix NetSuite SSS_USAGE_LIMIT_EXCEEDED ErrorSSS_USAGE_LIMIT_EXCEEDED means your SuiteScript ran out of governance units. Learn the cause, how to check usage, and fixes using submitFields and Map/Reduce.
Runs with your ERP
- Oracle Digital Assistant, OCI AI and JD Edwards OrchestratorHow JD Edwards Orchestrator calls OCI REST APIs for a chat assistant, document understanding and generative AI, with setup steps, pitfalls and on-prem options.
- RF-SMART WMS for NetSuite: barcode warehouse execution built inside the ERPHow RF-SMART WMS works inside Oracle NetSuite: SuiteApp install, receiving, picking, packing, cycle counts, replenishment, common pitfalls and AI use cases.
- NetSuite AI Connector Service (MCP) and SuiteAgents with Oracle NetSuiteHow the NetSuite AI Connector Service (MCP) and SuiteAgents work: what external AI assistants can do, setup, pitfalls and where a private AI layer fits.
AI on your ERP
- NetSuite Analytics Warehouse and AI: Machine Learning, Natural Language and When You Need ItWhat NetSuite Analytics Warehouse adds for AI and machine learning, when it beats SuiteAnalytics, and how an LLM can answer questions over warehouse data.
- AI for NetSuite, Beyond the Built-In Text ToolsNetSuite's built-in AI covers text generation, not grounded answers on your own data. See how a private LLM over SuiteQL adds real Q&A and controls.
Integrations
- How to add WhatsApp to Oracle NetSuiteHow to connect WhatsApp Business to Oracle NetSuite: SuiteScript triggers, RESTlets, template messages, opt-in rules and two-way replies that post back to records.
- How to integrate Microsoft Teams with Oracle NetSuiteConnect Oracle NetSuite to Microsoft Teams: approval cards, alerts, bots and Entra ID sign-in using SuiteScript, RESTlets and Power Automate or Bot Framework.