Startup Idea Generator

Startup Idea Generator

Brainstorming new ideas is a lot harder when you are starting with a blank canvas. It helps to begin with some seed ideas, which you can then use to iterate and develop into viable candidates that could meet your goals. One example where this can be useful is in generating startup ideas. A few seed ideas can help aspiring founders brainstorm the next big thing that they are going to build.

This Startup Idea Generator app generates innovative startup ideas, along with startup name suggestions, just by entering an industry category, such as productivity, education, food, and so on. This app is built using simple prompt engineering techniques and leverages the Cohere Generate endpoint.

The steps to build the app are:

Step 1: Create the prompts
Step 2: Build the basic Streamlit components
Step 3: Add interactivity to the user experience

Read on for more details on each of these steps.

Building a Startup Idea Generator App

Step 1: Create the Prompts

First, we create two prompts for the Generate endpoint.

The first prompt is for startup idea generation. It contains a few examples of an industry and its corresponding startup idea. And since we want our app to take a user’s input (i.e., the industry) before generating an idea, our prompt ends with the term “Industry:”.

base_idea_prompt = """This program generates a startup idea given the industry.

Industry: Workplace
Startup Idea: A platform that generates slide deck contents automatically based on a given outline

--
Industry: Home Decor
Startup Idea: An app that calculates the best position of your indoor plants for your apartment

--
Industry: Healthcare
Startup Idea: A hearing aid for the elderly that automatically adjusts its levels and with a battery lasting a whole week

--
Industry: Education
Startup Idea: An online primary school that lets students mix and match their own curriculum based on their interests and goals

--
Industry:"""

The second prompt is for startup name generation. It contains a few examples of a startup idea description and its corresponding startup name.

base_name_prompt = """This program generates a startup name and name given the startup idea.

Startup Idea: A platform that generates slide deck contents automatically based on a given outline
Startup Name: Deckerize

--
Startup Idea: An app that calculates the best position of your indoor plants for your apartment
Startup Name: Planteasy 

--
Startup Idea: A hearing aid for the elderly that automatically adjusts its levels and with a battery lasting a whole week
Startup Name: Hearspan

--
Startup Idea: An online primary school that lets students mix and match their own curriculum based on their interests and goals
Startup Name: Prime Age

--
Startup Idea:"""

We then build the corresponding functions to call the endpoint via Cohere’s Python SDK, taking in a user input and returning the generated text.

def generate_idea(industry, creativity_input):
    response = co.generate(
        model="xlarge",
        prompt=base_idea_prompt + " " + industry + "\nStartup Idea: ",
        max_tokens=50,
        temperature=creativity_input,
        k=0,
        p=0.7,
        frequency_penalty=0.1,
        presence_penalty=0,
        stop_sequences=["--"],
    )
    startup_idea = response.generations[0].text
    startup_idea = startup_idea.replace("\n\n--", "").replace("\n--", "").strip()

    return startup_idea
def generate_name(idea, creativity_input):
    response = co.generate(
        model="xlarge",
        prompt=base_name_prompt + " " + idea + "\nStartup Name:",
        max_tokens=10,
        temperature=creativity_input,
        k=0,
        p=0.7,
        frequency_penalty=0,
        presence_penalty=0,
        stop_sequences=["--"],
    )
    startup_name = response.generations[0].text
    startup_name = startup_name.replace("\n\n--", "").replace("\n--", "").strip()

    return startup_name

Step 2: Build the Basic Streamlit Components

We then build a basic user interface using Streamlit.

st.title("🚀 Startup Idea Generator")

form = st.form(key="user_settings")
with form:
    industry_input = st.text_input("Industry", key = "industry_input")
    generate_button = form.form_submit_button("Generate Idea")
    if generate_button:
        startup_idea = generate_idea(industry_input)
        startup_name = generate_name(startup_idea)
        st.markdown("##### " + startup_name)
        st.write(startup_idea)

Step 3: Add Interactivity to the User Experience

Next, we add some enhancements to the user interface. One way we can do that is to give greater control to users when generating the ideas. For this, we implement a couple of options that add interactivity to the app.

The first one is to let users generate more than one idea in one go. For this, we’ll use the st.slider() widget to let users input the number of generations to make.

The second is to control the randomness of the model output. We can use the Generate endpoint’s temperature parameter for this. Lower values tend to generate more “predictable” output, while higher values tend to generate more “creative” output.

Finally, we add a progress bar as an indicator to the user as the idea generation takes place.

st.title("🚀 Startup Idea Generator")

form = st.form(key="user_settings")
with form:
# User input - Industry name
industry_input = st.text_input("Industry", key = "industry_input")

# Create a two-column view
col1, col2 = st.columns(2)

with col1:
    # User input - The number of ideas to generate
    num_input = st.slider("Number of ideas", value = 3, key = "num_input", min_value=1, max_value=10)

with col2:
    # User input - The 'temperature' value representing the level of creativity
    creativity_input = st.slider("Creativity", value = 0.5, key = "creativity_input", min_value=0.1, max_value=0.9)

# Submit button to start generating ideas
generate_button = form.form_submit_button("Generate Idea")

if generate_button:
    if industry_input == "":
        st.error("Industry field cannot be blank")
    else:
        my_bar = st.progress(0.05)
        st.subheader("Startup Ideas")
        for i in range(num_input):
            st.markdown("""---""")
            startup_idea = generate_idea(industry_input,creativity_input)
            startup_name = generate_name(startup_idea,creativity_input)
            st.markdown("##### " + startup_name)
            st.write(startup_idea)
            my_bar.progress((i+1)/num_input)

Conclusion

And that concludes the process of creating our Startup Idea Generator app, which generates a startup idea and name for a given industry. To get started building your own version, create a free Cohere account.