Détail du package

@memori.ai/memori-api-client

memori-ai1.6kApache-2.06.5.9

React library to integrate a Memori in your app or website

memori, memori-ai, conversational-agents, conversational-ai

readme

memori-api-client

npm version Tests TypeScript Support

TypeScript client to integrate with Memori API.

Web Platform: AIsuru

Installation

yarn add @memori.ai/memori-api-client
npm install @memori.ai/memori-api-client

Usage

Every method has JSDoc annotations with usage and description and typings information.

See examples for Node (TypeScript) and React.

import memoriApiClient from '@memori.ai/memori-api-client';

const memori = memoriApiClient('https://backend.memori.ai', 'https://engine.memori.ai');
// or just memoriApiClient() as defaults to production
(async () => {
  const { sessionID, currentState, ...response } = await memori.initSession({
    memoriID: '768b9654-e781-4c3c-81fa-ae1529d1bfbe',
    birthdate: '1900-01-01T00:00:00.000Z',
  });

  const { currentState: dialogState, ...resp } =
    await memori.postTextEnteredEvent({
      sessionId: sessionID,
      text: 'Ciao, Memori!',
    });
})();

For the specification of the APIs, see the typings or the documentation from the dashboard if you are allowed to see it.

Constants

memori.constants.allowedMediaTypes; // list of allowed media types in asset upload
memori.constants.anonTag; // tag for anonymous users

Endpoints passed during initialization:

memori.constants.BACKEND_URL;
memori.constants.ENGINE_URL;

Asset

There is a helper method parsing media urls from the DB, handling different cases

memori.asset.getResourceUrl({
  type: 'avatar',
  resourceURI: '768b9654-e781-4c3c-81fa-ae1529d1bfbe.png',
  sessionID: 'be2e4a44-890b-483b-a26a-f6e122f36e2b',
  baseURL: 'https://aisuru.com',
});

See also

changelog

6.5.9 (2025-06-26)

Features

  • add getChatLogsPaged API function for retrieving paginated chat logs within a date range (ec60c57)

6.5.8 (2025-06-25)

Features

  • implement trustedApplication API for managing trusted applications (7115f9f)

6.5.7 (2025-06-23)

Features

  • add userPwl API integration to backend for enhanced user management (c55af83)

6.5.6 (2025-06-23)

Features

  • implement user management API functions including login, logout and user details retrieval (58a6b44)

Changes

  • rename user management API functions to include 'pwl' prefix for clarity (1b49f3f)

6.5.5 (2025-06-11)

Features

  • add uploadAssetUnlogged function to handle file uploads for unlogged users (37f75f3)

6.5.4 (2025-06-10)

Features

  • add continueFromChatLogID field to OpenSession type (e1e3ab8)

6.5.3 (2025-06-09)

Features

  • add userName field to Notification type (689c68b)

Bug Fixes

  • update severity option in Notification type from 'CHATLOG' to 'CHANGELOG' (0d3c4fd)

6.5.2 (2025-06-09)

Features

  • add 'CHATLOG' severity option to Notification type (85ba375)
  • add validFrom and validTo fields to Notification type (57f2ad9)

6.5.1 (2025-05-27)

Features

  • extend Notification type with new fields for type, tenantID, and userID (c16bf78)

6.5.0 (2025-05-27)

Features

  • add notification management functions including create, get, delete, list, and update (6e8dfad)

6.4.0 (2025-05-22)

Features

  • update CompletionConfig to Vertex_Anthropic provider options (e2e23ad)

6.3.0 (2025-05-22)

Features

  • add Vertex Anthropic model configuration fields to CompletionConfig (80901bf)

6.2.0 (2025-05-14)

Features

  • add blockMemori and unblockMemori functions (d762c6a)

6.1.1 (2025-05-07)

Features

  • add requireLoginToken field to Memori type (c4296cc)

6.1.0 (2025-04-28)

Features

  • new fields on Tenant and Memori (75f8ccf)

Maintenance

  • add new media events and attributes (a5c535a)

6.0.8 (2025-04-16)

Features

  • add postTextEnteredEventExtended function (11c0387)

6.0.7 (2025-04-15)

Maintenance

  • add userAgent param to init session (8662707)

6.0.6 (2025-03-25)

Features

  • introduce apiBinaryFetcher for handling binary responses in API calls (3f9b037)

Bug Fixes

  • update apiBinaryFetcher to be an async function (4d4a674)

6.0.5 (2025-03-25)

Changes

  • streamline apiFetcher usage for binary data handling in import/export functions (6adc72a)

6.0.4 (2025-03-25)

Changes

  • update import/export functions to improve API handling and documentation (4446f7a)

6.0.3 (2025-03-13)

Features

  • add ImportMemoriParams interface and import/export functions for Memori objects (e3d641b)

6.0.2 (2025-03-13)

Features

  • add getChatLogsByUser function to retrieve chat logs for the current user session (5015257)

6.0.1 (2025-03-07)

Changes

  • tenant non optional attributes (791dd66)

6.0.0 (2025-03-07)

⚠ BREAKING CHANGES

  • tenant types from backend, remove customizations from dashboard + add alias

Changes

  • tenant types from backend, remove customizations from dashboard + add alias (a2d50d9)

5.6.0 (2025-02-28)

Features

  • add optional obfuscation flag to macro function type (bfc0c0e)
  • support multilingual descriptions for macro functions (ac063a8)

5.5.1 (2025-02-25)

Bug Fixes

  • typo in analysis query pathname (be4a71f)

5.5.0 (2025-01-30)

Features

  • add import methods for dictionaries and functions/intents (c65f477)

Maintenance

5.4.2 (2025-01-09)

Maintenance

5.4.1 (2025-01-08)

Bug Fixes

  • typo in context vars result type (2f6290b)

Changes

  • add optional param to text quality indexes (6b99914)

5.4.0 (2025-01-08)

Features

5.3.1 (2025-01-07)

Changes

5.3.0 (2025-01-07)

Features

5.2.1 (2024-11-19)

Maintenance

  • add timeZoneOffset in open session additionalInfo (164e5bb)

5.2.0 (2024-09-25)

Features

  • added pagination search and filter apis (419397e)

Maintenance

5.1.1 (2024-09-10)

Maintenance

  • remove stats and content quality apis (aafe761)

5.1.0 (2024-09-09)

Features

  • add completions config apis, update typings (493a69a)

5.0.1 (2024-08-02)

Maintenance

  • add translatedEmission in DialogState (6a77d1d)

5.0.0 (2024-06-26)

⚠ BREAKING CHANGES

  • split engine and backend endpoints, fallbacks with defaults and replace

Changes

  • split engine and backend endpoints, fallbacks with defaults and replace (aa0c03d)

4.2.2 (2024-06-12)

Maintenance

  • add billingDelegation to tenant (280fd19)

4.2.1 (2024-05-06)

Maintenance

  • add memoryTags in DialogState (081628d)
  • add new Memory attributes (b5081a6)

Changes

4.2.0 (2024-05-03)

Features

4.1.3 (2024-04-30)

Maintenance

  • add new attributes to history message (c03919a)

4.1.2 (2024-04-29)

Maintenance

  • add new attributes to history message (badfd60)

4.1.1 (2024-04-29)

Maintenance

  • add new attributes to history message (477420d)

4.1.0 (2024-04-16)

Features

  • add new typings, implement date changed api call (51ee854)

4.0.3 (2024-03-29)

Changes

  • add threshold in followers search apis (4cf6140)

4.0.2 (2024-03-25)

Maintenance

  • add attributes to ProcessStatus (c72da0a)

4.0.1 (2024-03-22)

Maintenance

  • adapt completion provider adding Anthropic (4935dc2)

4.0.0 (2024-03-19)

⚠ BREAKING CHANGES

  • add new processes and analysis api, moving import status, refactor api code

Features

  • add new processes and analysis api, moving import status, refactor api code (2cc81c0)

Maintenance

  • add new tenant attribute (5829c53)

3.0.1 (2024-02-16)

Maintenance

3.0.0 (2024-02-15)

Features

  • add get current backend user api (0bbcebd)
  • add new apis and typings, remove obsolete ones (c5a028a)

Maintenance

  • rename refs and defaults to aisuru.com (25a3222)

2.7.0 (2023-12-22)

Features

  • add known facts api and typings (3c16827)

2.6.2 (2023-12-11)

Changes

  • add chatlogs attributes for board of experts (3d746a7)

2.6.1 (2023-12-08)

Maintenance

  • add endpoints as constants (de513a2)

2.6.0 (2023-12-08)

Features

  • add boe flag on memori type (71fc3fc)

2.5.0 (2023-12-08)

Features

  • add expert references api + new attributes for boards of experts (c09c317)

2.4.0 (2023-11-13)

Features

2.3.0 (2023-09-11)

Features

2.2.2 (2023-08-25)

Changes

  • replace additionalInfo email + userID with loginToken (10b2a03)

2.2.1 (2023-08-22)

Bug Fixes

2.2.0 (2023-07-17)

Features

  • update importexport apis and typings (d86f38e)

2.1.5 (2023-04-17)

Maintenance

2.1.4 (2023-04-17)

Maintenance

2.1.3 (2023-04-17)

Bug Fixes

  • typo in backend memori specs (2d12a38)

2.1.2 (2023-04-14)

Maintenance

2.1.1 (2023-04-14)

Maintenance

2.1.0 (2023-04-14)

Features

  • add new memori and user attributes (40e6d16)

2.0.0 (2023-03-25)

⚠ BREAKING CHANGES

  • migrate to yarn 3, remove tsdx and go vanilla tslib, move tests, remove dist from git

Features

  • update import apis and typings (630a8cf)

Changes

  • migrate to yarn 3, remove tsdx and go vanilla tslib, move tests, remove dist from git (9fd19fd)

Maintenance

  • remove coverage from git (b7e2348)

1.2.0 (2023-03-09)

Features

1.1.0 (2023-02-16)

⚠ BREAKING CHANGES

  • rename signin in signup, typo
  • update memori lists api, rename user memori list

Features

  • add new user attributes (5b10720)
  • update memori lists api, rename user memori list (6349149)

Bug Fixes

  • api url parsing allowing http for localhost (6b6d881)

Changes

  • rename signin in signup, typo (6fc8dc4)

1.0.0 (2023-02-01)

Maintenance

  • remove legacy experimental code (69fc7c6)

0.11.0 (2023-02-01)

Features

0.10.3 (2023-01-23)

Features

  • add completion flag in dialog state (9d7b417)

0.10.2 (2023-01-20)

Maintenance

  • add flag in Message for AI-generated msgs (6ea6ae3)

0.10.1 (2023-01-20)

Changes

  • remove internal api not usable from public (d3d3656)

0.10.0 (2023-01-19)

Features

Changes

  • add memory type DRAFT (fa64870)
  • add memoryID in chat log lines (52fa29d)

0.9.0 (2023-01-19)

Features

  • add new flags in dialog state (24abc93)
  • add new flags in memori (6fd0fb0)

0.8.3 (2023-01-14)

Maintenance

  • pin azure sdk to 1.20.0 (24ee3b6)

0.8.2 (2023-01-05)

Features

  • add getMemoriInvitations api (22d33a1)

0.8.1 (2023-01-05)

Changes

  • add new MemoriSpec attrs (c96a42e)

Maintenance

0.8.0 (2023-01-04)

Features

  • add tenant metaverse api (cd24228)

Changes

  • add new dialogState attrs (eccf321)
  • add new dialogState attrs (87877f0)

Maintenance

0.7.0 (2022-12-21)

Features

  • add hints as memory properties (49ed038)

0.6.0 (2022-12-20)

Features

  • update Memori and Memory typings (c796d2e)

Maintenance

  • update package.json files (8deca06)

0.5.0 (2022-12-13)

Features

  • add MemoriContentUpdated (c252a68)

0.4.6 (2022-12-07)

Maintenance

  • add description in package.json (4526d38)

0.4.5 (2022-12-06)

Maintenance

  • add prebump build with release-it (1e892e3)
  • deps: bump terser from 4.8.0 to 4.8.1 (8fe97ad)

0.4.4 (2022-11-28)

Maintenance

0.4.3 (2022-11-28)

Features

  • add type on paginated contents query (b823f73)

0.4.2 (2022-11-25)

Bug Fixes

  • unans questions pagination params type (2ccf150)

0.4.1 (2022-11-25)

Changes

  • unanswered question response with suggestions from engine (1b3819c)

0.4.0 (2022-11-25)

Features

0.3.3 (2022-11-24)

Maintenance

  • add open session with initial question in typings (75f2f88)

0.3.2 (2022-11-24)

Bug Fixes

0.3.1 (2022-11-21)

Maintenance

  • build add new api, update (e69f833)

0.3.0 (2022-11-21)

Features

0.2.1 (2022-07-25)

Maintenance

0.2.0 (2022-07-25)

Features

Changes

  • patch memori accepts partial memori object (8b52bc9)

0.1.2 (2022-07-14)

Bug Fixes

  • remove disabling of microsoft speech sdk telemetry, will re-enabling it (ref: microsoft/cognitive-services-speech-sdk-js#552) (763c294)

0.1.1 (2022-07-13)

Changes

  • remove test env, run test with actual method, remove useless private api calls (d432fe7)

0.1.0 (2022-07-13)

Features

Bug Fixes

Changes

  • typings import, engine apis directly in client (56efcca)
  • use cross-fetch (9a9e073)

Maintenance