Making conversational agents - one step at a time
Created by [Mary.Africa](https://mary.africa), this tool makes it possible to create conversational agents of any form. From purely-rule based to full-fledged NLP enhanced.It's important to understand the terminologies that are used during the development process. Possibly in the future, we'll be working on creating better documentation and information about the project.
Terms:
-
Agent - The conversational tool / bot / chatbot, which is the main interface of the project.
To use an agent:import Agent from 'converse-core' const ddo = ... const config = ... const context = ... const agent = new Agent(ddo, config, context)
-
Dialogue Definition Object (DDO) - This is the object that defines how to build the agent. This would have information like what are the responses it should take. How should it attempt to match the user text, and so on.
Example of a simple DDO{ fallbackText: "This is a fallback text", dialogues: { 'bookDialogue': { start: 'ask-room', nodes: { "ask-room": { text: "Unataka kupangisha chumba aina gani?", matcher: 'room-selector' with: { room_options: [ 'standard', 'king', 'family' ] } goTo: "done" }, "done": { text: "Haya, imetosha. Ungependa kurudia?", matcher: "yes_no", goTo: '$' } } }, }, intentions: { 'greet': { toMatch: ['salama', 'habari', 'jasiri'], response: 'Habari zako kijani!', }, 'room-book': { toMatch: ["nataka kupanga chumba", "nataka chumba"], dialogueKey: 'bookDialogue' }, }, }
-
Mutation - These are the modification of input that you want your agent to perform as it's processing the input given to the created agent
Here is an example of mutation to remove whitespace around an input and lowercase any input sent to the agent:const agent = new Agent(...) agent.setMutation('preprocess', (input) => input.trim().toLowerCase()) ...
-
Action - These are actions that can be set to execute during a certain time of execution
From theddo
shown above, here is an example of an action that is executed when a user is in the room-booking dialogueconst agent = new Agent(...) agent.dialogue('bookDialogue') .setAction('enter', async () => { // do something here })
This package is still very much under development. If you are using it, do so with caution
-
Converse Core -
converse-core
This is thecore
package that builds the conversational agents in a basic form. Any modification would be an extension from this classyarn add converse-core
-
Converse Nena -
converse-nena
This is the agent that makes use of Nena API to give the agent NLP functionalitiesyarn add converse-core converse-nena
converse-core | converse-nena |
---|---|
0.3.3+ | 0.2.3 |
Contributions currently can only be made by the members of Mary.Africa. However, contributions might be opened up to a select few.