Metadata-Version: 2.2
Name: monju
Version: 0.3.0
Summary: A python library for brainstorming by multiple LLMs.
Home-page: https://pypi.org/project/monju/
Author: Daisuke Yamaguchi
Author-email: daicom0204@gmail.com
Project-URL: Homepage, https://habatakurikei.com/
Project-URL: GitHub, https://github.com/Habatakurikei/monju
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: llmmaster>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

![monju](https://repository-images.githubusercontent.com/873246587/e64acd4c-2d7f-44f8-ab00-bbe7a9e65d41)

# monju: Multi-AI Brainstorming Framework

Monju is a powerful multi-AI brainstorming framework designed to generate, organize, and evaluate ideas using various Large Language Models (LLMs).

The Japanese proverb “三人寄れば文殊の知恵” (San nin yoreba monju no chie) is often translated into English as “Two heads are better than one”. However, a more literal translation would be “When three people gather, they have the wisdom of Manjushri”.

## Features

- Generate ideas based on a given theme
- Organize ideas into mindmaps and affinity diagrams (class diagrams)
- Evaluate generated ideas
- Support for multiple LLM providers (e.g. OpenAI, Anthropic, Google)
- Customizable parameters for idea generation

The project started as a web app [monju.ai](https://monju.ai), which was released in July 2024.

This library is the core of monju.ai that does not include frontend part.

For general information of monju.ai, see my article from Medium "[***monju.ai: a creativity enhancement tool that uses multiple generative AIs to generate ideas and organize mind maps***](https://medium.com/@daicom0204/monju-ai-a-creativity-enhancement-tool-that-uses-multiple-generative-ais-to-generate-ideas-and-f13112313084)".

## Brainstorming Process by monju

For the general approach to brainstorming, see [Brainstorming - Wikipedia](https://en.wikipedia.org/wiki/Brainstorming).

The brainstorming process by monju consists of three main steps:

1. Generate ideas in list
2. Organize ideas in mindmap and class diagram in Mermaid
3. Evaluate ideas including overall, good points, and areas for improvement

Each step is implemented as a method in the `Monju` class.

Both mindmap and class diagram are described in Mermaid text format. Output can be drawn by any mermaid-compatible tools mainly in JavaScript, e.g. [Mermaid Live Editor](https://mermaid.live/).

## KJ method (Affinity Diagram)

In Japan, another popular ideation tool "KJ method" is often used as part of brainstorming. This method might be known as "affinity diagram" in English.

The KJ method is to categorize ideas into groups based on their similarity. Each idea is written on a single card, then categorized into groups with labels.

People in Japan hesitate open discussion. Writing in cards and categorizing them into groups might help open mind.

In monju, affinity diagram is generated as class diagram of Mermaid. This process is called "pseudo KJ method" in this library.

For details of KJ method, see [Affinity diagram - Wikipedia](https://en.wikipedia.org/wiki/Affinity_diagram).

## Installation

```bash
pip install monju
```

## Requirements

- Python 3.10 or later
- API keys for the LLM providers

This library uses `LLMMaster`, a unified interface to access major LLM providers. Set API keys following the instructions from [LLM Master](https://github.com/Habatakurikei/llmmaster), another repository by the same author.

## Usage

### Batch Execution

By just one call, all the steps of brainstorming can be done. Here is an typical example.

```python
import json
from pathlib import Path

from monju import Monju

API_KEY = Path('your_api_keys.txt').read_text(encoding='utf-8')

# Use this function to arrange parameters in dictionary format.
def pack_parameters(**kwargs):
    return kwargs


# Initialize monju with your API keys and brainstorming parameters
params = pack_parameters(
    theme="How to survive in the era of emerging AI?",
    ideas=5,
    freedom=0.2,
    language="en"
)
bs = Monju(api_keys=API_KEY, verbose=True, reduction=True, **params)

# Start the brainstorming process
bs.brainstorm()

# Show the results
print(f'Result:\n{json.dumps(bs.record, indent=2, ensure_ascii=False)}')
```

Before running, set your API keys for the dedicated LLMs in `your_api_keys.txt`. The format shall be:

```
ANTHROPIC_API_KEY=your_anthropic_key
GOOGLE_API_KEY=your_google_key
OPENAI_API_KEY=your_openai_key
```

By default, monju uses Anthropic, Google and OpenAI models. Keep in mind to secure handling of your API keys.

Information related to a session is stored in `bs.record` as `dict`. You can extract items you want, or print/save this record as JSON.

The parameter `verbose` prints progress on your screen if set `True` (default is `False`).

**NEW for v0.3.0**

The parameter `reduction` will try to remove duplicate ideas generated by multiple LLMs. It is often a hard work to manually adjust generated mindmap/affinity diagram consisting of many ideas on screen. By setting this parameter `True`, it may support reducing some similar ideas and make clearer mindmap and affinity diagram (default is `False`).

### Step-by-Step Execution

There is another way to use monju by calling each process step by step.

The following example works equivalently to the batch execution example above.

```python
import json
from pathlib import Path

from monju import Monju
from monju.config import KEY_IDEA_REDUCTION
from monju.config import KEY_MINDMAP
from monju.config import KEY_CLASS_DIAGRAM


# Initialize monju with your API keys and brainstorming parameters
bs = Monju(
    api_keys=Path('your_api_keys.txt').read_text(encoding='utf-8'),
    verbose=True,
    reduction=True,
    **{
        "theme": "How to survive in the era of emerging AI?",
        "ideas": 5,
        "freedom": 0.2,
        "language": "en"
    }
)
print(f"Status: {bs.status}")

bs.generate_ideas()
print(f"Status: {bs.status}")

bs.reduce_ideas(**{
    KEY_IDEA_REDUCTION: {
        "provider": "deepseek",
        "temperature": 0.0
    }
})
print(f"Status: {bs.status}")

bs.organize_ideas(**{
    KEY_MINDMAP: {
        "provider": "deepseek",
        "temperature": 0.0
    },
    KEY_CLASS_DIAGRAM: {
        "provider": "deepseek",
        "temperature": 0.0
    }
})
print(f"Status: {bs.status}")

bs.evaluate_ideas(**{
    "openai": {
        "provider": "openai",
        "model": "o3-mini",
        "reasoning_effort": "high"
    },
    "anthropic": {
        "provider": "anthropic",
        "model": "claude-3-7-sonnet-20250219",
        "thinking": {"type": "enabled", "budget_tokens": 10000},
        "max_tokens": 128000
    },
})
print(f"Status: {bs.status}")

bs.verify()
print(f"Status: {bs.status}")

# Show the results
print(f'Result:\n{json.dumps(bs.record, indent=2, ensure_ascii=False)}')
```

The latest models of thinking/reasoning can also be used, especially for evaluation.

Types of `bs.status` are explained in later section.

### Input Parameters

There are several parameters to set for `Monju` class:

- Constractor parameters:
  - `api_keys` (str): API keys for LLMs in `LLMMaster` manner
  - `verbose` (bool): print progress for debugging, default is `False`
  - `reduction` (bool): remove duplicate ideas, default is `False`
- Brainstorming parameters `params` as `dict`:
  - `theme` (str) **required**: theme or topic of brainstorming, a.k.a. prompt
  - `ideas` (int): number of ideas to generate by each LLM
  - `freedom` (float): value of freedom-looking thinking for each LLM, a.k.a. `temperature`, between 0 and 1. Higher more free-thinking, lower more concervative.
  - `language` (str): language for output, default is `en` and must be followed by two-letter code defined in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)


### Output Format

Results, `bs.record` in the examples, are given in `dict`. Here is an actual output of the batch brainstorming given the code above.

```json
{
  "input": {
    "theme": "How to survive in the era of emerging AI?",
    "ideas": 5,
    "freedom": 0.2,
    "language": "en",
    "idea_generation": {
      "openai": {
        "provider": "openai",
        "model": "gpt-4o-mini",
        "prompt": "\nPurpose: Generate 5 ideas on the following \"Theme\" and meeting the \"Conditions\".\n\nConditions:\n1. Propose ideas with free thinking.\n2. Consider the 5W1H when proposing.\n3. Return the results in bullet points as shown in the \"Format\".\n4. The language of the output is in en of ISO 639-1 format.\n5. Do not include your explanations.\n6. Do not add any unnecessary decorations to the bullet points.\n\nTheme: How to survive in the era of emerging AI?\n\nFormat:\n- Idea\n",
        "temperature": 0.2
      },
      "anthropic": {
        "provider": "anthropic",
        "model": "claude-3-haiku-20240307",
        "prompt": "\nPurpose: Generate 5 ideas on the following \"Theme\" and meeting the \"Conditions\".\n\nConditions:\n1. Propose ideas with free thinking.\n2. Consider the 5W1H when proposing.\n3. Return the results in bullet points as shown in the \"Format\".\n4. The language of the output is in en of ISO 639-1 format.\n5. Do not include your explanations.\n6. Do not add any unnecessary decorations to the bullet points.\n\nTheme: How to survive in the era of emerging AI?\n\nFormat:\n- Idea\n",
        "temperature": 0.2
      },
      "google": {
        "provider": "google",
        "model": "gemini-1.5-flash",
        "prompt": "\nPurpose: Generate 5 ideas on the following \"Theme\" and meeting the \"Conditions\".\n\nConditions:\n1. Propose ideas with free thinking.\n2. Consider the 5W1H when proposing.\n3. Return the results in bullet points as shown in the \"Format\".\n4. The language of the output is in en of ISO 639-1 format.\n5. Do not include your explanations.\n6. Do not add any unnecessary decorations to the bullet points.\n\nTheme: How to survive in the era of emerging AI?\n\nFormat:\n- Idea\n",
        "temperature": 0.2
      }
    },
    "idea_reduction": {
      "idea_reduction": {
        "provider": "openai",
        "model": "gpt-4o",
        "prompt": "\nPurpose: Remove duplicate ideas from the \"Idea List\".\n\nConditions:\n1. The language of the output is in en of ISO 639-1 format.\n2. Return the results also in the same list format.\n3. Do not include your explanations.\n4. Do not add any unnecessary decorations to the bullet points.\n\nIdea List:\n- Embrace continuous learning: Invest time in acquiring new skills and knowledge to stay relevant in an AI-driven job market.\n- Collaborate with AI: Develop partnerships with AI tools to enhance productivity and creativity in your work.\n- Focus on emotional intelligence: Cultivate interpersonal skills that AI cannot replicate, such as empathy and communication.\n- Innovate in niche markets: Identify and explore unique areas where human creativity and intuition can outshine AI capabilities.\n- Advocate for ethical AI: Engage in discussions and initiatives that promote responsible AI development and usage in society.\n- Develop skills in critical thinking, problem-solving, and creativity to adapt to AI-driven changes\n- Embrace lifelong learning and continuously upskill to stay relevant in the job market\n- Leverage AI tools to enhance productivity and efficiency in your work\n- Diversify your income streams and explore entrepreneurial opportunities\n- Advocate for ethical AI development and responsible implementation in your community\n- Develop specialized skills AI cannot easily replicate, focusing on creativity, critical thinking, and complex problem-solving.  Who: Individuals; What: Skill development; When: Now; Where: Online courses, workshops; Why: Future-proof career; How: Dedicated learning and practice.\n\n- Become an AI trainer or prompt engineer, leveraging human expertise to improve AI performance. Who: Tech-savvy individuals; What: AI training; When: Immediately; Where: Online platforms; Why: High demand; How: Acquire relevant skills and certifications.\n\n- Focus on human-centric industries like healthcare, education, and the arts, where empathy and nuanced understanding remain crucial. Who: Professionals; What: Career shift; When: Now; Where: Relevant sectors; Why: AI-resistant fields; How: Retraining and networking.\n\n- Embrace lifelong learning and adaptability, constantly updating skills to remain relevant in a changing job market. Who: Everyone; What: Continuous learning; When: Ongoing; Where: Online resources, universities; Why: Adaptability; How: Active engagement in learning.\n\n- Create and promote AI-augmented businesses that leverage AI's strengths while emphasizing human interaction and unique value propositions. Who: Entrepreneurs; What: Business creation; When: Now; Where: Market research; Why: Capitalize on AI; How: Develop innovative business models.\n"
      }
    },
    "mindmap": {
      "mindmap": {
        "provider": "openai",
        "model": "gpt-4o",
        "prompt": "\nPurpose: Organize the \"Idea List\" into a mindmap based on the \"Theme\" and meeting the \"Conditions\".\n\nTheme: How to survive in the era of emerging AI?\n\nConditions:\n1. Output the result in \"Format\" as Mermaid chart. Do not include your explanations.\n2. Group similar items in the \"Idea List\" into several groups and create a hierarchical structure.\n3. The language of the output is in en of ISO 639-1 format.\n\nIdea List:\n- Embrace continuous learning: Invest time in acquiring new skills and knowledge to stay relevant in an AI-driven job market.\n- Collaborate with AI: Develop partnerships with AI tools to enhance productivity and creativity in your work.\n- Focus on emotional intelligence: Cultivate interpersonal skills that AI cannot replicate, such as empathy and communication.\n- Innovate in niche markets: Identify and explore unique areas where human creativity and intuition can outshine AI capabilities.\n- Advocate for ethical AI: Engage in discussions and initiatives that promote responsible AI development and usage in society.\n- Develop skills in critical thinking, problem-solving, and creativity to adapt to AI-driven changes.\n- Leverage AI tools to enhance productivity and efficiency in your work.\n- Diversify your income streams and explore entrepreneurial opportunities.\n- Develop specialized skills AI cannot easily replicate, focusing on creativity, critical thinking, and complex problem-solving.\n- Become an AI trainer or prompt engineer, leveraging human expertise to improve AI performance.\n- Focus on human-centric industries like healthcare, education, and the arts, where empathy and nuanced understanding remain crucial.\n- Create and promote AI-augmented businesses that leverage AI's strengths while emphasizing human interaction and unique value propositions.\n\nFormat:\n```mermaid\nmindmap\n    How to survive in the era of emerging AI?\n        (Summary of ideas)\n            (Idea item)\n```\n"
      }
    },
    "class_diagram": {
      "class_diagram": {
        "provider": "openai",
        "model": "gpt-4o",
        "prompt": "\nPurpose: Organize the \"Idea List\" into a class diagram based on the \"Theme\" and meeting the \"Conditions\".\n\nTheme: How to survive in the era of emerging AI?\n\nConditions:\n1. Output the result in \"Format\" as Mermaid chart. Do not include your explanations.\n2. Make 3 to 7 groups by finding similar items in the \"Idea List\",  and define `class` for output.\n3. Look for classes that seem related and draw line between them using `-->` for output.\n4. The language of the output is in en of ISO 639-1 format.\n\nIdea List:\n- Embrace continuous learning: Invest time in acquiring new skills and knowledge to stay relevant in an AI-driven job market.\n- Collaborate with AI: Develop partnerships with AI tools to enhance productivity and creativity in your work.\n- Focus on emotional intelligence: Cultivate interpersonal skills that AI cannot replicate, such as empathy and communication.\n- Innovate in niche markets: Identify and explore unique areas where human creativity and intuition can outshine AI capabilities.\n- Advocate for ethical AI: Engage in discussions and initiatives that promote responsible AI development and usage in society.\n- Develop skills in critical thinking, problem-solving, and creativity to adapt to AI-driven changes.\n- Leverage AI tools to enhance productivity and efficiency in your work.\n- Diversify your income streams and explore entrepreneurial opportunities.\n- Develop specialized skills AI cannot easily replicate, focusing on creativity, critical thinking, and complex problem-solving.\n- Become an AI trainer or prompt engineer, leveraging human expertise to improve AI performance.\n- Focus on human-centric industries like healthcare, education, and the arts, where empathy and nuanced understanding remain crucial.\n- Create and promote AI-augmented businesses that leverage AI's strengths while emphasizing human interaction and unique value propositions.\n\nFormat:\n```mermaid\nclassDiagram\n    class ClassA {\n        idea\n    }\n    class ClassB {\n        idea\n    }\n    ClassA --> ClassB\n```\n"
      }
    },
    "idea_evaluation": {
      "openai": {
        "provider": "openai",
        "model": "gpt-4o-mini",
        "prompt": "\nPurpose: Evaluate the \"Mindmap\" based on the \"Theme\" and meeting the \"Conditions\".\n\nTheme: How to survive in the era of emerging AI?\n\nConditions:\n1. Write \"Overall Evaluation\", \"Good Points\", and \"Areas for Improvement\" according to the \"Format\".\n2. Write as concisely and focused on key points as possible.\n3. The language of the output is in en of ISO 639-1 format.\n4. Do not add any unnecessary decorations to the bullet points.\n\nMindmap:\nmindmap\n    How to survive in the era of emerging AI?\n        Education and Skill Development\n            Embrace continuous learning\n            Develop skills in critical thinking, problem-solving, and creativity\n            Develop specialized skills AI cannot easily replicate\n        Collaboration with AI\n            Collaborate with AI\n            Leverage AI tools to enhance productivity and efficiency\n            Become an AI trainer or prompt engineer\n        Emotional and Human-Centric Skills\n            Focus on emotional intelligence\n            Focus on human-centric industries like healthcare, education, and the arts\n        Innovation and Entrepreneurship\n            Innovate in niche markets\n            Diversify your income streams and explore entrepreneurial opportunities\n            Create and promote AI-augmented businesses\n        Ethical AI and Advocacy\n            Advocate for ethical AI\n\nFormat:\n- Overall Evaluation:\n  - Bullet point\n- Good Points:\n  - Bullet point\n- Areas for Improvement:\n  - Bullet point\n"
      },
      "anthropic": {
        "provider": "anthropic",
        "model": "claude-3-haiku-20240307",
        "prompt": "\nPurpose: Evaluate the \"Mindmap\" based on the \"Theme\" and meeting the \"Conditions\".\n\nTheme: How to survive in the era of emerging AI?\n\nConditions:\n1. Write \"Overall Evaluation\", \"Good Points\", and \"Areas for Improvement\" according to the \"Format\".\n2. Write as concisely and focused on key points as possible.\n3. The language of the output is in en of ISO 639-1 format.\n4. Do not add any unnecessary decorations to the bullet points.\n\nMindmap:\nmindmap\n    How to survive in the era of emerging AI?\n        Education and Skill Development\n            Embrace continuous learning\n            Develop skills in critical thinking, problem-solving, and creativity\n            Develop specialized skills AI cannot easily replicate\n        Collaboration with AI\n            Collaborate with AI\n            Leverage AI tools to enhance productivity and efficiency\n            Become an AI trainer or prompt engineer\n        Emotional and Human-Centric Skills\n            Focus on emotional intelligence\n            Focus on human-centric industries like healthcare, education, and the arts\n        Innovation and Entrepreneurship\n            Innovate in niche markets\n            Diversify your income streams and explore entrepreneurial opportunities\n            Create and promote AI-augmented businesses\n        Ethical AI and Advocacy\n            Advocate for ethical AI\n\nFormat:\n- Overall Evaluation:\n  - Bullet point\n- Good Points:\n  - Bullet point\n- Areas for Improvement:\n  - Bullet point\n"
      },
      "google": {
        "provider": "google",
        "model": "gemini-1.5-flash",
        "prompt": "\nPurpose: Evaluate the \"Mindmap\" based on the \"Theme\" and meeting the \"Conditions\".\n\nTheme: How to survive in the era of emerging AI?\n\nConditions:\n1. Write \"Overall Evaluation\", \"Good Points\", and \"Areas for Improvement\" according to the \"Format\".\n2. Write as concisely and focused on key points as possible.\n3. The language of the output is in en of ISO 639-1 format.\n4. Do not add any unnecessary decorations to the bullet points.\n\nMindmap:\nmindmap\n    How to survive in the era of emerging AI?\n        Education and Skill Development\n            Embrace continuous learning\n            Develop skills in critical thinking, problem-solving, and creativity\n            Develop specialized skills AI cannot easily replicate\n        Collaboration with AI\n            Collaborate with AI\n            Leverage AI tools to enhance productivity and efficiency\n            Become an AI trainer or prompt engineer\n        Emotional and Human-Centric Skills\n            Focus on emotional intelligence\n            Focus on human-centric industries like healthcare, education, and the arts\n        Innovation and Entrepreneurship\n            Innovate in niche markets\n            Diversify your income streams and explore entrepreneurial opportunities\n            Create and promote AI-augmented businesses\n        Ethical AI and Advocacy\n            Advocate for ethical AI\n\nFormat:\n- Overall Evaluation:\n  - Bullet point\n- Good Points:\n  - Bullet point\n- Areas for Improvement:\n  - Bullet point\n"
      }
    }
  },
  "output": {
    "elapsed_time": [
      2.709,
      3.145,
      4.449,
      3.112
    ],
    "ideas": {
      "openai": "- Embrace continuous learning: Invest time in acquiring new skills and knowledge to stay relevant in an AI-driven job market.\n- Collaborate with AI: Develop partnerships with AI tools to enhance productivity and creativity in your work.\n- Focus on emotional intelligence: Cultivate interpersonal skills that AI cannot replicate, such as empathy and communication.\n- Innovate in niche markets: Identify and explore unique areas where human creativity and intuition can outshine AI capabilities.\n- Advocate for ethical AI: Engage in discussions and initiatives that promote responsible AI development and usage in society.",
      "anthropic": "- Develop skills in critical thinking, problem-solving, and creativity to adapt to AI-driven changes\n- Embrace lifelong learning and continuously upskill to stay relevant in the job market\n- Leverage AI tools to enhance productivity and efficiency in your work\n- Diversify your income streams and explore entrepreneurial opportunities\n- Advocate for ethical AI development and responsible implementation in your community",
      "google": "- Develop specialized skills AI cannot easily replicate, focusing on creativity, critical thinking, and complex problem-solving.  Who: Individuals; What: Skill development; When: Now; Where: Online courses, workshops; Why: Future-proof career; How: Dedicated learning and practice.\n\n- Become an AI trainer or prompt engineer, leveraging human expertise to improve AI performance. Who: Tech-savvy individuals; What: AI training; When: Immediately; Where: Online platforms; Why: High demand; How: Acquire relevant skills and certifications.\n\n- Focus on human-centric industries like healthcare, education, and the arts, where empathy and nuanced understanding remain crucial. Who: Professionals; What: Career shift; When: Now; Where: Relevant sectors; Why: AI-resistant fields; How: Retraining and networking.\n\n- Embrace lifelong learning and adaptability, constantly updating skills to remain relevant in a changing job market. Who: Everyone; What: Continuous learning; When: Ongoing; Where: Online resources, universities; Why: Adaptability; How: Active engagement in learning.\n\n- Create and promote AI-augmented businesses that leverage AI's strengths while emphasizing human interaction and unique value propositions. Who: Entrepreneurs; What: Business creation; When: Now; Where: Market research; Why: Capitalize on AI; How: Develop innovative business models."
    },
    "idea_list": "- Embrace continuous learning: Invest time in acquiring new skills and knowledge to stay relevant in an AI-driven job market.\n- Collaborate with AI: Develop partnerships with AI tools to enhance productivity and creativity in your work.\n- Focus on emotional intelligence: Cultivate interpersonal skills that AI cannot replicate, such as empathy and communication.\n- Innovate in niche markets: Identify and explore unique areas where human creativity and intuition can outshine AI capabilities.\n- Advocate for ethical AI: Engage in discussions and initiatives that promote responsible AI development and usage in society.\n- Develop skills in critical thinking, problem-solving, and creativity to adapt to AI-driven changes.\n- Leverage AI tools to enhance productivity and efficiency in your work.\n- Diversify your income streams and explore entrepreneurial opportunities.\n- Develop specialized skills AI cannot easily replicate, focusing on creativity, critical thinking, and complex problem-solving.\n- Become an AI trainer or prompt engineer, leveraging human expertise to improve AI performance.\n- Focus on human-centric industries like healthcare, education, and the arts, where empathy and nuanced understanding remain crucial.\n- Create and promote AI-augmented businesses that leverage AI's strengths while emphasizing human interaction and unique value propositions.",
    "mindmap": "mindmap\n    How to survive in the era of emerging AI?\n        Education and Skill Development\n            Embrace continuous learning\n            Develop skills in critical thinking, problem-solving, and creativity\n            Develop specialized skills AI cannot easily replicate\n        Collaboration with AI\n            Collaborate with AI\n            Leverage AI tools to enhance productivity and efficiency\n            Become an AI trainer or prompt engineer\n        Emotional and Human-Centric Skills\n            Focus on emotional intelligence\n            Focus on human-centric industries like healthcare, education, and the arts\n        Innovation and Entrepreneurship\n            Innovate in niche markets\n            Diversify your income streams and explore entrepreneurial opportunities\n            Create and promote AI-augmented businesses\n        Ethical AI and Advocacy\n            Advocate for ethical AI",
    "class_diagram": "classDiagram\n    class ContinuousLearning {\n        Embrace continuous learning: Invest time in acquiring new skills and knowledge\n        Develop skills in critical thinking, problem-solving, and creativity\n        Develop specialized skills AI cannot easily replicate\n    }\n\n    class AIIntegration {\n        Collaborate with AI: Develop partnerships with AI tools\n        Leverage AI tools to enhance productivity and efficiency\n        Become an AI trainer or prompt engineer\n        Create and promote AI-augmented businesses\n    }\n\n    class EmotionalIntelligence {\n        Focus on emotional intelligence: Cultivate interpersonal skills\n        Focus on human-centric industries like healthcare, education, and the arts\n    }\n\n    class MarketInnovation {\n        Innovate in niche markets: Identify and explore unique areas\n        Diversify your income streams and explore entrepreneurial opportunities\n    }\n\n    class EthicalAdvocacy {\n        Advocate for ethical AI: Engage in discussions and initiatives\n    }\n\n    ContinuousLearning --> AIIntegration\n    AIIntegration --> EmotionalIntelligence\n    EmotionalIntelligence --> MarketInnovation\n    MarketInnovation --> EthicalAdvocacy",
    "evaluation": {
      "openai": "- Overall Evaluation:\n  - The mindmap effectively outlines strategies to navigate the challenges posed by emerging AI technologies.\n\n- Good Points:\n  - Emphasizes continuous learning and skill development relevant to the evolving job market.\n  - Highlights collaboration with AI, enhancing productivity and new career opportunities.\n  - Recognizes the importance of emotional and human-centric skills, which remain valuable despite automation.\n  - Encourages innovation and entrepreneurship, promoting adaptability in niche markets.\n  - Advocates for ethical considerations in AI development, fostering responsible usage.\n\n- Areas for Improvement:\n  - Could include more specific examples or resources for skill development and learning.\n  - May benefit from exploring potential challenges in collaboration with AI and ways to overcome them.\n  - Should address the importance of digital literacy in a more explicit manner.\n  - Could expand on methods for advocating ethical AI practices effectively.",
      "anthropic": "Overall Evaluation:\n- The mindmap provides a comprehensive overview of the key strategies and considerations for surviving in the era of emerging AI, covering essential aspects such as education, collaboration, emotional and human-centric skills, innovation, and ethical AI advocacy.\n\nGood Points:\n- The mindmap emphasizes the importance of continuous learning, developing specialized skills that AI cannot easily replicate, and leveraging AI tools to enhance productivity and efficiency.\n- It highlights the value of focusing on emotional intelligence and human-centric industries, which can be less vulnerable to AI automation.\n- The mindmap encourages innovation in niche markets, diversifying income streams, and creating AI-augmented businesses, recognizing the entrepreneurial opportunities in the AI era.\n- It acknowledges the significance of advocating for ethical AI, which is crucial for ensuring the responsible development and deployment of AI technologies.\n\nAreas for Improvement:\n- The mindmap could benefit from providing more specific examples or strategies within each category to help readers better understand how to implement the suggested approaches.\n- It could also explore the potential challenges or risks associated with each recommendation, as well as strategies for mitigating those challenges.\n- Incorporating additional resources or references for further learning and guidance could enhance the usefulness of the mindmap.",
      "google": "- Overall Evaluation:\n  - The mindmap provides a comprehensive overview of strategies for surviving in the age of emerging AI, covering skill development, collaboration, human-centric approaches, and ethical considerations.\n\n- Good Points:\n  - Covers a wide range of relevant survival strategies.\n  - Highlights the importance of both technical and soft skills.\n  - Includes ethical considerations, a crucial aspect often overlooked.\n\n- Areas for Improvement:\n  - Lack of specific examples or actionable steps within each branch.\n  - Could benefit from including strategies for adapting to potential job displacement.\n  -  Could expand on the \"Collaboration with AI\" section to include risk mitigation strategies related to AI bias and dependency."
    }
  }
}
```

The `record` object contains the following information:

- `input`:
  - `theme`: same as one in the input parameter.
  - `ideas`: same as one in the input parameter.
  - `freedom`: same as one in the input parameter.
  - `language`: same as one in the input parameter.
  - `idea_generation`: LLM information used for idea generation.
  - `idea_reduction`: LLM information used for idea reduction (if `reduction = True`)
  - `mindmap`: LLM information used for mindmap generation.
  - `class_diagram`: LLM information used for affinity diagram generation.
  - `idea_evaluation`: LLM information used for idea evaluation.
- `output`:
  - `elapsed_time`: Elapsed time in seconds as `list`: (1) idea generation, (2) idea reduction, (3) mindmap and class diagram generation, (4) idea evaluation in this order. Mindmaps and class diagrams are generated in a single process, running simultaniously.
  - `ideas`: Ideas generatedy by LLM, given in `dict`.
  - `idea_list`: List of ideas. If `reduction = False`, this list is just a collection of `ideas`. If `reduction = True`, this list will be another list after the reduction process. This list is used for mindmap and affinity diagram generation.
  - `mindmap`: Mindmap for the idea list, given in Mermaid format.
  - `class_diagram`: Affinity diagram for the idea list, given in mermaid format.
  - `evaluation`: Evaluation of the generated ideas in dictionary format if multiple LLMs are used.

**Note:** In monju, the class diagram is used for affinity diagram expression.

There are 5 ideas generated by each LLM (15 ideas in total) to the theme, but 12 ideas are used for organization through the idea reduction.

### Elapsed Time

On average, one brainstorming session takes about 60 seconds to complete by monju. It dpends on how many ideas to generate by each LLM.

Since v0.3.0, it may take longer due to the idea reduction process. But still 120 seconds shoube be longest.

### Status

There are many calls of `print` in the step-by-step example. Each print shows a different status, which is useful to know progress.

Types of `bs.status` are as follows:

- `not_started`: The brainstorming process has not started. Most of cases, this status is shown when the instance of `Monju` is created.
- `idea_generation`: Generating ideas in progress or finished.
- `reducing`: Idea reduction in progress or finished.
- `organizing`: Organizing ideas in mindmap and affinity diagram in progress or finished.
- `idea_evaluation`: Evaluating ideas in progress or finished.
- `verifying`: Verifying if all the outputs are generated in progress or finished.
- `done`: The brainstorming process is completed.
- `failed`: The brainstorming process is failed at some step.

## Supported LLM Providers

One of the most important features of `Monju` is to generate ideas from multiple LLMs.

`Monju` currently sets the following LLM providers as default for idea generation and evaluation:

- OpenAI: `gpt-4o-mini`
- Anthropic: `claude-3-haiku-20240307`
- Google: `gemini-1.5-flash`

And OpenAI `gpt-4o` is set as default for idea reduction and organization of mindmap and class diagram.

Monju is capable of single or multiple LLMs for each step:

- Generate ideas (multiple/single LLM)
- Remove duplicate ideas (single LLM)
- Organize ideas in mindmap and class diagram (single LLM)
- Evaluate ideas (multiple/single LLM)

You can configure which providers and models to use for each step. Set arguments of LLM information in `params` dictionary by calling `generate_ideas(**params)`, `reduce_ideas(**params)`, `organize_ideas(**params)`, and `evaluate_ideas(**params)`.

This customization is not possible for the batch brainstorming.

Note that providers are not limited to those shown above. Also possible to user other providers like DeepSeek, MistralAI, Groq, Perplexity, Grok and so on, as possible as they are defined in `LLMMaster` class.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

[Apache License 2.0](LICENSE)
