๐ŸŽ„ Let's code and celebrate this holiday season with Advent of Haystack

Advent of Haystack

Welcome back to another year of Haystack challenges

with 10 challenges in the month of December ๐ŸŽ‰

Complete and submit all challenges by December 31 for a chance to win gift cards, swag, and more! ๐ŸŽ Learn more in Advent of Haystack

โœจ๐ŸŽ„ Plus: Share Your Haystack Story This Holiday Season! ๐ŸŽ„โœจ

Spread the cheer and get perks by sharing your journey with Haystack. See How.

Day 9: Santa’s Self-Reflecting Gift Agent ๐ŸŽ

MongoDB-Christmas

Elf Pash at the North Pole has a challenge. Every year, Santa needs to process millions of gift requests and optimize his gift selections based on children’s wishlists and budget constraints. Other elves often ask questions like “What gifts should we get for a 9-year-old who loves science?” or “How can we maximize joy while staying within budget?” ๐ŸŽ

This year, elf Pash has an idea to solve this: create a self-reflecting agent that can optimize gift selections automatically! As he experiments with LLMs, he realizes that simple gift suggestions aren’t enough - the agent needs to reflect on its choices to ensure they’re optimal. Being a Haystack elf, Pash knows how to solve this: SELF-REFLECTION! ๐Ÿ’ญ

So, he comes up with a plan. Santa will create a gift recommendation system using Haystack’s RAG pipeline with MongoDB Atlas vector search, enhanced with a self-reflecting component that optimizes gift selections based on budget, age appropriateness, and joy factor! โœจ

For this challenge, you must help elf Pash create a pipeline that can suggest and optimize gift selections through self-reflection.

  • Implement a self-reflecting agent that can optimize gift selections
  • Use MongoDB Atlas vector search for semantic gift matching
  • Include price, age range, and category in gift considerations
  • Ensure all suggestions stay within the specified budget

๐ŸŽฏ Requirements:

  • To use the default embedding and text generation models in this notebook, you’ll need an OpenAI API Key. Alternatively, you can replace these models with others that better suit your needs.
  • MongoDB Atlas project with an Atlas cluster (free tier works). Create your cluster, take a note of your connection string and have 0.0.0.0/0 address in your network access list. Visit detailed tutorial for step by step guide.

๐Ÿ’ Some Hints:

๐Ÿ’š Here is the Starter Colab