hexabot/api
Mohamed Marrouchi bab2e3082f feat: implement nlp based blocks prioritization strategy
feat: add weight to nlp entity schema and readapt

feat: remove commented obsolete code

feat: restore settings

feat: apply feedback

fix: re-adapt unit tests

feat: priority scoring re-calculation & enabling weight modification in builtin nlp entities

fix: remove obsolete code

feat: refine unit tests, apply mr coderabbit suggestions

fix: minor refactoring

feat: add nlp cache map type

feat: refine builtin nlp entities weight updates

feat: add more test cases and refine edge case handling

feat: add weight validation in UI

fix: apply feedback

feat: add a penalty factor & fix unit tests

feat: add documentation

fix: correct syntax

fix: remove stale log statement

fix: enforce nlp entity weight restrictions

fix: correct typo in docs

fix: typos in docs

fix: fix formatting for function comment

fix: restore matchNLP function previous code

fix: remove blank line, make updateOne asynchronous

fix: add AND operator in docs

fix: handle dependency injection in chat module

feat: refactor to use findAndPopulate in block score calculation

feat: refine caching mechanisms

feat: add typing and enforce safety checks

fix: remove typo

fix: remove async from block score calculation

fix: remove typo

fix: correct linting

fix: refine nlp pattern type check

fix: decompose code into helper utils,  add nlp entity dto validation, remove type casting

fix: minor refactoring

feat: refactor current implementation
2025-05-12 07:29:56 +01:00
..
assets fix: remove unused image 2025-04-11 17:21:47 +01:00
docs/nlp feat: implement nlp based blocks prioritization strategy 2025-05-12 07:29:56 +01:00
patches
src feat: implement nlp based blocks prioritization strategy 2025-05-12 07:29:56 +01:00
test feat: add unit tests global provider config 2025-03-23 08:52:19 +01:00
types fix: remove explicit public 2025-03-24 01:50:50 +01:00
.dockerignore
.eslintrc-staged.js
.eslintrc.js fix(api): introduce ESLint no-multiple-empty-lines rule 2025-02-10 16:28:59 +01:00
.gitignore
.prettierrc
.swcrc
add-extra-deps.js
Dockerfile
Dockerfile.base
nest-cli.json
package-lock.json build: v2.2.6 2025-05-07 07:21:53 +01:00
package.json build: v2.2.6 2025-05-07 07:21:53 +01:00
README.md
tsconfig.build.json
tsconfig.doc.json
tsconfig.json

Hexabot API

Hexabot's API is a RESTful API built with NestJS, designed to handle requests from both the UI admin panel and various communication channels. The API powers core functionalities such as chatbot management, message flow, NLU (Natural Language Understanding), and plugin integrations.

Key Features

  • RESTful Architecture: Simple, standardized API architecture following REST principles.
  • Multi-Channel Support: Handles requests from different communication channels (e.g., web, mobile).
  • Modular Design: Organized into multiple modules for better scalability and maintainability.
  • Real-Time Communication: Integrates WebSocket support for real-time features.

API Modules

The API is divided into several key modules, each responsible for specific functionalities:

Core Modules

  • Analytics: Tracks and serves analytics data such as the number of messages exchanged and end-user retention statistics.
  • Attachment: Manages file uploads and downloads, enabling attachment handling across the chatbot.
  • Channel: Manages different communication channels through which the chatbot operates (e.g., web, mobile apps, etc.).
  • Chat: The core module for handling incoming channel requests and managing the chat flow as defined by the visual editor in the UI.
  • Knowledge Base: Content management module for defining content types, managing content, and configuring menus for chatbot interactions.
  • NLU: Manages NLU (Natural Language Understanding) entities such as intents, languages, and values used to detect and process user inputs intelligently.
  • Plugins: Manages extensions and plugins that integrate additional features and functionalities into the chatbot.
  • User: Manages user authentication, roles, and permissions, ensuring secure access to different parts of the system.
  • Extensions: A container for all types of extensions (channels, plugins, helpers) that can be added to expand the chatbot's functionality.
  • Settings: A module for management all types of settings that can be adjusted to customize the chatbot.

Utility Modules

  • WebSocket: Adds support for Websicket with Socket.IO, enabling real-time communication for events like live chat and user interactions.
  • Logger: Provides logging functionality to track and debug API requests and events.

Installation

$ npm install

Running the app in standalone

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Migrations

Hexabot includes a migration module to help manage database schema and data changes over time. Migrations allows us to apply or revert changes to the database and keep it in sync with the version release.

Check the Migration README file for more : Migration Module

Documentation

Access the Swagger API documentation by visiting the API url /docs once run it in development mode.

It's also possible to access the API reference documentation by running npm run doc.

For detailed information about the API routes and usage, refer to the API documentation or visit https://docs.hexabot.ai.

Contributing

We welcome contributions from the community! Whether you want to report a bug, suggest new features, or submit a pull request, your input is valuable to us.

Feel free to join us on Discord

License

This software is licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:

  1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
  2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).