npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

chatbot-ai-js

v3.0.0

Published

Modern JavaScript library for building intelligent chatbots with on-device NLU and Nvidia AI integration. Now with fully functional WhatsApp and Telegram adapters!

Downloads

754

Readme

npm version License: MIT GitHub stars

chatbot-ai-js

Library JavaScript Modern untuk Membangun Chatbot AI dengan Nvidia AI Backend.

chatbot-ai-js adalah pustaka Node.js yang dirancang untuk mempercepat pengembangan chatbot berbasis AI. Pustaka ini menggabungkan kemampuan Natural Language Understanding (NLU) on-device dengan integrasi native ke Nvidia Build (build.nvidia.com), memberikan akses ke ratusan model AI (MiniMax-M3, Llama, Mistral, dll.) dengan satu API key.

🌟 Fitur Utama

  • NLU On-Device: Klasifikasi intent menggunakan Jaccard Similarity — transparan, cepat, dan fail gracefully.
  • Nvidia AI Native: Integrasi langsung ke Nvidia Build API. Gunakan model apa saja (MiniMax-M3, Llama 3, dll.) dengan satu API key.
  • Dialog & Context Manager: Stateful conversation per sesi dengan dukungan short-term memory.
  • Multi-Channel Adapter: Konektor siap pakai untuk WhatsApp (Baileys) dan Telegram.
  • Middleware Pipeline: Fleksibel untuk preprocessing, logging, dan filtering.

📦 Instalasi

npm install chatbot-ai-js

🚀 Contoh Penggunaan Cepat

import { ChatbotAI } from 'chatbot-ai-js';

const bot = new ChatbotAI({
  backendConfig: {
    apiKey: 'nvapi-YOUR_NVIDIA_API_KEY', // Dapatkan dari build.nvidia.com
    model: 'minimaxai/minimax-m3'         // Atau model lainnya
  }
});

// Tambahkan intent dan contoh kalimat
bot.addIntent('salam', ['Halo', 'Selamat pagi', 'Assalamualaikum']);
bot.addIntent('cuaca', ['Bagaimana cuaca hari ini?', 'Prakiraan cuaca besok']);

// Daftarkan handler untuk intent tertentu
bot.onIntent('salam', async (ctx) => ({ 
  text: 'Halo! Ada yang bisa saya bantu?' 
}));

// Proses pesan - jika tidak ada handler, otomatis fallback ke Nvidia AI
const response = await bot.processMessage('Siapa presiden Indonesia?');
console.log(response.text); // Dijawab oleh Nvidia MiniMax-M3

📱 Multi-Channel Adapters

Library ini mendukung integrasi dengan WhatsApp dan Telegram secara native.

📱 WhatsApp Adapter (Baileys)

WhatsApp adapter menggunakan library Baileys yang merupakan implementasi WhatsApp Web API.

Cara Penggunaan:

import { ChatbotAI } from 'chatbot-ai-js';

const bot = new ChatbotAI({
  backendConfig: {
    apiKey: process.env.NVIDIA_API_KEY,
    model: 'minimaxai/minimax-m3'
  }
});

// Tambahkan intent dan handler
bot.addIntent('salam', ['Halo', 'Selamat pagi']);
bot.onIntent('salam', async (ctx) => ({
  text: 'Halo! Ada yang bisa saya bantu?'
}));

// Hubungkan ke WhatsApp
await bot.connectAdapter('whatsapp', {
  authFolder: './whatsapp-auth' // Folder untuk menyimpan session
});

await bot.start();

🔑 Mendapatkan API Key Nvidia

  1. Kunjungi https://build.nvidia.com
  2. Daftar dan buat API key gratis
  3. Pilih model yang diinginkan (MiniMax-M3, Llama 3, dll.)
  4. Salin API key dan masukkan ke backendConfig.apiKey

🔑 Konfigurasi API Key Nvidia (Wajib)

Library ini menggunakan Nvidia Build sebagai backend AI utama. Anda tidak perlu membayar untuk memulai karena Nvidia menyediakan free tier yang sangat cukup untuk pengembangan.

Langkah 1: Dapatkan API Key

  1. Kunjungi build.nvidia.com
  2. Login atau buat akun Nvidia
  3. Pilih model AI (misal: MiniMax-M3, Llama 3, Mistral)
  4. Klik Get API Key dan salin key Anda (dimulai dengan nvapi-...)

Langkah 2: Amankan API Key Anda

JANGAN PERNAH menaruh API Key langsung di dalam source code (hardcode). Gunakan Environment Variables.

Buat file .env di root proyek aplikasi Anda:

NVIDIA_API_KEY=nvapi-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
NVIDIA_MODEL=minimaxai/minimax-m3

📜 Lisensi

MIT © Muhammad Rafly Baehaqi