nodejsRhino - NodeJS API

  • Speech-to-Intent Engine
  • Domain Specific NLU
  • Offline NLU
  • Local Voice Recognition
  • Raspberry Pi
  • Linux
  • macOS
  • NodeJS
  • NPM

This document outlines how to integrate the Rhino Speech-to-Intent engine within an NodeJS application.


  • NodeJS 10+
  • yarn (or npm)


  • Linux (x86_64)
  • macOS (x86_64)
  • Raspberry Pi (2,3,4)

Web Browsers

Looking to run Rhino in-browser? See the Web, Angular, React, or Vue docs instead.


yarn add @picovoice/rhino-node


npm install @picovoice/rhino-node


The Rhino SDK for NodeJS provides the Rhino class. Here is an example using the sample "Coffee Maker" context file:

const Rhino = require("@picovoice/rhino-node")
const coffeeMakerContextPath = "./coffee_maker.rhn"
let handle = new Rhino(coffeeMakerContextPath)
let isFinalized = false
// process each frame of audio until Rhino has concluded that it understood the phrase (or did not)
// when Rhino has reached a conclusion, isFinalized will become true
while (!isFinalized) {
isFinalized = handle.process(frame)
// retrieve the inference from Rhino
if (isFinalized) {
let inference = handle.getInference()
// inference result example:
// {
// isUnderstood: true,
// intent: 'orderDrink',
// slots: {
// size: 'medium',
// numberOfShots: 'double shot',
// coffeeDrink: 'americano',
// milkAmount: 'lots of milk',
// sugarAmount: 'some sugar'
// }
// }
// always call release when finished to free the resources allocated by Rhino

Override model and library paths

The Rhino constructor accepts three optional positional parameters for the sensitivity and the absolute paths to the model and dynamic library, should you need to override them (typically, you will not).

let handle = new Rhino(contextPath, sensitivity, modelFilePath, libraryFilePath)

Custom Context

You can create custom Rhino context models using Picovoice Console.

Issue with this doc? Please let us know.