mongodb / chatbot

MongoDB Chatbot Framework. Powered by MongoDB and Atlas Vector Search.
https://mongodb.github.io/chatbot/
Apache License 2.0
106 stars 49 forks source link

(EAI-182): Refactor server + docs to "MongoDB Chatbot Framework" #280

Closed mongodben closed 6 months ago

mongodben commented 6 months ago

Jira: https://jira.mongodb.org/browse/EAI-182

Changes

On a high level, this PR contains a set of changes that make the mongodb-chatbot-server oriented around a more generic LLM chatbot use case, not necessarily using RAG. Rather, RAG can be part of a new injected function in the addMessageToConversation route, GenerateUserMessage. This PR includes a module with first-class support for RAG, makeRagGenerateUserPrompt().

We want to make baked-in RAG optional for the following reasons:

  1. Sets up RAG via tool calling in a future PR
  2. Allows package users more flexibility with how they implement RAG or other user message preprocessing. a. For example, a user could use chain-of-thought or other advanced prompting techniques within a GenerateUserMessage before getting the final assistant response streamed to the user.

As a result of this change, I've renamed the framework "MongoDB Chatbot Framework" in the docs to better capture the fact that the framework isn't tightly coupled to RAG. This reorientation to "chatbot" also works better with the name of the repo + Github Pages site.

MongoDB Chatbot Framework

GenerateUserMessage changes

Other changes

Sneaking in some other changes while making the above breaking changes.

Notes

The following functionality is not included in this PR in order to get these changes released quickly (given Wilco want to use our OSS framework in their quest). The following changes will be additive, non-breaking changes.

These changes will be added as part of EAI-121