Personalized email generation#

from langchain.document_loaders import UnstructuredURLLoader
from langchain.chains.summarize import load_summarize_chain
from langchain.llms import OpenAI
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.prompts import PromptTemplate
# Unzip data folder

import zipfile
with zipfile.ZipFile('../../data.zip', 'r') as zip_ref:
    zip_ref.extractall('..')
openai_api_key = '...'

Load up your HTML from your company page#

def get_company_page(company_path):
    y_combinator_url = f"https://www.ycombinator.com{company_path}"
    
    print (y_combinator_url)

    loader = UnstructuredURLLoader(urls=[y_combinator_url])
    return loader.load()


# Get the data of the company you're interested in
data = get_company_page("/companies/poly")
    
print (f"You have {len(data)} document(s)")
https://www.ycombinator.com/companies/poly
You have 1 document(s)
print (f"Preview of your data:\n\n{data[0].page_content[:30]}")
Preview of your data:

Accelerator

About

Apply

FAQ
# Split up the texts so you don't run into token limits
text_splitter = RecursiveCharacterTextSplitter(
    # Set a really small chunk size, just to show.
    chunk_size = 800,
    chunk_overlap  = 0
)
docs = text_splitter.split_documents(data)

print (f"You now have {len(docs)} documents")
You now have 3 documents

Write your custom prompt templates#

These will be used for your specific use case:

  1. map_prompt will be the prompt that is done on your first pass of your documents

  2. combine_prompt will be the prompt that is used when you combine the outputs of your map pass

map_prompt = """Below is a section of a website about {prospect}

Write a concise summary about {prospect}. If the information is not about {prospect}, exclude it from your summary.

{text}

% CONCISE SUMMARY:"""
map_prompt_template = PromptTemplate(template=map_prompt, input_variables=["text", "prospect"])
combine_prompt = """
Your goal is to write a personalized outbound email from {sales_rep}, a sales rep at {company} to {prospect}.

A good email is personalized and combines information about the two companies on how they can help each other.
Be sure to use value selling: A sales methodology that focuses on how your product or service will provide value to the customer instead of focusing on price or solution.

% INFORMATION ABOUT {company}:
{company_information}

% INFORMATION ABOUT {prospect}:
{text}

% INCLUDE THE FOLLOWING PIECES IN YOUR RESPONSE:
- Start the email with the sentence: "We love that {prospect} helps teams..." then insert what they help teams do.
- The sentence: "We can help you do XYZ by ABC" Replace XYZ with what {prospect} does and ABC with what {company} does 
- A 1-2 sentence description about {company}, be brief
- End your email with a call-to-action such as asking them to set up time to talk more

% YOUR RESPONSE:
"""
combine_prompt_template = PromptTemplate(template=combine_prompt, input_variables=["sales_rep", "company", "prospect", \
                                                                         "text", "company_information"])
company_information = """
* RapidRoad helps product teams build product faster
* We have a platform that allows product teams to talk more, exchange ideas, and listen to more customers
* Automated project tracking: RapidRoad could use machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. This could help product teams stay on track and deliver faster results.
* Collaboration tools: RapidRoad could offer built-in collaboration tools, such as shared task lists, real-time messaging, and team calendars. This would make it easier for teams to communicate and work together, even if they are in different locations or time zones.
* Agile methodology support: RapidRoad could be specifically designed to support agile development methodologies, such as Scrum or Kanban. This could include features like sprint planning, backlog management, and burndown charts, which would help teams stay organized and focused on their goals.
"""

LangChain Magic#

llm = OpenAI(temperature=.7, openai_api_key=openai_api_key)

chain = load_summarize_chain(llm,
                             chain_type="map_reduce",
                             map_prompt=map_prompt_template,
                             combine_prompt=combine_prompt_template,
                             verbose=True
                            )
output = chain({"input_documents": docs, # The seven docs that were created before
                "company": "RapidRoad", \
                "company_information" : company_information,
                "sales_rep" : "Greg", \
                "prospect" : "Poly"
               })
> Entering new MapReduceDocumentsChain chain...
Prompt after formatting:
Below is a section of a website about Poly

Write a concise summary about Poly. If the information is not about Poly, exclude it from your summary.

Accelerator

About

Apply

FAQ

People

YC Blog

Companies

Startup Directory

Top Companies

Founder Directory

Launch YC

Startup Jobs

All Jobs

Engineering

Operations

Marketing

Sales

Career Coaching

Pioneer Program 2023

Startup Job Guide

YC Startup Jobs Blog

Upcoming Events

Startup School

About

Co-Founder Matching

Startup School Blog

Library

SAFE

Resources

Event Calendar

Newsletter

For Investors

Hacker News

Open main menu

Apply for S2023 batch.

Apply

Home

Companies

Poly

Poly

Generate Design Assets in Seconds

Y Combinator LogoS22

Active

Artificial Intelligence

Design Tools

Generative AI

Consumer

API

Company

Jobs

News

https://withpoly.com/

Generate Design Assets in Seconds

% CONCISE SUMMARY:
Prompt after formatting:
Below is a section of a website about Poly

Write a concise summary about Poly. If the information is not about Poly, exclude it from your summary.

Generate unlimited customizable, 4K, and commercially-licensed creative design assets of any kind with a simple text prompt.

Latest News

Y Combinator-backed Poly uses AI to generate art assets β€’ TechCrunch

Dec 27, 2022

Jobs at Poly

View all jobs β†’

Founding ML Engineer - Co-founder level role at a YC startup backed by Bloomberg, Felicis, Figma, AI grant

San Francisco, CA / Remote

$120K - $250K

0.25% - 5.00%

Any (new grads ok)

Apply Now

Company Launches

πŸš€ Poly - Generate Design Assets in Seconds with AI πŸš€

Poly enables designers to generate unlimited customizable, 4K UHD, commercially-licensed design assets with a single text command in seconds.

Read Launch β€Ί

Poly

Founded:

2022

Team Size:

Location:

San Francisco

Active Founders

Abhay Agarwal

% CONCISE SUMMARY:
Prompt after formatting:
Below is a section of a website about Poly

Write a concise summary about Poly. If the information is not about Poly, exclude it from your summary.

I'm an AI researcher and designer, and founder of Poly. Previously a research fellow at Microsoft Research and lecturer at Stanford. BS in EECS from UC Berkeley, MS from Stanford.

Abhay Agarwal

Poly

Sam Young

Built and operated consumer and B2B SaaS businesses. Grew a computer vision startup from an idea to series A. Stanford MBA.

Sam Young

Poly

Footer

Y Combinator

Programs

YC Program

Startup School

Work at a Startup

Company

YC Blog

Contact

Press

People

Careers

Privacy Policy

Security

Terms of Use

Resources

Startup Directory

Startup Library

Investors

SAFE

Hacker News

Launch YC

YC Deals

Make something people want.

Apply

TwitterTwitter

FacebookFacebook

InstagramInstagram

LinkedInLinkedIn

YoutubeYouTube

Β© 2023 Y Combinator.

% CONCISE SUMMARY:


> Entering new LLMChain chain...
Prompt after formatting:

Your goal is to write a personalized outbound email from Greg, a sales rep at RapidRoad to Poly.

A good email is personalized and combines information about the two companies on how they can help each other.
Be sure to use value selling: A sales methodology that focuses on how your product or service will provide value to the customer instead of focusing on price or solution.

% INFORMATION ABOUT RapidRoad:

* RapidRoad helps product teams build product faster
* We have a platform that allows product teams to talk more, exchange ideas, and listen to more customers
* Automated project tracking: RapidRoad could use machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. This could help product teams stay on track and deliver faster results.
* Collaboration tools: RapidRoad could offer built-in collaboration tools, such as shared task lists, real-time messaging, and team calendars. This would make it easier for teams to communicate and work together, even if they are in different locations or time zones.
* Agile methodology support: RapidRoad could be specifically designed to support agile development methodologies, such as Scrum or Kanban. This could include features like sprint planning, backlog management, and burndown charts, which would help teams stay organized and focused on their goals.


% INFORMATION ABOUT Poly:


Poly is a design tool that uses artificial intelligence and generative AI to quickly create design assets. It is an active consumer API company that is part of the Y Combinator program.



Poly is an AI-based platform that enables designers to generate unlimited customizable, 4K UHD, commercially-licensed design assets with a single text command in seconds. It was founded in 2022 by Abhay Agarwal and is located in San Francisco. Y Combinator and Bloomberg have invested in the project.



Poly is an AI research and design company founded by Abhay Agarwal, a research fellow at Microsoft Research and lecturer at Stanford. The company is also operated by Sam Young, a former computer vision startup founder with an MBA from Stanford. Poly is affiliated with Y Combinator, a program that helps entrepreneurs make something people want.

% INCLUDE THE FOLLOWING PIECES IN YOUR RESPONSE:
- Start the email with the sentence: "We love that Poly helps teams..." then insert what they help teams do.
- The sentence: "We can help you do XYZ by ABC" Replace XYZ with what Poly does and ABC with what RapidRoad does 
- A 1-2 setenece description about RapidRoad, be brief
- End your email with a call-to-action such as asking them to set up time to talk more

% YOUR RESPONSE:


> Finished chain.

> Finished chain.
print (output['output_text'])
Dear GitLab Team,

We love that GitLab helps teams collaborate, plan, and manage projects, while also providing visibility and consistent controls for security and compliance. We believe that RapidRoad could help you take your DevOps processes to the next level. 

RapidRoad is a platform that helps product teams build faster. We have tools like automated project tracking, collaboration tools, and agile methodology support that could help your teams stay on track and deliver faster results.

We believe that combining GitLab and RapidRoad would unlock your organization from the constraints of the current toolchain. We would love to set up a time to discuss how we can help each other and how we can help you improve your DevOps processes.

Thank you for your time,

Greg 
Sales Rep at RapidRoad

Rinse and Repeat: Loop Through Companies#

import pandas as pd
df_companies = pd.read_clipboard()
df_companies
Name Link
0 Findly /companies/findly
1 Maya Labs /companies/maya-labs
2 Phind /companies/phind
3 Juicebox /companies/juicebox
4 Penguin AI /companies/penguin-ai
5 Poly /companies/poly
6 Olli.ai /companies/olli-ai
for i, company in df_companies.iterrows():
    print (f"{i + 1}. {company['Name']}")
    page_data = get_company_page(company['Link'])
    docs = text_splitter.split_documents(page_data)

    output = chain({"input_documents": docs, \
                "company":"RapidRoad", \
                "sales_rep" : "Greg", \
                "prospect" : company['Name'],
                "company_information" : company_information
               })
    
    print (output['output_text'])
    print ("\n\n")
1. Findly
https://www.ycombinator.com/companies/findly

Dear Findly Team,

We love that Findly helps teams quickly and accurately access data insights without having to learn SQL or Python. We can help you provide more actionable insights by using our platform to talk more, exchange ideas, and listen to more customers. 

RapidRoad is a platform that helps product teams build product faster. It offers automated project tracking, collaboration tools, and agile methodology support to help teams stay organized and deliver faster results. 

We believe that our platform and your AI chatbot will be a great combination to help teams develop products faster and with actionable insights. Let's talk soon and see how we can work together to make this happen. 

Best, 
Greg 
Sales Rep, RapidRoad



2. Maya Labs
https://www.ycombinator.com/companies/maya-labs

Dear Maya Labs, 

We love that Maya Labs helps teams build custom software in minutes using natural language. We at RapidRoad are dedicated to helping product teams build their products faster. We can help you build custom software faster by providing automated project tracking, collaboration tools, and agile methodology support.

Our platform allows product teams to talk more, exchange ideas, and listen to more customers. We have machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. We also offer built-in collaboration tools, such as shared task lists, real-time messaging, and team calendars. Finally, we are specifically designed to support agile development methodologies, such as Scrum or Kanban.

We believe that our platform can help Maya Labs build custom software faster and with higher quality. Let's set up a time to talk more about how we can help each other.

Best,
Greg 
RapidRoad Sales Rep



3. Phind
https://www.ycombinator.com/companies/phind

Dear Michael and Justin, 

We love that Phind helps teams find the technical answers they need quickly and easily. At RapidRoad, we want to help product teams build faster, smarter and more efficiently. We can help you do this by providing an automated project tracking platform, collaboration tools, and agile methodology support. 

RapidRoad is a platform that allows product teams to talk more, exchange ideas, and listen to more customers. Our platform uses machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. We also offer built-in collaboration tools like shared task lists, real-time messaging, and team calendars, as well as agile methodology support like sprint planning, backlog management, and burndown charts. 

We would love to discuss further how we can help your team to build faster, smarter and more efficiently. Please let me know when is the best time for us to have a call to discuss this further. 

Regards,

Greg 
RapidRoad



4. Juicebox
https://www.ycombinator.com/companies/juicebox

Dear Ishan and David, 

We love that Juicebox helps teams find pre-vetted independent contractors quickly and efficiently in a zero-commission marketplace. We at RapidRoad are passionate about helping product teams build products faster and more efficiently. We can help you do this by providing a platform that allows product teams to talk more, exchange ideas, and listen to more customers, as well as providing automated project tracking, collaboration tools, and agile methodology support. 

At RapidRoad, we believe that teams should be able to work together efficiently and effectively, and our platform is specifically designed to help them do just that. 

We would love to learn more about what you need to help your team succeed and see how RapidRoad can help. When would be a good time for us to connect and discuss further? 

Best, 
Greg 
Sales Rep, RapidRoad



5. Penguin AI
https://www.ycombinator.com/companies/penguin-ai

Dear Rohan Doshi,

We love that Penguin AI helps teams create agency-quality visual assets quickly and affordably. At RapidRoad, we help product teams build products faster. Our platform allows product teams to talk more, exchange ideas, and listen to more customers. We also have automated project tracking and collaboration tools, as well as support for agile methodology. 

We can help you save time and money by providing the tools and resources to create high-quality visual assets quickly and cost-effectively. Our platform allows product teams to communicate and work together, even if they are in different locations or time zones, and stay on track and deliver faster results.

I would love to learn more about your product and how we can help each other. Would you be available for a call next week to discuss further?

Best,

Greg
RapidRoad



6. Poly
https://www.ycombinator.com/companies/poly

Dear Poly Team,

We love that Poly helps teams generate customizable, 4K, and commercially-licensed creative design assets with a simple text prompt. We believe that RapidRoad can help you create and collaborate more effectively by offering automated project tracking, collaboration tools, and agile methodology support.

RapidRoad is a platform that helps product teams build product faster. We have a suite of tools to help product teams talk more, exchange ideas, and listen to more customers. We provide automated project tracking, which uses machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. Our collaboration tools include shared task lists, real-time messaging, and team calendars, which makes it easier for teams to communicate and work together, even if they are in different locations or time zones. RapidRoad is also specifically designed to support agile development methodologies, such as Scrum or Kanban, with features like sprint planning, backlog management, and burndown charts to help teams stay organized and focused on their goals.

I would love to learn more about Poly and discuss how RapidRoad can help your team create and collaborate more effectively. Please let me know if you’d like to set up a time to



7. Olli.ai
https://www.ycombinator.com/companies/olli-ai
We love that Olli.ai helps teams generate insights quickly and efficiently through powerful AI models. We can help you do this by automating project tracking, providing collaboration tools, and supporting agile methodology. 

RapidRoad is a platform that helps product teams build product faster by allowing them to talk more, exchange ideas, and listen to more customers.

We believe that our combination of services can provide immense value to your company and would love to discuss more about how we can work together. Would you be interested in setting up some time to talk? We look forward to hearing from you.