DEV Community

Cover image for 🚀 How I Created an AI-Powered Secret Santa Using Cognee as the Memory Layer
Pravesh Sudha
Pravesh Sudha Subscriber

Posted on

🚀 How I Created an AI-Powered Secret Santa Using Cognee as the Memory Layer

Welcome Devs 👋 — Another Fun Build with Cognee + AI

Welcome Devs to another interesting blog from my side!

It’s been a while since I first connected with Cognee, and exactly a month ago I actually built a Cognee Starter application from scratch using Flask and deployed it on AWS ECS using Terraform. If you haven’t checked it out yet, here’s the link to that build — you’ll enjoy it:

Since then, the Cognee team has been on fire. Their GitHub repo recently crossed 10K+ stars (absolutely deserved 🎉). And staying true to the momentum, they came up with a fun little community event — the Secret Santa Mini Challenge.

So… for this challenge, I decided to build something a bit unique —

An Emotion-Aware Secret Santa powered by Gemini 2.5 Flash, with Cognee acting as the memory layer holding everything together.


How the Idea Hit Me 🤯 — And Why Emotions Matter in Secret Santa

After going through the rules and criteria of the challenge, I started brainstorming ideas… and suddenly something clicked on a very personal level.

In my friend group, I’m the delightful one

Happy for no absolute reason, just vibing, giggling, randomly remembering something from Kevin Hart Special 😂

But my friends?

Total opposite personalities:

  • One is stressed 24/7 because of career pressure

  • Another is moody, unpredictable like Mumbai weather

  • And the last one is the chill guy, relaxed in literally every situation

Reflecting on that, I thought:

Why not create a Secret Santa that understands emotions the same way we understand each other?

A Secret Santa that:

  • Reads how each friend is feeling

  • Understands their energy, mood, and stress

  • Pairs them up based on emotional compatibility

  • And even helps choose a meaningful gift

That’s how Emotion-Aware Secret Santa was born.


How It Works 🧠🎁 — Turning Feelings Into Smart Gift Matches

Each friend gives:

  • Their name, and

  • A short description of their mood, week, stress level, or personality

For example:

  • “Alice is overwhelmed with work and feeling stressed.”

  • “Bob had a great week and is feeling positive and energetic.”

These tiny descriptions become the foundation for the AI’s reasoning.

🧩 Step 1 — Storing the emotional descriptions with Cognee

Each user description is added into Cognee’s memory layer using:

cognify.add(...)
Enter fullscreen mode Exit fullscreen mode

Then using:

cognify()
Enter fullscreen mode Exit fullscreen mode

Cognee processes all the data with Gemini, building:

  • Semantic links

  • Entities

  • Relationships

  • A mini knowledge graph

  • Embeddings

(I’ve shown this visually in my previous video — it’s super cool to watch.)

🧠 Step 2 — Cognee asks the right question

Cognee then asks:

“What is the emotional state or mood of Alice?”

Using RAG_COMPLETION, Gemini returns refined emotional states like:

  • stressed

  • excited

  • lonely

  • happy

  • tired

🎅 Step 3 — AI-Powered Secret Santa Pairing

Now the fun logic:

  • Cognee assigns Secret Santa pairs

  • Makes sure no one gets themselves

  • And suggests a gift based on emotion

Gift suggestions are generated using a local gift dictionary (0 extra AI cost… because while testing I hit the Gemini daily quota twice 💀😂).

🎉 Step 4 — The Big Reveal

Finally, the program prints a beautiful Secret Santa reveal:

  • Who is gifting whom

  • Why they were paired

  • And what gift matches their emotional state

Simple, wholesome, and powered by Cognee’s memory + Gemini’s reasoning.


Try It Yourself 🎄 — Run the Emotion-Aware Secret Santa on Your Machine

I’ve open-sourced the entire project so you can explore, modify, and have fun with it.

The code is available here:

👉 GitHub Repo: https://github.com/Pravesh-Sudha/secret-santa-cognee

Clone it to your system and you’re ready to get started.

🔑 Step 1 — Get Your Gemini API Key

To run this project, you’ll need a Gemini API key.

The good news? Google AI Studio gives you one for free.

Once you have your key:

  1. Inside the project directory, create a .env file

  2. Copy everything from .env.example

  3. Replace the values of:

* `LLM_API_KEY`

* `EMBEDDING_API_KEY`  
    with your Gemini key
Enter fullscreen mode Exit fullscreen mode

And boom — the setup is done.

🔧 Step 2 — Install Dependencies

Inside your project directory, run:

uv sync
Enter fullscreen mode Exit fullscreen mode

This will install all required dependencies cleanly.

📝 Step 3 — Customise Your Friends & Gifts

You can now explore the code and make the project your own:

👥 Add your own friends

Open:

data/friends.json
Enter fullscreen mode Exit fullscreen mode

Add your friends and their mood descriptions.

(Tip: try to keep it max 4 friends, otherwise you may hit the Gemini daily quota like I did 😭😂)

🎁 Customise the gifts

Inside:

gift_gen.py
Enter fullscreen mode Exit fullscreen mode

You can update gifts for each emotion to make them more fun, personal, or chaotic — your call.

▶️ Step 4 — Run the Project

Once everything is set up, run:

uv run main.py
Enter fullscreen mode Exit fullscreen mode

The program takes around 2–3 minutes, and then…

🎉 You get a full Secret Santa reveal right in your terminal!

  • Who got whom

  • Their emotional reasoning

  • And the perfect gift suggestion

All powered by Cognee + Gemini.

NOTE: Initially, I planned to generate gifts using Gemini too… but Gemini’s “Requests per Minute” limit looked at me and said:
Not today, brother.”
So I switched to a local gift list — zero extra AI cost, much more reliable.


📽️ Video Demonstration


🎄 Conclusion — Building with Cognee Is Just Too Much Fun

This Secret Santa Mini Challenge by Cognee was the perfect excuse to experiment, break things, fix things, hit API limits twice 😭, and eventually build something that felt genuinely personal.

Using Cognee as the memory layer + Gemini 2.5 Flash for reasoning turned a simple holiday tradition into a small emotionally aware AI system — and honestly, that’s the kind of playful innovation that makes me love building these projects.

If you try it out, tweak it, or turn it into something wild and creative, I’d genuinely love to see it.

And big shoutout to the Cognee team for organizing such a wholesome challenge and continuing to ship amazing updates to the ecosystem.

More AI projects, more experiments, and more community fun coming soon.

Till then — keep building, keep learning, and keep vibing. ✨

🌐 Connect With Me

If you enjoyed this project or want to follow my DevOps + AI journey, find me here:

See you in the next build! 🚀

Top comments (4)

Collapse
 
nadinev profile image
Nadine

The only gifts my friends will get from me are 50% AI-generated, 50% copy-pasting the prompt I wrote :)

Collapse
 
pravesh_sudha_3c2b0c2b5e0 profile image
Pravesh Sudha

And they will be the good one too!

Collapse
 
hande_kafkas_16805c7d4eab profile image
Hande Kafkas

thanks for sharing Pravesh! love the creativity!

Collapse
 
pravesh_sudha_3c2b0c2b5e0 profile image
Pravesh Sudha

😊