Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

35 Commits

Repository files navigation

Automaton Hex.pmBuild StatusCoverage Status

Note: This library is still under heavy development.

Automaton is an Elixir library that manages the conversation between your chat bot and the user by maintaining the messages and context in a GenServer.

This is useful as most messaging platforms (webhooks) and NLP services (REST API) communicates with your backend in the typical Request/Response mode.

Automaton aims to be the glue/framework/library to help you focus on your backend instead of messing around with the plumbing of maintaining chat bots.

Quick Start

# In your config/config.exs fileconfig:sample,Sample.Bot,adapter: Automaton.Console.Adapter# In your application code# Define your botdefmoduleSample.BotdouseAutomaton.Bot,otp_app: :sample# Echo backs whatever you saiddefprocess(sender_id,message,context)doreply(sender_id,message,context)endend# In an IEx sessioniex>Sample.Bot.converse("Hello World")Hello World
:ok

Installation

Add Automaton in your mix.exs dependencies:

defdepsdo[{:automaton,"~> 0.1.0"}]end

Adapters

PlatformAutomaton adapter
Facebook MessengerAutomaton.FacebookMessenger.Adapter
TelegramAutomaton.Telegram.Adapter
SlackAutomaton.Slack.Adapter
Console (Included)Automaton.Console.Adapter

Configure your adapter in config/config.exs file:

config:sample,Sample.Bot,adapter: Automaton.FacebookMessenger.Adapter# adapter config (api keys, etc.)

You can also define custom adapters by implementing callbacks defined in adapter.ex

Proposed Roadmap

  • Stores conversation message and context
  • Adapter layer to support different messaging platforms
  • Simple callback to process messages/context
  • Access to conversation context
  • Terminates stale conversation and logs it
  • Callback for conversation termination for custom behavior
  • Tracks simple metrics like conversation/messages counts

Documentation

More documentation can be found on hexdocs. You can also find it in the source and it's accessible from iex.

License

Plug source code is released under MIT License. Check LICENSE file for more information.

About

Elixir library to easily build and run ChatBots

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages