Skip to content
Simple Restful API to process query (via GET param) and return data based on AIML for building chatbot
Branch: master
Clone or download
Latest commit a05c8d2 Sep 7, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Delete .DS_Store Sep 7, 2017
README.md (feat) update readme Sep 7, 2017

README.md

restful-aiml-bot

Simple restful api server, process request string (keyword) and return data base on AIML algorithm.

You can use this to create simple chatbot, understanding user queries and return value base on template / pattern of queries.

Requirement

This project need Nodejs and AIMLInterpreter library to run. Install with npm:

npm install aimlinterpreter

Usage

Step 1: Build your bot brain with AIML

Edit test.aiml.xml with aiml content. Learn more about AIML at http://www.alicebot.org/aiml.html

Step 2: Start web server

node server.js

By default, web server will start from port 8088

Step 3: Query to server

Request to url http://localhost:8088?q=YOUR_STRING&format=json|text

Query string meanings:

  • q: Keyword will search in AIML file.
  • format: can be json or text.

Example:

  • Request to: http://localhost:8088?q=hi&format=json

  • Sample response (json format):

{
    "text": "Hello to you too",
    "wildcard": []
}
You can’t perform that action at this time.