Code Monkey home page Code Monkey logo

my-org-butler's Introduction

My Org Butler

...is a Salesforce app with a Utility Bar chat component that helps org users with their daily work. Using natural language it answers questions about data, metadata and configuration. It can also perform tasks on the user's behalf, like creating or modifying records, making configuration changes or notifying other people.

Highlight

Demo Video

More Details

It behaves like a good Butler, in the sense that it does things in the background and only bugs the user when something is unclear. It also would not just do harmful things that are not in the permission of a user and could create potential harm.

This is made possible by Open AI's Assitant API, an Agent technology similar to AutoGPT or Salesforce upcoming Copilots. It uses LLM reasoning to understand a request and makes an action plan based on automations that were made available to the agent. Open AI calls them Functions or Plugins, Salesforce calls them Skills.

Those automation are not performed by the LLM but just delegated back to Salesforce, which then calls deterministic code.

This PoC shows that in the realm of Salesforce where there is a well-documented REST API for nearly everything a single Skill or Function is sufficient. The Org Butler does everything it does just by construting REST API request as shown in this PlantUML:

How can I use it?

Deploy as source or install as Unlocked Package to your Production or Sandbox org.

Deploy to Salesforce

Or build it yourself:

  1. Clone the repo
  2. Create Scratch org
    1. Adjust the DEV_HUB_ALIAS in /scripts/create-scratch.org.sh
    2. Run it via ./scripts/create-scratch.org.sh

How do set it up:

  1. Add your OpenAI API Key to a new Principal Parameter called ApiKey in Setup > Named Credential > External Credential > OpenAiApi.ApiKey
  2. Add the External Credential > OpenAiApi to the Permission Set MyOrgButler
  3. Create an OpenAI Assistant using the Functions, Instructions and Knowledge files in openai-configs
  4. Replace ASSISTANT_ID with your Id in force-app/main/default/classes/OpenAiApi.cls
  5. Create a Managed or Unlocked package from it using /scripts/create-package.sh


DISCLAIMER - Simple vs. sophisticated

This app was not written with a commercial career in mind. So we cut corners in a few places to keep the projects short and focused. So if you see some ugly parts here and there, let us know but be kind to us. This project is mainly about sharing results and excitement in "AI for Salesforce".

We also made some adjustments, and simplifications to the original code to better fit the Open Source purpose. To have less loose metadata parts, we:

  • Skipped moving UI text to Custom Labels
  • Merged classes to have the most related code in one place

my-org-butler's People

Contributors

rsoesemann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.