This blog post is part of the 2025 C# Advent Calendar. Thanks to Matt Groves for organizing this awesome collection of knowledge and festivities. I’d also like to give a special shout out to the other NimblePros’ team members who contributed to this event, Sadukie, Ardalis, and Barret 🎉
Santa’s Dilemma 🎅❓
It’s that magical time of year again! Santa is gearing up for his annual journey to deliver gifts to children around the world. However, this year, Santa faces a unique challenge. Santa needs a more efficient and interactive way to manage the naughty or nice list, understand gift preferences, and ensure that every child receives the perfect present. Wouldn’t it be nice if Santa could chat with the list to provide better real-time feedback to the elves on children’s wishes?
Enter AI and RAG 🤖🎄
Luckily for Santa, advancements in Artificial Intelligence (AI) and Retrieval-Augmented Generation (RAG) offer a promising solution. By leveraging these technologies, Santa can create a chat application that allows him to communicate with the naughty or nice list. Even better, since Santa has some C# experience with .NET, he can utilize the new Microsoft.Extensions.AI project templates to build this application quickly and efficiently.
Building the Santa Chat Application 🛠️💻
Since Santa is already familiar with .NET 10, he can easily get started by installing the dotnet project templates. Here’s how Santa can do it:
dotnet new install Microsoft.Extensions.AI.Templates::10.0.1-preview.3.25571.5Next, Santa can create a new project using the AI chat template:
dotnet new aichatweb -o SantaChatApp --provider openaiThen Santa configures his OpenAI API key using dotnet user-secrets. For reference Santa got his API key from OpenAI’s platform.
dotnet user-secrets set "OpenAI:Key" "sk-proj-YOUR-API-KEY-HERE"Finally, Santa can run his new chat application:
dotnet run --project SantaChatApp.csprojThis will give Santa a friendly chat interface for interacting with LLMs and local documents that have been ingested by the RAG system that are included in the template project. In this template project, local documents are ingested into a vector storage database and then retrieved to add additional context to the user’s prompts.
With the project set up, Santa can now customize the RAG capabilities in his chat application. He can use pre-trained language models to understand and respond to children’s wishes effectively. Santa imports his naughty or nice list into the wwwroot/data directory as a simple markdown file. The RAG system will index this data to enable quick retrieval during chats. He can also import other relevant documents, such as letters to Santa, to enhance the chat experience. Here’s a simple example of some data Santa might use in markdown format:
# Naughty or Nice List
| Name | Status |
|------------|---------|
| Ardalis | Nice |
| Barrett | Nice |
| Coop | Naughty |
| Eric | Naughty |
| Jeff V | Nice |
| Jeff Z | Nice |
| Kevin | Nice |
| Kyle | Naughty |
| Michelle | Nice |
| Sadukie | Naughty |
| Scott | Nice |
| Thomas | Nice | With a little vibe coding to make this application silent night themed, Santa now has his chat application ready to spread some holiday cheer!

Notice how the application responds to queries about the naughty or nice list based on the data in the table above. Santa can see some of the NimblePros team has been up to no good heckling each other this year. 😆 With all of this ingested data in place, Santa can now interactively query his list and ensure that every child receives the perfect gift (looks like Sadukie is getting coal! 💥).
Conclusion 🎁🧠
The new Microsoft.Extensions.AI.Templates make getting started with chat based AI interactions and RAG a breeze, even for busy folks like Santa. The full source for this application is available on my GitHub repo for this project If you’re interested in building your own AI-powered chat applications, be sure to check out the Microsoft.Extensions.AI.Templates and explore the exciting possibilities of generative AI and RAG! Thanks for reading, and happy holidays! 🎄🤖🎅


