What are Bots?

Bots in Montag are a combination of all the settings discussed so far in this guide. They enable the interaction with an LLM through a chat-style in terface.

The settings combine:

  1. A namespace (which database to use for context)
  2. API Client for completions and embeddings
  3. The settings to use for those completions
  4. The settings to use for embeddings
  5. The prompts to use
  6. Which interface to expose the bot on (slack bot credentials)
  7. Which database connection to use to lookup the namespace
  8. What roles to apply to templates in the prompt

There are two additional settings which require more advanced understanding of how scripting works:

  • Raw Prompt Hook: This is a script executed before the prompt is sent to the LLM, it is where you would enable more complex interactions with an LLM
  • Raw Response Hook: This is a script that is run when the response is received from the LLM, for example if you wished to run an analysis on the appropriateness of the response or check for invalid data.

Both of these are user-defined scripts that you wish to run when the bot executes, the first is run on the raw prompt before it reaches the LLM, the latter is run on the response before it reaches the user.