/robo-mo

A Momento powered chatbot.

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Robo-mo chatbot

Robo-mo is a chatbot over the Momento documentation and blogs. Indexing and consulting the Momento documentation is done using Momento Vector Index by way of the langchain integration.

With Momento Vector Index, indexing and searching over vector embeddings is easier than ever!

Project Structure

The project is structured as follows:

.
├── robo_mo ..................... chatbot source code
| ├── chatbot.py ................ core application and ui logic
| ├── prompts.py ................ customized prompts for the chatbot
| ├── callbacks.py .............. streaming callback functions
| └── secrets.py ................ helpers to read secrets
├── notebooks ................... the chat bot application
| └── 01-load-momento-data.ipynb  populates the index with Momento data

Getting Started

Prerequisites

Installation

poetry install

Usage

Set up environment

These assume you have the following API keys set in the environment:

  • Open AI API key set to the environment variable OPENAI_API_KEY.
  • Momento API key set to the environment variable MOMENTO_API_KEY.

When running from Python, this can be set in the project root .env file. Use the provided .env.example as a template, and rename it to .env.

Build the index

Run the notebook notebooks/01-load-momento-data.ipynb to build the index.

To run the notebook, use your IDE's integrated notebook support (eg VS Code), or run the following command:

poetry run jupyter notebook

and open the notebook in your browser.

Run the chatbot

To run directly using python:

make run-chatbot

This should launch a browser with the chatbot demo.

To run using docker:

make docker-build
make docker-run

This should run the server, accessible at http://localhost:8501.