Skip to main content

 
CXone Expert Clone Site 216

Notes

๐Ÿง  Project Summary: Bulk Generative Search Tester for NICE CXone Expert

This is a local web-based tool built to rapidly test and evaluate LLM responses inside NICE CXone Expert. It supports persona management, bulk prompt testing, result visualization, and export — all from a clean UI.


๐Ÿ“ Folder & File Structure


BulkExpertAITester/
├── index.html         ← Main frontend UI for persona + bulk testing
├── script.js          ← Frontend logic for UI behavior, API calls, table rendering
├── styles.css         ← Fully themed and responsive CSS styles
├── rules.json         ← Default persona rule profiles (used as fallback or import)
├── config.json        ← Private file with CXone domain + credentials
├── server.mjs         ← Node.js backend for CXone API interaction


▶ ๐Ÿ“„ What Each File Does

index.html

  • Defines the full UI layout.

  • Contains:

    • Persona Manager inputs

    • Accordion-style Question Configurator

    • Bulk test controls and results table

  • Includes buttons to add/import/export questions and profiles.


script.js

  • Handles all frontend behavior:

    • Auto-resizing inputs

    • Event listeners for buttons

    • Fetching and loading persona profiles

    • Triggering /bulk-completion API for LLM responses

    • Rendering completions + source links in a results table

    • Exporting to XLSX

    • Resetting test results


styles.css

  • Uses CSS variables for consistent theme control (colors, spacing, font)

  • Styled for:

    • Rounded buttons and inputs

    • Responsive layout

    • Hover states, table formatting

    • Beautiful accordion and floating status message

server.mjs

  • Express-based Node.js server

  • Provides secure backend endpoints:

    • GET /get-profile → fetch current CXone site profile

    • POST /load-profile → push a new persona profile to CXone

    • POST /bulk-completion → run multiple LLM completions in parallel

  • Handles HMAC signing using config.json credentials

  • Uses XML parsing to extract <completion> and <page> info


rules.json

  • Contains optional default profiles used to pre-fill persona data

  • Format matches CXone Expert property names

config.json (local only – NOT shared)

{
  "expertUrl": "https://your-instance.mindtouch.us",
  "apiKey": "your-key",
  "apiSecret": "your-secret"
}
  • Used only by the backend

  • NEVER exposed to frontend

 


▶ ๐Ÿงช How It Works (End-to-End)

  1. Frontend (index.html + script.js):

    • User edits persona, adds test questions (with tags and path ancestors)

    • Clicks Run Tests → sends /bulk-completion request

  2. Backend (server.mjs):

    • Authenticates with CXone using HMAC tokens

    • Calls CXone’s /@api/deki/llm/completion for each question

    • Parses XML response to extract LLM response + sources

    • Returns structured JSON to the frontend

  3. Frontend Displays:

    • Renders results table with completions and source page links

    • Allows multiple runs (Run 1, Run 2, etc.)

    • Export to Excel with persona profile + results

 


▶ ๐Ÿ› ️ Outstanding Work & Enhancements

✅ Completed:

  • ✅ Accordion-based UI for questions

  • ✅ Floating toast messages

  • ✅ Result table with source links

  • ✅ XLSX export (including persona profile rows)

  • ✅ "Reset Results" button

  • ✅ Accordion arrow fix

  • ✅ Apply-to-All for Tags/Paths

  • ✅ Fully themed UI with color variables

๐Ÿ”ง Outstanding / Possible Enhancements:

  • ๐Ÿ” Undo or Confirm Reset

  • Auto-expand textarea as user types

  • ๐ŸŽจ Dark Mode toggle

  • ๐Ÿ” Filter/sort result rows

  • ๐Ÿ“Š LLM diff highlighter across runs

  • ๐Ÿ“ Save/load question sets to file

  • ๐Ÿง  Agent-based persona testing (future)

 

๐Ÿงช Setup Instructions (Install on New Machine)

1. Copy files to folder

2. Install Node.js (if not already)

Download from: https://nodejs.org/en

Terminal>

cd "C:\Users\shannonn\OneDrive - Nice Systems Ltd\Documents\OtherWorkItems\BulkExpertAITester"

npm init -y

npm install express cors xml2js node-fetch

3. Create your own config.json

In the root folder, add:

{
  "expertUrl": "https://your-instance.mindtouch.us",
  "apiKey": "your-api-key",
  "apiSecret": "your-api-secret"
}

5. Start the server

node server.mjs

6. Open index.html in a browser

Just double-click it or drag into Chrome

  • Was this article helpful?