🔌Client API

Overview

An npm module that wraps the backend and engine APIs. It handles API calls and exposes the available methods with typed parameters and responses. Can be used on both the web and node/server side.

API Architecture

The Memori API consists of two main components:

  1. Engine API (Swagger)

    1. Manages sessions and dialogues;

    2. Handles NLP features;

    3. Processes conversational functionality.

  2. Backend API (Swagger)

    1. Manages users and assets;

    2. Handles notifications;

    3. Controls system administration.

Client Initialization

import memoriApiClient from "@memori.ai/memori-api-client";
// Initialize with default endpoints
const memori = memoriApiClient(
"https://backend.memori.ai", // API URL
"https://engine.memori.ai" // Engine URL
);

Core Features

Session Management

Dialog Events

Advanced Features

Global State Management

Event Listeners

MemoriNewDialogState

You can listen to every message using the MemoriNewDialogState event and evaluate its content to trigger a reaction

Message Sending

Complete API Integration Example

Last updated