Skip to main content

Generative Feedback Loops with LLMs for Vector Databases

· 33 min read
Connor Shorten

Generative Feedback Loop with an LLM Visualization

Large Language Models are heralding a new era in information technology. To better understand this revolution, it’s important to consider the historical context. The printing press significantly reduced the cost of reproducing information, while the internet cut out the middleman, making the distribution of information virtually free. In Aggregation Theory, Ben Thompson writes about how the free distribution of the internet allowed companies to modularize (or unbundle) services and focus on user experience. Ben states that “companies that win the user experience can generate a virtuous cycle where their ownership of consumers/users attracts suppliers which improves the user experience”.

Enter Large Language Models (LLMs), a world changing technology that enables transforming and generating information at incredible speeds and low cost. LLMs present the opportunity to expedite the virtuous cycle Aggregation Theory describes by commoditizing the human effort traditionally required to deliver great user experiences.

The internet cut out the newspaper, now content can be delivered directly to you. Now we are going a step further, modifying content itself based on your personal preferences! Not only are we able to bring content with a great UX to people, but now we can generate content, in real time, based on existing information in the database to create an ever better and more personalized experience!

In this article, we are going to illustrate the concept of Generative Feedback Loops with LLMs. Retrieving information from the Weaviate Vector Database to prompt Weaviate’s generative module and then vectorizing and saving these generations back into the database! Now we can semantically search through the generated content, as well as add symbolic metadata about it.

We will step into the shoes of AirBnB and implement a Generative Feedback Loop to process Listing objects. This shows how LLMs let us supercharge user experience by creating custom advertisements based on user preferences. We retrieve information about users from the DB, give that + information about the Listing to the LLM, and save the resulting custom advertisement back to the database.

Here is a quick overview of the code snippets before diving in:

  1. Create a description for Listings based on x,y,z.
  2. Semantic Search through generated Listings with the Vector Database
  3. Generate Ads for these Listings and link them with cross-references.
  4. Write personalized Ads for Connor the dog owner and Bob the weightlifter

Part 1: AirBnB Listing Example

note

The Github repo with notebooks (using Weaviate embedded) can be found here.

In this example we will be using the OpenAI text-davinci-003 and the Cohere command-xlarge-nightly LLMs to generate content, but this is also possible with other providers such as HuggingFace, Anthropic, and more. Set your OpenAI or Cohere key to use with Weaviate’s generate module using the following block of code:

import weaviate
client = weaviate.Client(embedded_options=weaviate.EmbeddedOptions(),
additional_headers = {
“X-OpenAI-Api-Key”:<YOUR OPENAI KEY HERE>
}) # if using Cohere, replace this with "X-Cohere-Api-Key"
client.get_meta() # see which modules are enabled in Weaviate Embedded

The table below illustrates the schema of the data we will use, please see the notebook for reference of the full json dictionary to create Weaviate schemas with configurations like this:

PropertyTypeVectorize?AI Generated?In import dataset?
nametext
descriptiontext
host_nametext
neighbourhoodtext
neighbourhood_grouptext
latitudenumber
longitudenumber
room_typetext
pricenumber
minimum_nightsint
number_of_reviewsint
last_reviewdate
reviews_per_monthnumber
calculated_host_listings_countint
availability_365int
hasAdAd
note

The schema can be found in this repository

Avoiding Hallucinations: Real-Time Data with LLM Capabilities

Utilizing prompt engineering tactics like “Please base your response only on the provided information”, we integrate data from the Listing database into the generative model. This allows us to draw from the provided information. By emphasizing the use of real-time information stored in Weaviate, we continuously update the language model with the latest data, bypassing the limitation of its encoded knowledge. Ultimately combining the peanut butter of factual information from the database with the jelly of LLM language understanding.

Generate a description for each Listing

generatePrompt = """
Please write a description for the following AirBnb Listing in english:
Name: {name}
Neighbourhood: {neighbourhood}
Neighbourhood Group: {neighbourhood_group}
Latitude: {latitude}
Longitude: {longitude}
Room Type: {room_type}
Price: {price}
Minimum Nights: {minimum_nights}
Number of Reviews: {number_of_reviews}
Last Review: {last_review}
Reviews per Month: {reviews_per_month}
Calculated Host Listings Count: {calculated_host_listings_count}
Availability_365: {availability_365}


Please do not make up any information about the property in your description.
"""


generate_properties = ["name","neighbourhood","neighbourhood_group",
"latitude","longitude","room_type",
"price","minimum_nights","number_of_reviews",
"last_review","reviews_per_month",
"calculated_host_listings_count","availability_365"]


descriptions = client.query\
.get("Listing", generate_properties)\
.with_generate(single_prompt=generatePrompt)\
.with_additional(["id"])\
.with_limit(5)\
.do()["data"]["Get"]["Listing"]

for description in descriptions:
new_property = {
"description": description["_additional"]["generate"]["singleResult"]
}
id = description["_additional"]["id"]
client.data_object.update(
new_property,
class_name = "Listing",
uuid=id
)

Now let's test a semantic search through the Listings, each vectorized with the respective LLM-generated description:

client.query.get("Listing", "description").with_near_text({
"concepts": ["AirBnB near a place to walk my dog"]
}).do()
OpenAI Generations
RankResult
1This private room in the Bedford-Stuyvesant neighbourhood of Brooklyn is the perfect spot for a long-term stay. The space is clean and quiet, providing a peaceful retreat from the hustle and bustle of the city. With a minimum stay of 60 nights, you'll have plenty of time to explore all that Brooklyn has to offer. The location is convenient, with easy access to public transportation and a variety of shops and restaurants nearby. Although there are no reviews yet, you can rest assured that the host is experienced and dedicated to providing a comfortable and enjoyable stay. With availability 365 days a year, this listing is a great option for anyone looking for a long-term stay in Brooklyn.
2This spacious 2 bedroom apartment is located in the vibrant East Harlem neighbourhood of Manhattan, just a stone's throw away from Central Park. The entire home is available for rent, providing guests with ample space and privacy during their stay. With a minimum stay of 7 nights, this listing is perfect for those looking for a longer-term rental option. Although there are currently no reviews for this property, guests can rest assured that they will be staying in a well-maintained and comfortable space. The host has two listings on Airbnb and the availability for this property is 249 days out of the year. Book now to experience the excitement of New York City from the comfort of this spacious apartment.
3This private room is located in the Flatbush neighborhood of Brooklyn, offering a unique country space in the heart of the city. The room is priced at $150 per night with a minimum stay of one night. Although there are currently no reviews for this listing, it is available for booking 365 days a year. The host has only one listing, ensuring a personalized and attentive experience for guests. The latitude and longitude coordinates for the property are 40.63702 and -73.96327, respectively. Book now for a peaceful and relaxing stay in the bustling city of Brooklyn.
Cohere Generations
RankResult
1Welcome to your country space in the city! This beautiful, bright, and quiet 2 bedroom apartment has been completely renovated and features a private entrance, a large kitchen with brand new stainless steel appliances, two bedrooms each with queen size beds, and a full bathroom with a soaking tub. There is also a washer and dryer in the unit as well as a dishwasher. The apartment is located in a very quiet and safe neighbourhood, and is also close to the subway and many bus lines. It is also a short walk to the beautiful Prospect Park.
2THE VILLAGE OF HARLEM....NEW YORK !\n\nThis is the Village of Harlem. A vibrant, colorful, eclectic, and the most famous Village in New York.\n\nI am a proud Harlem resident and I am so excited to share my home with you. I am also an avid traveler and I love to meet new people from around the world.\n\nWhen you stay at my place, you will have your own private room and bathroom. You will also have access to the kitchen and the living room.\n\nI am located in the heart of Harlem, just a few blocks from the 2/3 subway station. From there, it is just a few stops to downtown Manhattan.\n\nYou will be surrounded by the best restaurants, bars, and nightclubs that Harlem has to offer. The famous Apollo Theater is just a few blocks away. The beautiful Central Park is also a short walk away.\n\nCome and experience the real New York City in the Village of Harlem. I look forward to meeting you and showing you around my home.
3Huge 2 BR Upper East Cental Park\n\nHost Sing\n\nEast Harlem\nManhattan\n\nPrice: $190\n\nThis huge 2 bedroom is located in the heart of Manhattan, steps away from Central Park. It is newly renovated with stainless steel appliances, exposed brick, and beautiful hardwood floors. The apartment is located in a very safe and convenient area, with a variety of restaurants and stores nearby. The subway is also very close, making it easy to get around the city.\n\nThis is the perfect place for anyone looking to explore New York City.

Note how the 3rd generation from the Cohere model outputted Cental Park instead of the correct spelling of Central Park! At first glance it looks like the model is hallucinating Cental Park (spelled incorrectly), but this actually is in the data. This is a nice anecdote to show how the model will attend to the input in spite of it's prior knowledge, even though it has prior knowledge about Manhattan, it will still call it Cental Park because that's what the retrieved content says to do.

Generate New Data Objects

In the previous example we’ve enhanced existing data objects by adding a description property. But we can now even create complete new data objects (e.g., Ads for specific target audiences) based on the new objects.

generatePrompt = """
Please write an engaging advertisement for the following AirBnb Listing:
Description: {description}
"""


ads = client.query\
.get("Listing", ["description", "room_type", "neighbourhood"])\
.with_generate(single_prompt=generatePrompt)\
.with_additional(["id"])\
.with_limit(5)\
.do()["data"]["Get"]["Listing"]

for ad in ads:
new_ad_properties = {
"content": ad["_additional"]["generate"]["singleResult"]
}
new_ad_id = get_valid_uuid(uuid4())
client.data_object.create(
data_object = new_ad_properties,
class_name = "Ad",
uuid = new_ad_id
)
client.data_object.reference.add(
from_uuid = ad["_additional"]["id"],
from_property_name = "hasAd",
to_uuid = new_ad_id
)

Let's see the resulting ads and the descriptions they were sourced from:

OpenAI Generations
DescriptionAd
This cozy private room in the Bedford-Stuyvesant neighbourhood of Brooklyn is the perfect place to stay for an extended period of time. Located at 40.68876 latitude and -73.94312 longitude, this room is clean and quiet, and has a minimum stay of 60 nights. With a calculated host listings count of 1 and availability of 365 days a year, you can be sure to find a spot here. There are no reviews yet, so be the first to experience this great room!Are you looking for a place to stay for an extended period of time? Look no further than this cozy private room in the Bedford-Stuyvesant neighbourhood of Brooklyn! Located at 40.68876 latitude and -73.94312 longitude, this room is clean and quiet, and has a minimum stay of 60 nights. With a calculated host listings count of 1 and availability of 365 days a year, you can be sure to find a spot here. Be the first to experience this great room and write a review! Don't miss out on this amazing opportunity - book now!
This beautiful two bedroom apartment is located in the Upper East Side of Manhattan, just a short walk away from Central Park. The apartment is situated in the East Harlem neighbourhood, and is surrounded by a variety of restaurants, shops, and other attractions. The apartment is available for rent for a minimum of seven nights, and is priced at $190 per night. The apartment is equipped with all the necessary amenities, and is available for rent for 249 days out of the year.Welcome to this beautiful two bedroom apartment in the Upper East Side of Manhattan! Located in the East Harlem neighbourhood, this apartment is just a short walk away from Central Park and surrounded by a variety of restaurants, shops, and other attractions. Enjoy all the necessary amenities in this apartment, available for rent for a minimum of seven nights at a price of $190 per night. With 249 days available for rent out of the year, this is the perfect place to stay for your next vacation or business trip! Book now and experience the best of Manhattan!
This cozy private room is located in the Flatbush neighbourhood of Brooklyn. Enjoy the convenience of being in the city while still having access to the peacefulness of the countryside. The room is available for a minimum of one night and is available for booking all year round. With a latitude of 40.63702 and longitude of -73.96327, you'll be able to explore the city with ease. This listing has no reviews yet, so be the first to experience this unique country space in the city.Are you looking for a unique getaway in the city? Look no further than this cozy private room in the Flatbush neighbourhood of Brooklyn! Enjoy the convenience of being in the city while still having access to the peacefulness of the countryside. With a latitude of 40.63702 and longitude of -73.96327, you'll be able to explore the city with ease. This listing has no reviews yet, so be the first to experience this one-of-a-kind country space in the city. Book now for a minimum of one night and enjoy all year round!
Cohere Generations
DescriptionAd
Huge 2 BR Upper East Cental Park\n\nHost Sing\n\nEast Harlem\nManhattan\n\nPrice: $190\n\nThis huge 2 bedroom is located in the heart of Manhattan, steps away from Central Park. It is newly renovated with stainless steel appliances, exposed brick, and beautiful hardwood floors. The apartment is located in a very safe and convenient area, with a variety of restaurants and stores nearby. The subway is also very close, making it easy to get around the city.\n\nThis is the perfect place for anyone looking to explore New York City.Welcome to your home away from home in the heart of Manhattan! This huge 2 bedroom is located just steps away from Central Park and all the best that New York City has to offer.\n\nThe apartment has been newly renovated with stainless steel appliances, exposed brick, and beautiful hardwood floors. You'll love the convenience of being located in a very safe and convenient area, with a variety of restaurants and stores nearby. The subway is also very close, making it easy to get around the city.\n\nWhether you're here for business or pleasure, this is the perfect place to call home during your stay. Don't miss out on the opportunity to explore all that New York City has to offer from the comfort of this amazing apartment. Book your stay today and start planning your adventure!
Welcome to your country space in the city! This beautiful, bright, and quiet 2 bedroom apartment has been completely renovated and features a private entrance, a large kitchen with brand new stainless steel appliances, two bedrooms each with queen size beds, and a full bathroom with a soaking tub. There is also a washer and dryer in the unit as well as a dishwasher. The apartment is located in a very quiet and safe neighbourhood, and is also close to the subway and many bus lines. It is also a short walk to the beautiful Prospect Park.Welcome to your country space in the city! This beautiful, bright, and quiet 2 bedroom apartment has been completely renovated and features a private entrance, a large kitchen with brand new stainless steel appliances, two bedrooms each with queen size beds, and a full bathroom with a soaking tub. There is also a washer and dryer in the unit as well as a dishwasher. The apartment is located in a very quiet and safe neighbourhood, and is also close to the subway and many bus lines. It is also a short walk to the beautiful Prospect Park.\n\nPlease note that there is a $150 cleaning fee and a $500 security deposit. The security deposit will be refunded after your stay if there is no damage to the apartment.\n\nWe look forward to hosting you!
THE VILLAGE OF HARLEM....NEW YORK !\n\nThis is the Village of Harlem. A vibrant, colorful, eclectic, and the most famous Village in New York.\n\nI am a proud Harlem resident and I am so excited to share my home with you. I am also an avid traveler and I love to meet new people from around the world.\n\nWhen you stay at my place, you will have your own private room and bathroom. You will also have access to the kitchen and the living room.\n\nI am located in the heart of Harlem, just a few blocks from the 2/3 subway station. From there, it is just a few stops to downtown Manhattan.\n\nYou will be surrounded by the best restaurants, bars, and nightclubs that Harlem has to offer. The famous Apollo Theater is just a few blocks away. The beautiful Central Park is also a short walk away.\n\nCome and experience the real New York City in the Village of Harlem. I look forward to meeting youWelcome to THE VILLAGE OF HARLEM....NEW YORK!\n\nThis is the Village of Harlem. A vibrant, colorful, eclectic, and the most famous Village in New York.\n\nI am a proud Harlem resident and I am so excited to share my home with you. I am also an avid traveler and I love to meet new people from around the world.\n\nWhen you stay at my place, you will have your own private room and bathroom. You will also have access to the kitchen and the living room.\n\nI am located in the heart of Harlem, just a few blocks from the 2/3 subway station. From there, it is just a few stops to downtown Manhattan.\n\nYou will be surrounded by the best restaurants, bars, and nightclubs that Harlem has to offer. The famous Apollo Theater is just a few blocks away. The beautiful Central Park is also a short walk away.\n\nCome and experience the real New York City in the Village of Harlem. I look forward to meeting you and showing you around my home.

In the future we may want to add other properties to the Ad objects, such as dates when we ran the Ad, how much we spent, and what the resulting Click-Through-Rate was. We could then generate a new Ad by taking the top 5 highest CTR ads as a reference!

Targeted Ads

Now we will add more data to our prompt, a high-level ad target. We will write ads targeting (1) young couples, (2) elderly couples, and (3) single travelers. We will add target as a property to the Ad class, like this:

target_property = {
"dataType": [
"text"
],
"name": "target",
"description": "High-level audience target for this ad."
}


client.schema.property.create("Ad", target_property)
OpenAI Generations
Ad TargetAd
For Young CouplesAre you looking for a cozy place to stay for an extended period of time? Look no further than this private room in the Bedford-Stuyvesant neighbourhood of Brooklyn! Located at 40.68876 latitude and -73.94312 longitude, this room is clean, quiet, and perfect for young couples. With a minimum stay of 60 nights and availability of 365 days a year, you can be sure to find a spot here. Plus, you can be the first to experience this great room - there are no reviews yet! Don't miss out on this great opportunity - book your stay today!
For Elderly CouplesAre you an elderly couple looking for a place to stay for an extended period of time? Look no further than this cozy private room in the Bedford-Stuyvesant neighbourhood of Brooklyn! Located at 40.68876 latitude and -73.94312 longitude, this room is clean and quiet, and has a minimum stay of 60 nights. With a calculated host listings count of 1 and availability of 365 days a year, you can be sure to find a spot here. There are no reviews yet, so be the first to experience this great room! Enjoy the peace and quiet of this room and make it your home away from home.
For Single TravelersAre you a single traveler looking for a place to stay for an extended period of time? Look no further than this cozy private room in the Bedford-Stuyvesant neighbourhood of Brooklyn! Located at 40.68876 latitude and -73.94312 longitude, this room is clean, quiet, and has a minimum stay of 60 nights. With a calculated host listings count of 1 and availability of 365 days a year, you can be sure to find a spot here. Be the first to experience this great room and make it your home away from home!
Generic AdAre you looking for a place to stay for an extended period of time? Look no further than this cozy private room in the Bedford-Stuyvesant neighbourhood of Brooklyn! Located at 40.68876 latitude and -73.94312 longitude, this room is clean and quiet, and has a minimum stay of 60 nights. With a calculated host listings count of 1 and availability of 365 days a year, you can be sure to find a spot here. Be the first to experience this great room and write a review! Don't miss out on this amazing opportunity - book now!

In the future we may want to add other properties, such as dates when we ran the Ad, how much we spent, and what the resulting Click-Through-Rate was. We could then generate a new Ad by taking the top 5 highest CTR ads as a reference!

Cohere Generations
TargetAd
For Young CouplesWelcome to the Village of Harlem, New York! This vibrant, colorful, eclectic, and famous village is home to a proud Harlem resident who can't wait to share their home with you. As an avid traveler, they love to meet new people from around the world and show them the best of what Harlem has to offer. When you stay at this Airbnb, you'll have your own private room and bathroom, as well as access to the kitchen and living room. The host is located in the heart of Harlem, just a few blocks from the 2/3 subway station, making it easy to get to downtown Manhattan and other parts of the city. You'll be surrounded by the best restaurants, bars, and nightclubs that Harlem has to offer, including the famous Apollo Theater and beautiful Central Park. The host looks forward to meeting you and showing you around their home, so book your stay today and experience the real New York City in the Village of Harlem!
For Elderly CouplesDescription: THE VILLAGE OF HARLEM....NEW YORK! This is the Village of Harlem. A vibrant, colorful, eclectic, and the most famous Village in New York. I am a proud Harlem resident and I am so excited to share my home with you. I am also an avid traveler and I love to meet new people from around the world. When you stay at my place, you will have your own private room and bathroom. You will also have access to the kitchen and the living room. I am located in the heart of Harlem, just a few blocks from the 2/3 subway station. From there, it is just a few stops to downtown Manhattan. You will be surrounded by the best restaurants, bars, and nightclubs that Harlem has to offer. The famous Apollo Theater is just a few blocks away. The beautiful Central Park is also a short walk away. Come and experience the real New York City in the Village of Harlem. I look forward to meeting you and showing you around my home.
For Single TravelersWelcome to the Village of Harlem, New York! This vibrant, colorful, eclectic, and famous village is home to a proud Harlem resident who can't wait to share their home with you. As an avid traveler, they love to meet new people from around the world. When you stay at this Airbnb, you'll have your own private room and bathroom, as well as access to the kitchen and living room. The host is located in the heart of Harlem, just a few blocks from the 2/3 subway station, making it easy to get to downtown Manhattan. You'll be surrounded by the best restaurants, bars, and nightclubs that Harlem has to offer, including the famous Apollo Theater and beautiful Central Park. The host looks forward to meeting you and showing you around their home, so book your stay today!
Generic AdWelcome to THE VILLAGE OF HARLEM....NEW YORK! This is the Village of Harlem. A vibrant, colorful, eclectic, and the most famous Village in New York. I am a proud Harlem resident and I am so excited to share my home with you. I am also an avid traveler and I love to meet new people from around the world. When you stay at my place, you will have your own private room and bathroom. You will also have access to the kitchen and the living room. I am located in the heart of Harlem, just a few blocks from the 2/3 subway station. From there, it is just a few stops to downtown Manhattan. You will be surrounded by the best restaurants, bars, and nightclubs that Harlem has to offer. The famous Apollo Theater is just a few blocks away. The beautiful

Personlized Ads for Connor and Bob

Let’s keep unpeeling the onion and show how we could even further target these ads based on user biographies.

users = client.query\
.get("User", ["biography"])\
.with_additional(["id"])\
.with_limit(5)\
.do()["data"]["Get"]["User"]

for user in users:
generatePrompt = """
Please write an engaging advertisement for the following AirBnb Listing:
Description: {description}
Please write the advertisement for this listing to target the following user:
""" + user["biography"]

ads = client.query\
.get("Listing", ["description"])\
.with_generate(single_prompt=generatePrompt)\
.with_additional(["id"])\
.with_limit(5)\
.do()["data"]["Get"]["Listing"]

for ad in ads:
new_ad_properties = {
"content": ad["_additional"]["generate"]["singleResult"],
}
new_ad_id = get_valid_uuid(uuid4())
client.data_object.create(
data_object = new_ad_properties,
class_name = "Ad",
uuid = new_ad_id
)
client.data_object.reference.add(
from_uuid = new_ad_id,
from_property_name = "hasUserTarget",
to_uuid = user["_additional"]["id"]
)
OpenAI Generations
NameDescriptionTargeted Ad #1Targeted Ad #2
ConnorOften travels with a golden doodle named Bowen.Attention all pet lovers! Are you looking for a spacious and comfortable apartment in the heart of New York City that welcomes your furry friend? Look no further than this stunning 2 bedroom apartment in vibrant East Harlem...Book now and start planning your next adventure with your golden doodle named Bowen!Attention all travelers with furry friends! Are you looking for a peaceful and affordable stay in the heart of Manhattan? Look no further than this private room in the Inwood neighborhood, offering a magnificent view of the Cloisters...And the best part? You can bring your golden doodle named Bowen along for the adventure! No need to leave your furry friend behind on your travels...Please note that availability for this listing is currently at zero for the next 365 days, so book now to secure your spot for your next adventure with your furry friend.
BobProlific weightlifter who will get upset if he doesn’t have a good gym to workout in.Attention all weightlifters! Are you planning a trip to New York City and worried about finding a suitable place to stay that caters to your fitness needs? Look no further than this spacious 2 bedroom apartment located in the vibrant East Harlem neighbourhood of Manhattan...So what are you waiting for? Book now and experience the excitement of New York City from the comfort of this spacious apartment.Attention all weightlifters! Are you looking for a peaceful and affordable stay in the city that won't compromise your workout routine? Look no further than this private room in the Inwood neighborhood of Manhattan...Unfortunately, availability for this listing is currently at zero for the next 365 days, but keep it in mind for your next trip to the city. Don't let your workout routine suffer while traveling - book this listing now!
Cohere Generations
NameDescriptionTargeted Ad 1Targeted Ad 2
ConnorConnor often travels with a golden doodle named Bowen.Welcome to your country space in the city! This beautiful, bright, and quiet 2 bedroom apartment has been completely renovated and features a private entrance, a large kitchen with brand new stainless steel appliances, two bedrooms each with queen size beds, and a full bathroom with a soaking tub. There is also a washer and dryer in the unit as well as a dishwasher. The apartment is located in a very quiet and safe neighbourhood, and is also close to the subway and many bus lines. It is also a short walk to the beautiful Prospect Park. The space: This beautiful, bright, and quiet 2 bedroom apartment has been completely renovated and features a private entrance, a large kitchen with brand new stainless steel appliances, two bedrooms each with queen size beds, and a full bathroom with a soaking tub. There is also a washer and dryer in the unit as well as a dishwasher. The apartment is located in a very quiet and safe neighbourhood, and is also close to the subway and many bus lines. It is also a short walk to the beautiful Prospect Park. The neighborhood: The apartment is located in a very quiet and safe neighbourhood, and is also close to the subway and many bus lines. It is also a short walk to the beautiful Prospect Park. The beds: The apartment has two bedrooms each with queen size beds. The bathroom: The full bathroom has a soaking tub. The kitchen: The large kitchen has brand new stainless steel appliances. The living room: The living room is bright and spacious. The dining room: The dining room is perfect for enjoying meals with friends and family. The outdoor space: The apartment has a private entrance.Welcome to Huge 2 BR Upper East Cental Park. This huge 2 bedroom is located in the heart of Manhattan, steps away from Central Park. It is newly renovated with stainless steel appliances, exposed brick, and beautiful hardwood floors. The apartment is located in a very safe and convenient area, with a variety of restaurants and stores nearby. The subway is also very close, making it easy to get around the city. This is the perfect place for anyone looking to explore New York City.
BobBob is a prolific weightlifter who will get upset if he doesn’t have a good gym to workout in.Hello, weightlifters! Are you looking for a place to stay in New York City that will allow you to pursue your fitness goals? Look no further! This huge 2 bedroom is located in the heart of Manhattan, steps away from Central Park. It is newly renovated with stainless steel appliances, exposed brick, and beautiful hardwood floors. The apartment is located in a very safe and convenient area, with a variety of restaurants and stores nearby. The subway is also very close, making it easy to get around the city. So what are you waiting for? Book your stay today and experience the best of New York City!Welcome to your country space in the city! This beautiful, bright, and quiet 2 bedroom apartment has been completely renovated and features a private entrance, a large kitchen with brand new stainless steel appliances, two bedrooms each with queen size beds, and a full bathroom with a soaking tub. There is also a washer and dryer in the unit as well as a dishwasher. The apartment is located in a very quiet and safe neighbourhood, and is also close to the subway and many bus lines. It is also a short walk to the beautiful Prospect Park. The gym is located in the building and is easily accessible.

Deeper into Personalization

Personalized digital experiences have been taken to a new level with the latest advances in AI technology. Along with personalized recommendations or search results, the content itself can now be individualized to cater to your particular needs and preferences.From ads that look for the nearest dog parks or gyms, we may imagine a future where video advertisements are generated! The video for Connor shows maybe even him and his dog walking through central park, whereas the video for Bob shows him hitting a hang clean in a local gym! We may even imagine custom metaphors when explaining complex concepts for people. For example, “life is like a game of fetch” for Connor the dog owner, or “life is like pushing and resting in the gym” for Bob the weightlifter.

Other Use Case Examples of Feedback Loops

  1. TV Shows: Streaming services could show different scenes or alternate endings of a movie or TV show based on the user’s preferences.
  2. Code: AI can generate cod snippets based on the user’s requirements and create a feedback loop with tests to improve the code over time.
  3. AutoCAD drawings: AI could create CAD drawings of buildings based on 3D models and store information about the materials available in the environment, making it easier for architects and engineers to design and plan construction projects.
  4. Tesla Configuration: The car’s settings could be personalized based on the user’s driving style and preferences, such as choosing a slow and relaxed drive home versus a fast and sporty one.

When Do Generative Feedback Loops Run?

Having illustrated the general concept of Generative Feedback Loops, where we use data from the database to supplement the factual knowledge of generative models and then write the generated outputs back to the database for future use, let’s discuss when to kick this off.

Data Ingestion

Data Ingestion is a shorthand reference to importing data into the database. For example, every time a new User is added to the AirBnB database, we may want to kick off a Generative Feedback Loop of retrieving information about a listing and this new user and save the new ads targeted to this user. On the other hand, we may want to kick this off when a new Listing is added, writing ads for each of our users!

As another example, imagine that we have a collection of podcast episodes. Every time a new episode is added to the database, we want to kick off generation of a summary and a comparison of the podcast compared to the existing podcasts in the database. To further reinforce the idea of Generative Feedback Loops, we may retrieve a previously generated podcast summary that has been saved and indexed with semantic vector search, and use this to prompt the generative model to analyze the uniqueness of the latest podcast episode!

In addition to generating novel things based on our data, we may also task LLMs with adding symbolic properties.Gilardi, Alizadeh, and Kubli very recently published “ChatGPT Outperforms Crowd-Workers for Text-Annotation Tasks”. In this paper, Gilardi et al. compare the ability of humans with ChatGPT in categorizing 2,382 tweets into categories representative of 5 classification tasks such as whether a tweet is about content moderation, which of six predefined topics the tweet is about, and so on. This study illustrates how cheap and effective this technique is for adding labels to our data. When we generate these symbolic structures like “room_type”, we can then use it in filtered vector search! Filtered Vector Search has recently been made 1000(!) times faster in Weaviate thanks to roaring bitmap indexing!

Another powerful idea is the emergence of Knowledge Graphs 2.0. We can use LLMs to suggest relations between pieces of content and then connect these nodes together with the relational edges. Check out this example of GraphGPT!

From ChatGPT to AutoGPT and the role of Weaviate

Another title for this section would be “Complex Tasks that run overnight”. The latest imagination inspiring feat of AI has been the rise of AutoGPT! AutoGPT is a loop of prompts in which the LLM breaks a complex task into subtasks, executes them, reflects on the plan, and so on until the complex task has been completed.

Generative Feedback Loops are one of the key pieces to this puzzle. Firstly, the agent may need to save intermediate results to reference later. For example, if the agent is tasked with: “Please make an example for John on how to add ref2vec to his Weaviate app”. The agent can save a summary of John’s app after researching his code base and maybe message history on the Weaviate slack. This summary can then be used in the retrieval-augmented prompting when figuring out where to add ref2vec.

Another application of Generative Feedback Loops is for humans to debug the chain of reasoning that happened when a model like this runs overnight. Further, we may imagine multi-agent systems with roles, such as marketers, artists, product designers, and engineers. By saving intermediate results, other agents can access it and keep the party going.

Conclusion

In summary, we have presented the concept of Generative Feedback Loops. This describes not only using results from the database to answer a query, but saving the resulting generation back in the database for future reference. Hopefully this example with AirBnB listings and advertisements helped inspire your thinking about how you can use this technology and where personalization seems to be headed. We ended the article by presenting a couple of scenarios of when this runs such as Data Ingestion, and the trend towards more autonomous AI assistants. Thank you so much for reading!

What's next