TinyTroupe by Microsoft: KI group work!

These days, we came across an article about a prototype from Microsoft called TinyTroupe. First things first: a big thank you to the Microsoft team for creating and freely sharing this amazing tool! 🙌

What is TinyTroupe?

The idea behind the tool is simple but brilliant: assign specific personalities (known as personas in marketing) to multiple chatbots, allowing them to interact as a group. This approach enables the AI to shed light on topics from multiple perspectives. Here are a few use cases:

  • Crafting the perfect ad for a rental property
  • Evaluating which of three TV advertisements is the most engaging
  • And much more!
TInyTroupe lets a group of AIs discuss and work on topics. Image: ChatGPT
TInyTroupe lets a group of AIs discuss and work on topics. Image: ChatGPT

Chatbots Collaborating: Why Is This Useful? 🤖🤝

Chatbots have revolutionized how we handle tasks, and their potential increases when combined with prompt engineering. Prompt engineering is a common strategy is to give a chatbot a distinct personality, like behaving as a car salesperson.

TinyTroupe takes this concept further: it allows multiple specialized chatbots to interact, much like gathering people with different expertise to solve a problem collaboratively. It’s an incredible idea—thank you, Microsoft! 🙏

The Catch: A Tricky Installation Process 😣

Of course, we wanted to try it out. While the tool is fantastic, the setup instructions on GitHub were… minimalistic, to say the least. 😅 After some trial and error, we managed to get it running and have created a step-by-step guide for anyone else who wants to experiment with this cutting-edge AI who isn’t an experienced developer.

TinyTroupe Installation Guide for Beginners 🛠️

Here’s what you’ll need:

  1. Programming environment: Install Anaconda, as the commands suggest it’s the preferred tool. Download here.
  2. Git for version controlGet the latest version here.
  3. API Key: You’ll need to create an OpenAI account if you don’t have one yet. Generate an API key here on OpenAI’s developer portal, required for accessing ChatGPT. Remember to save it after creating, as you won’t see it again unless regenerated.
  4. Create a budget for using the ChatGPT via the API and enter credit card data here.

Next, you should ensure a few smaller adjustments are made. For this, we need a command line interface (press the Windows key, type “cmd,” and hit Enter). Then, ensure that everything required for the commands in the official guide can be found:

  • Step 1: Open Control PanelPress Win and type: Environment Variables.
    Click on the search result: Edit the system environment variables.
  • Step 2: Edit Environment Variables
    In the System Properties window, click the Environment Variables button in the bottom right.Under the User variables for [Your Username] section:
    • Look for the variable Path and click on it.Select Edit.
  • Step 3: Ensure conda can Be Found
    Add the following entries if they are not already present:
    • C:\Users\<username>\anaconda3C:\Users\<username>\anaconda3\ScriptsC:\Users\<username>\anaconda3\condabin
  • Step 4: Run the Following Command to Make Necessary Adjustments
    conda init --all
  • Step 5: Close and Reopen the Command Line. This ensures the changes take effect.
  • Step 6: Test if conda is Working Properly
    conda info

After preparing your system, follow these steps for the original manual:

  1. Create the TinyTroupe environment using Conda:
    conda create -n tinytroupe python=3.10
  2. Activate the environment:
    conda activate tinytroupe
  3. Clone the GitHub repository to the directory you’re currently in:
    git clone https://github.com/microsoft/tinytroupe
  4. Change to the relevant directory
    cd tinytroupe
  5. Install dependencies with 
    pip install .

What Next?

The most important missing part in the official official guide is how to actually use and experiment with TinyTroupe. Here’s the solution:

  1. Set and save your API Key in the shell in order to access ChatGPT:
    setx OPENAI_API_KEY <Your API Key>
  2. Start Jupyter Notebook to explore examples:
    jupyter notebook

The browser interface which opens lets you explore pre-built examples. Each “cell” contains text or code – run them one by one using the play button or Shift + Enter. 🎯
If you want to start tinytroupe again, you just need to execute conda activate tinytroupe and then jupyter notebook in the tinytroupe directory.

Final Thoughts 💡

TinyTroupe is an exciting step forward in collaborative AI experimentation. Try out the examples and adapt them to your needs.

Have fun experimenting with TinyTroupe! 🎉