Harness the power of AI to streamline your NetSuite workflows. Get instant answers, make better decisions, and boost productivity.
Revolutionize your NetSuite experience with AI-powered solutions
Get instant, accurate answers to your NetSuite queries 24/7. Save hours with immediate solutions to your challenges.
Our AI solutions are designed to assist various roles within your organization, from administrators to end users.
Your data security is our top priority. Our solution is designed with enterprise-grade security measures.
Built with NetSuite's native AI capabilities
/**
* @NApiVersion 2.1
* @NScriptType Suitelet
* @NModuleScope Public
* @Author Shubham Kaila
*/
define(['N/llm'], function(llm) {
return {
onRequest: function(context) {
try {
if (context.request.method !== 'POST') {
throw new Error('Only POST method is supported');
}
const body = JSON.parse(context.request.body);
const userMessage = body.message;
const chatHistory = body.chatHistory || [];
// Format chat history for the prompt
let formattedHistory = '';
if (chatHistory.length > 0) {
formattedHistory = chatHistory.map(msg =>
`${msg.role === 'user' ? 'User' : 'Assistant'}: ${msg.content}`
).join('\n');
}
// Build the system prompt
const systemPrompt = `You are a knowledgeable NetSuite assistant designed to help users with their queries effectively.
Context: The user is currently working within the NetSuite environment and requires assistance with specific tasks or questions related to their operations.
Please refer to the official NetSuite documentation for accurate information: https://docs.oracle.com/en/cloud/saas/netsuite/index.html.
Ensure your responses are clear, concise, and actionable, providing step-by-step guidance when necessary.
Previous conversation:
${formattedHistory}
Current user message: ${userMessage}
Based on the conversation history and current question, provide a relevant and contextual response.`;
// Call N/llm module with enhanced prompt
const response = llm.generateText({
prompt: systemPrompt,
modelFamily: llm.ModelFamily.META_LLAMA,
modelParameters: {
maxTokens: 1000,
temperature: 0.2,
topK: 3,
topP: 0.7,
frequencyPenalty: 0.4,
presencePenalty: 0
}
});
context.response.write(JSON.stringify({
success: true,
response: response.text
}));
context.response.setHeader({
name: 'Content-Type',
value: 'application/json'
});
} catch (error) {
context.response.write(JSON.stringify({
success: false,
error: error.message
}));
}
}
};
});
Save the code as a .js file. Name it SuiteAIChat.js
Customization > Scripting > Scripts > New
Select suiteAI_SL.js
Script ID: _netsuite_chat_assistant
Create a deployment without a deployment ID
Save and activate the script deployment
Affordable plans to suit your needs
Just $9.99/month after the trial!
Powered by ExtensionPay and Stripe.
Subscribe NowExplore our suite of NetSuite extensions
Transform your NetSuite transaction analysis with advanced summary calculations, visual enhancements, and quick ID copying capabilities.
Transform your NetSuite experience with powerful analytics and visualization tools designed for AR/AP professionals, finance professionals, controllers, and business analysts.
Pioneering AI Solutions for NetSuite
We are a team of NetSuite experts and AI specialists dedicated to revolutionizing how businesses interact with their ERP systems. Our mission is to make NetSuite more accessible, efficient, and user-friendly through innovative AI solutions.
Get in touch with our team