From Heartfelt Letters to Happy Homes – Innovating Dog Adoption Through AI

This is Bailey – a rescue my wife found and adopted from Alabama, and behind her is a picture and memory corner of our late dog, Neo. Neo introduced us to a new world of pet parenting. He passed away unexpectedly at the age of 2 due to an undiagnosed congenital disease. Since then, we have connected with fantastic pet welfare and rescue organizations. This personal journey also led to ‘Pawsome Innovations’ to assist pet rescues, shelters, pet care, vets, and pet parents through innovative solutions. Everything via “Pawsome Innovations” is dedicated to pets, pet shelters, rescues, and organizations facilitating their adoptions.

This journey since the last few years and realization of possibilities through AI/ML led to one such innovation: matching dogs for adoption at rescues and shelters with pet parents looking to adopt. The solution continually evolves, and the matching accuracy improves with each iteration as we learn more. It’s still in it’s nascent stage, but continues to get better.

The origin of this solution is in the letter my two sons wrote to my wife and me before we had Neo – our first dog. When they were little, they convinced us to get a dog through a heartfelt letter, promising to care for the dog and also help with all chores. This letter was like a contract, though the most significant clause was that we, as parents, were the only parties genuinely responsible. This letter was the best lobbying effort and made us realize what we were missing and what a dog could bring to our lives.

Here is the step-by-step explanation of the solution –

Language agnostic letter as input:

Large language models (LLMs) will soon not be a novelty. However, what they have offered us as tools for creativity and communication with the enormous data and knowledge gathered over decades is beyond imagination. It’s also unpeeling, a layer of consciousness only known to be associated with humans. It might sound philosophical, but that’s where we are heading, and at the core of this solution for dog adoption is the subtle expression and connection with that consciousness.

Inspired by that heartfelt letter expressing their desire for a dog, I realized that such letters could be a powerful way to connect people with dogs in rescues and shelters. Finding the perfect dog goes beyond checking boxes on websites or searching online as we do for products. It’s not just about attributes like size or weight; it’s about adding a new member to the family.

There’s a more profound connection formed through subtle, unspoken love, emotions, expressions, and the unique bonds dogs bring into our lives. This is where a letter of expression plays a crucial role. It’s not just about stating our desires but also considering what’s best for the dog in a long-term home. Such letters can help potential pet parents easily navigate the adoption process, providing predictability and better preparation for welcoming a new furry family member.

Individuals write letters, in their preferred language, detailing their lifestyle, home environment, expectations of their would-be furry kid, and what they are willing to give and sacrifice for that unique furry child. These letters become the basis for finding the best match among dogs in rescues.

Utilizing Large Language Models (LLMs):

This solution leverages OpenAI’s ‘GPT-4o’ language model through an API call to parse the letter. This advanced model excels at understanding and extracting nuanced information from the text. It identifies critical attributes from the letter, such as lifestyle preferences for pet owners, specific needs, desired traits, and other subtle details expressed in the letter. These attributes are essential for the matching process.

Vector Analysis and Retrieval Augmented Generation (RAG):

The extracted attributes are transformed into vectors. These vectors represent the attributes in a numerical format that can be compared with other data. Retrieval Augmented Generation (RAG) uses these vectors to retrieve relevant information from a rescue and shelter database and identify the top dogs that best match the attributes extracted from the letter. Here is the function in the code to match preferences with pet data and return top five matches:

def match_preferences_with_pets(traits, pet_data):
combined_fields = pet_data.apply(lambda row: ' '.join([...]), axis=1)

pet_descriptions = combined_fields.tolist()
traits_embedding = model.encode([traits])
pet_embeddings = model.encode(pet_descriptions)
print(f"This is what model picked: {pet_embeddings}")


cosine_similarities = cosine_similarity(traits_embedding, pet_embeddings).flatten()
related_pet_indices = cosine_similarities.argsort()[-5:][::-1]
return pet_data.iloc[related_pet_indices]

This is what this function is doing-

  • Combines relevant fields from pet data into a single description.
  • Converts the traits and pet descriptions into numerical embeddings.
  • Calculates similarity scores and finds the top 5 matches.

Tailored Adoption Plan:

As accuracy increases, a new feature to this solution will be added – after identifying potential matches, this solution would also suggest a tailored adoption plan for each dog. This plan would include recommendations for a preferred diet, behavioral tips, what to expect on the first day, weeks, and months after adoption, and strategies to ease the transition and acclimatization post-adoption. The plan will be based on available information about the dog’s traits, known behaviors, also genetics, and other breed-specific information.

Machine Learning Model Development:

The matching model is continually evolving. Each iteration involves refining the model with more data and improved algorithms to enhance accuracy.

This solution uses various data sources, including Rescuegroup.org and Dog Aging Project 2022 Curated Data, for educational and research purposes. This data helps train the model to understand different dog attributes and match dogs with potential adopters.

Building the Pet Matching and Adoption ML Model:

Key attributes extracted from the letters, parsed by the OpenAI language model (LLM), and dog profiles are used to create features for the ML model. These features include lifestyle compatibility, activity level, breed-specific needs, and health considerations. The Retrieval-Augmented Generation (RAG) method is then employed to match the top five dogs for adoption based on these attributes.

Python for Implementation:

Python is extensively used to implement the solution. Libraries such as pandas, numpy, and sklearn are used for data preprocessing, model training, and evaluation.

Using Python, we preprocess the data, train the machine learning models, and evaluate their predictions. The process involves:

  • Cleaning the data.
  • Transforming it into suitable formats.
  • Feeding it into the model for training.

Our furry friends are here to make our lives “PawSome”. This solution combines advanced ML techniques, data normalization, analysis, and a compassionate approach to improve the lives of dogs and their new families. This journey has been deeply personal, motivating, and rewarding, driven by our love for dogs and our commitment to making a difference in the pet community.

Acknowledgement & Thanks : Rescuegroup.org and Dog Aging Project 2022 Curated Data have graciously shared data about the dogs for educational and research purposes.


And here is a sample letter and output from the code (entire code and the model will be available via a dedicated site to anyone interested in further building on it for the welfare of our furry friends)

Dear Future Furry Companion,

We hope this letter finds you well, wherever you are. My name is James, and my wife Linda and I are looking for a special dog to join our family here on our peaceful farm in Maine. We are both retired veterans who served our country with pride and dedication. Our farm is a haven of tranquility, filled with the sounds of nature and the laughter of our two 10-year-old grandkids who visit us often.

I have had a deep bond with dogs throughout my life. During my time in Vietnam, I had a loyal companion named Max who was more than just a dog to me. Max was my protector, my confidant, and my friend during some of the most challenging times. His unwavering loyalty and love provided me with the strength to endure those days. After the war, Max continued to be my steadfast companion until his last days, and his memory lives on in my heart.

Linda and I have always had a soft spot for dogs, and our farm has seen its fair share of furry friends over the years. We have always believed in giving a loving home to dogs in need, and we prefer to adopt from rescues because every dog deserves a chance at a happy life.

Our farm is a wonderful place for a dog who loves to run, explore, and be part of a family. We have a variety of farm animals, and it’s important to us that our new companion is comfortable and friendly with them. We also have other dogs who are very much a part of our family, and we hope that you will get along well with them too.

Our grandkids are full of energy and love spending time with our animals. They are kind and gentle, and they have grown up learning how to care for and respect animals. We are looking for a dog who will be their friend, someone they can grow up with and create beautiful memories together.

We promise to provide you with a loving home, plenty of adventures, and all the care you need. Our hearts and doors are open, and we are ready to welcome you with open arms. You will be more than just a pet to us; you will be a cherished member of our family.

We can’t wait to meet you, to share our lives with you, and to create new memories together. Until then, stay safe and know that there is a warm and loving home waiting for you here in Maine.

With love and anticipation,

James and Linda

This is what LLM model picked in Key Traits and Characteristics of the Ideal Pet:

1 **Friendly with Farm Animals**: The dog should be comfortable and friendly with a variety of farm animals.

2. **Good with Other Dogs**: The new pet should get along well with other dogs who are already part of the family.

3. **Kid-Friendly**: The dog should be able to interact kindly and gently with James and Linda’s 10-year-old grandkids, becoming their friend and companion.

4. **Rescue Preference**: James and Linda prefer to adopt from rescues, indicating a strong belief

And here is the output

Top 5 Pet Suggestions Based on the Letter

Pet Name: Maggie May

Sex: Female

Age: Senior

Color: Lemon with White

Breed: Hound / Mixed (medium coat)

Description: **Meet Maggie May: Your Quirky, Gentle Hound Mix Companion** Maggie May, a delightful 9-year-old hound mix weighing 53 pounds. Despite her age, Maggie is full of love and ready to find her forever home. In her foster home, Maggie has proven to be an absolute sweetheart. She adores people, gets along famously with dogs and cats, and quickly became part of the household pack. Maggie is housebroken, loves going on walks, and enjoys playtime with other dogs. There’s no aggression in Maggie; she’s a gentle soul through and through. While she’s not yet proficient in basic commands, she’s eager to learn and please. Maggie walks well on a leash, doesn’t jump on people, and behaves impeccably with other pets. However, she’s a bit of an expert counter surfer, so keeping food out of her reach is a must! During her time in foster care, Maggie has been receiving treatment for dry eye syndrome with drops twice a day, and her foster mom can donate a few months’ worth of drops. Her skin issues are clearing up, though she may still have some patches of missing hair that will likely grow back in time. Maggie loves spending time outdoors, so a secure fence would be ideal for her safety and enjoyment. She thrives in a pack-oriented environment and would appreciate the company of another dog or friendly, playful visits with canine pals. One fun fact about Maggie is that she’s a quirky and entertaining soul, bringing joy and laughter wherever she goes. Maggie is heartworm negative, up-to-date on all vaccines, microchipped, and already spayed. If you’re looking for a gentle, loving companion who enjoys walks, playtime, and being part of a pack, Maggie May could be the perfect addition to your family.

Additional Information: **Key Traits and Characteristics of Maggie May:** 1. **Age and Breed:** – 9-year-old hound mix. – Medium coat. 2. **Weight:** – Weighs 53 pounds. 3. **Temperament:** – Full of love, gentle, and an absolute sweetheart. – Gets along well with people, dogs, and cats. – No aggression, gentle soul. – Eager to learn and please. 4. **Behavior:** – Housebroken. – Enjoys walks, playtime with other dogs, and outdoor time. – Well-behaved on a leash, does not jump on people. – Quirky and entertaining.

Pet Name: Tita

Sex: Female

Age: Adult

Color:

Breed: Australian Kelpie / Mixed (short coat)

Description: 2 years old and 27 pounds. Dog friendly. Looking for a home to call her own.

Additional Information: **Key Traits and Characteristics**: 1. **Age**: 2 years old 2. **Weight**: 27 pounds 3. **Temperament**: Dog friendly 4. **Breed**: Australian Kelpie / Mixed (short coat) 5. **Needs**: Looking for a home **Diet Plan**: 1. **High-Quality Kibble**: Choose a kibble formulated for medium-sized breeds. Ensure it meets the nutritional requirements appropriate for an active dog like an Australian Kelpie. 2. **Protein**: Look for a food with a high protein content, since Kelpies are active and energetic dogs. Ingredients like chicken, lamb, or fish are beneficial. 3. **Fats**:

Pet Name: Freddie

Sex: Female

Age:

Color:

Breed: Keeshond / Mixed

Description: #ADOPTABLE❣ #Freddie #DutchResistence Keeshond Mix Spayed/UTD Vaccines/Microchipped Freddie is a spunky, smart and loyal girl. Freddie is ready for adventure and to be a bestie companion. She is currently fostered with other dogs and does well but can be a bit unsure meeting new dogs. In true Keeshond fashion she does alarm bark and has a knack for shoplifting! * * Freddie has stellar mountain goat skills for hiking, counter surfing, and agility. She is crate/dog door trained in her foster home! Her ideal home is not gone long hours, not sharing a wall as she barks when alone, and she would be okay as an only dog or however she would love to be adopted with her brother Walraven as they are quite close. Freddie is 32lbs and crate/dog door trained. *

Additional Information: ### Key Traits and Characteristics of Freddie: 1. **Breed**: Keeshond Mix 2. **Health**: Spayed, Up-to-date on vaccines, Microchipped 3. **Personality**: – Spunky – Smart – Loyal 4. **Behavior**: – Ready for adventure – Can be unsure around new dogs but does well with others eventually – Alarm bark typical of the Keeshond breed – Has a quirky behavior of shoplifting 5. **Abilities**: – Exceptional at hiking, counter surfing, and agility – Trained to use a crate and dog door 6. **Living Requirements**:

Pet Name: Effie

Sex: Female

Age: Baby

Color: White

Breed: Hound / Mixed (medium coat)

Description: ***Effie is currently located at our rescue in Georgia. Effie and her four siblings already know just how cruel this world can be, they were homeless and just yet another unwanted litter. But once this litter of pups were found and relocated to a foster home, life began to slowly get much better for them. Effie and her siblings are now healthy, happy and full of hope. Effie is most definitely the leader of this little pack of pups. Always first to greet us, Effie’s very friendly and playful personality will grab your heart in an instant. Effie has now received 2/3 of her first year puppy vaccines with the third and final coming due on July 1, 2024. She also been de-wormed and treated against parasites at proper intervals, received her rabies vaccination and started on her monthly flea/tick and heartworm preventatives. Her adopter must agree to having Effie spay once she reaches 6 months of age and providing verification of such to our rescue. Effie will require all of her basic training

Additional Information: ### Key Traits and Characteristics of Effie: 1. **Background:** – Effie was once homeless and part of an unwanted litter. 2 **Personality:** – Leader of her litter. – Friendly and playful. – Very sociable, always first to greet. 3. **Health:** – Received 2/3 of her first-year puppy vaccines. – Final vaccine due on July 1, 2024. – De-wormed and treated against parasites.

Pet Name: Emily

Sex: Female

Age: Baby

Color: Tricolor (Tan/Brown & Black & White)

Breed: Hound / Mixed (medium coat)

Description: **Emily is currently located at our rescue in Georgia. Emily and her four siblings already know just how cruel this world can be, they were homeless and just yet another unwanted litter. But once this litter of pups were found and relocated to a foster home, life began to slowly get much better for them. Emily and her siblings are now healthy, happy and full of love to give. Emily is very friendly and has a playful personality will grab your heart in an instant. Emily has now received 2/3 of her first year puppy vaccines with the third and final coming due on July 1, 2024. She also been de-wormed and treated against parasites at proper intervals, received her rabies vaccination and started on her monthly flea/tick and heartworm preventatives. Her adopter must agree to having Emily spay once she reaches 6 months of age and providing verification of such to our rescue. Emily will require all of her basic training

Additional Information: **Key Traits and Characteristics of Emily, the Ideal Pet:** 1. **Origin**: Currently located at a rescue in Georgia. 2. **Background**: Emily and her four siblings were once homeless and unwanted but have since been relocated to a foster home. 3. **Health and Wellness**: – Healthy and happy. – Completed 2/3 of her first-year puppy vaccines; the final one is


While experimenting with different letters as input, I stumbled upon something remarkable: one of the results featured a dog named “Neo” available for adoption. Neo was the name of our first dog, whom I still miss deeply. This felt like a sign to continue innovating for our beloved pets. As this solution progresses, many more ideas for pets’ health and welfare—collected over the past few years—are in development for pet rescues, welfare, and pet parents.

Pet Name: Neo

Sex: Male

Age: 1 years 2 months

Color: White with Red, Golden, Orange or Chestnut

Breed: Anatolian Shepherd / Mixed (medium coat)

Description: 1 yr-old big, tall, happy-go-lucky puppy….He’d love to be a family dog; he needs a nice, fenced yard in which to enjoy playing…Vet’s reference required.

Additional Information: ### Key Traits and Characteristics of the Ideal Pet: – **Age:** 1 year old – **Size:** Big and tall – **Personality:** Happy-go-lucky, playful – **Ideal Home Environment:** Loves being a family dog, requires a nice, fenced yard for play – **Adoption Requirement:** Vet’s reference required ### Suggested Diet Plan: 1. **High-Quality Kibble:** – **Twice Daily:** Serve a high-quality kibble specifically formulated for large, active dogs. – **Portions:** Follow the manufacturer’s guidelines based on the dog’s weight and activity level, typically 3-4 cups per day divided into two meals. 2. **Healthy Treats:** – Use

Related Posts