Link Search Menu Expand Document

Allows to use Mongo database to persist BotContext instances.

Learn more about context here.

How to use

1. Include Mongo DB dependency to your build.gradle

implementation("com.just-ai.jaicf:mongo:$jaicfVersion")

Replace $jaicfVersion with the latest version

2. Create a Mongo database

You can install and run Mongo DB locally or use any cloud-based mongo hosting like Atlas.

3. Obtain Mondo DB URL

When you’ve created a Mongo DB, you can obtain its connection URL that should be used on the next step.

4. Configure Mongo DB manager

var client = MongoClients.create("Your Mongo Connection String")
val manager = MongoBotContextManager(client.getDatabase("jaicf").getCollection("contexts"))

val templateBot = BotEngine(
    scenario = MainScenario,
    defaultContextManager = manager,
    activators = arrayOf(
        AlexaActivator
    )
)