merlinn-co / merlinn

Open source AI on-call developer 🧙‍♂️ Get relevant context & root cause analysis in seconds about production incidents and make on-call engineers 10x better 🏎️
https://merlinn.co
GNU Affero General Public License v3.0
56 stars 3 forks source link
aiops alerts incident-response metrics observability oncall oncall-engineers traces

Merlinn - open-source AI on-call developer

Merlinn-logo


Docs · Demo · Report Bug · Feature Request · Blog · Slack


GNU AGPLv3 License main-workflow code style: prettier slack-logo

Overview 💫

Merlinn is an AI-powered on-call engineer. It can automatically jump into incidents & alerts with you, and provide you useful & contextual insights and RCA in real time.

Why ❓

Most people don't like to do on-call shifts. It requires engineers to be swift and solve problems quickly. However, it takes time to reach to the root cause of the problem. That's why we developed Merlinn. We believe Gen AI can help on-call developrs solve issues faster.

Table of Contents

Key features 🎯

Demo 🎥

Checkout our demo video to see Merlinn in action.

Getting started 🚀

In order to run Merlinn, you need to clone the repo & run the app using Docker Compose.

Prerequisites 📜

Ensure you have the following installed:

Quick installation 🏎️

You can find the installation video here.

  1. Clone the repository:

    git clone git@github.com:merlinn-co/merlinn.git && cd merlinn
  2. Copy the .env.example file:

    cp .env.example .env
  3. Configure LiteLLM Proxy Server:

    We use LiteLLM Proxy Server to interact with 100+ of models in a unified interface (OpenAI interface).

    1. Copy the example files:

      cp config/litellm/.env.example config/litellm/.env
      cp config/litellm/config.example.yaml config/litellm/config.yaml
    2. Define your OpenAI key and place it inside config/litellm/.env as OPENAI_API_KEY. You can get your API key here. Rest assured, you won't be charged unless you use the API. For more details on pricing, check here.

    3. (Optional) Define custom endpoints. If you want to use other vendors (AWS Bedrock, Azure OpenAI, Anthropic, Hugging Face models, etc), checkout LiteLLM Proxy documentation. You simply need to change config/litellm/.env & config/litellm/config.yaml. Checkout the comments there & LiteLLM's documentation. Note You have to use a vendor that supports function calling.

  4. Launch vault and obtain vault tokens:

    We use Hashicorp Vault to manage secrets such as API tokens, OAuth credentials, etc.

    1. Launch the vault instance:

      docker compose up vault -d
    2. Go to Vault UI: http://localhost:8202

    3. Insert 1 in "Key shares" and "Key threshold" and click "Initialize".

    4. Click "Download keys".

    5. In the JSON file you've downloaded, copy the first value in "keys_base64" and the "root_token" value. These values are going to be used in the next step as HASHICORP_VAULT_UNSEAL_TOKEN and HASHICORP_VAULT_ROOT_TOKEN respectively.

  5. Open .env in your favorite editor (vim, vscode, emacs, etc):

    vim .env # or emacs or vscode or nano
  6. Update these variables:

    • SLACK_BOT_TOKEN, SLACK_APP_TOKEN and SLACK_SIGNING_SECRET - These variables are needed in order to talk to Merlinn on Slack. Please follow this guide to create a new Slack app in your organization.

    • HASHICORP_VAULT_ROOT_TOKEN and HASHICORP_VAULT_UNSEAL_TOKEN - These variables are used to manage your secrets. You should obtain them from the JSON you've downloaded at step 3. root_token=HASHICORP_VAULT_ROOT_TOKEN, keys_base64=HASHICORP_VAULT_UNSEAL_TOKEN

    • (Optional) SMTP_CONNECTION_URL - This variable is needed in order to invite new members to your Merlinn organization via email and allow them to use the bot. It's not mandatory if you just want to test Merlinn and play with it. If you do want to send invites to your team members, you can use a service like SendGrid/Mailgun. Should follow this pattern: smtp://username:password@domain:port.

  7. Launch the project:

    docker compose up -d

That's it. You should be able to visit Merlinn's dashboard in http://localhost:5173. Simply create a user (with the same e-mail as the one in your Slack user) and start to configure your organization.

The next steps are to configure your organization a bit more (connect incident management tools, build a knowledge base, etc). Head over to the connect & configure section in our docs for more information 💫

Updating Merlinn 🧙‍♂️

  1. Pull the latest changes:

    git pull
  2. Rebuild images:

    docker-compose up --build -d

Visualize Knowledge Base 🗺️

We use ChromaDB as our vector DB. We also use vector admin in order to see the ingested documents. To use vector admin, simply run this command:

docker compose up vector-admin -d

This command starts vector-admin at port 3001. Head over to http://localhost:3001 and configure your local ChromaDB. Note: Since vector-admin runs inside a docker container, in the "host" field make sure to insert http://host.docker.internal:8000 instead of http://localhost:8000. This is because "localhost" doesn't refer to the host inside the container itself.

Moreover, in the "API Header & Key", you'd need to put "X-Chroma-Token" as the header and the value you have inside .env CHROMA_SERVER_AUTHN_CREDENTIALS as the value.

To learn how to use VectorAdmin, visit the docs.

Support and feedback 👷‍♀️

In order of preference the best way to communicate with us:

Contributing to Merlinn ⛑️

If you're interested in contributing to Merlinn, checkout our CONTRIBUTING.md file 💫 🧙‍♂️

Telemetry 🔢

By default, Merlinn automatically sends basic usage statistics from self-hosted instances to our server via PostHog.

This allows us to:

Rest assured, the data collected is not shared with third parties and does not include any sensitive information. We aim to be transparent, and you can review the specific data we collect here.

If you prefer not to participate, you can easily opt-out by setting TELEMETRY_ENABLED=false inside services/api/.env.dev.

License 📃

This project is licensed under the GNU AGPLv3 License - see the LICENSE file for details

Learn more 🔍

Check out the official website at https://merlinn.co for more information.

Contributors ✨

Built with ❤️ by Dudu & Topaz

Dudu: Github, Twitter

Topaz: Github, Twitter