Inspiration

We love how music can perfectly capture a moment, but we were frustrated with the constant search for the right playlist. Generic recommendations feel impersonal, and building your own takes time and effort. Our inspiration was to create a solution that combines the expertise of a professional DJ with the ease of a simple conversation. We wanted to build an AI that doesn't just hear your request but understands your vibe, crafting a unique soundtrack for any part of your life.

What it does

AI DJ is an intelligent agent that acts as your personal music curator. Users interact with it through a simple chat interface, describing any moment, mood, or event in natural language. For example, you can ask for "upbeat music for a Friday afternoon that's not too distracting" or "a chill, jazzy playlist for a rainy day at home."

AI DJ then:

  1. Interprets the complex, nuanced request.
  2. Translates the "vibe" into specific musical attributes like tempo, energy, and danceability.
  3. Autonomously interacts with the Spotify API to find, filter, and select the perfect tracks.
  4. Delivers a brand new, ready-to-play playlist directly to the user's Spotify account in seconds.

How we built it

We built AI DJ on a 100% serverless architecture using AWS, ensuring scalability and efficiency.

  • Brain / Reasoning Engine: We use Amazon Bedrock with the Anthropic Claude 3 Sonnet model. It's the core of our agent, responsible for interpreting user requests and translating them into a structured JSON object of musical parameters.
  • Orchestration & Logic: An AWS Lambda function serves as the central engine. It receives requests, communicates with Bedrock, executes the calls to the Spotify API, and builds the final playlist.
  • API Layer: Amazon API Gateway provides the secure, public-facing endpoint for our application, triggering the Lambda function with each new user request.
  • Memory: Amazon DynamoDB is used to securely store and manage user authentication tokens for the Spotify API, allowing for a seamless and personalized user experience.

Challenges we ran into

Our main challenge was bridging the gap between subjective human emotion and objective data. Translating a "chill vibe" into concrete API parameters like energy < 0.5 was difficult. We overcame this through extensive prompt engineering, designing prompts that guided Bedrock to return a consistent and accurate JSON output. Another challenge was ensuring playlist cohesion; we solved this by adding a sorting algorithm to our Lambda function that arranges the selected tracks for a smoother listening experience.

Accomplishments that we're proud of

We are incredibly proud of building a true AI agent that follows the "reason, tool, act" paradigm, going far beyond a simple chatbot. Successfully engineering our prompts to have an LLM generate structured, reliable data for another API felt like a major breakthrough. Furthermore, we're proud to have architected and deployed a fully functional and scalable application on a completely serverless AWS stack within the hackathon's timeframe.

What we learned

This project was a deep dive into the practical application of modern AI. We learned how to effectively use LLMs as a reasoning engine to interface with external tools. We gained hands-on experience with the power and speed of serverless architecture for rapid development. Most importantly, we learned that the key to building powerful agents lies in the creative synergy between a well-designed prompt and robust backend logic.

What's next for AI DJ

The future for AI DJ is all about becoming a more proactive and deeply integrated music companion. Our roadmap includes:

  • Proactive Suggestions: Integrating with Calendar and Weather APIs to suggest playlists for upcoming events or the current weather in your location.
  • Deeper Personalization: Analyzing a user's listening history to learn their unique tastes and make even smarter recommendations.
  • Collaborative Playlists: Adding a feature to create blended playlists for groups by analyzing the tastes of multiple users.
  • Voice Integration: Allowing users to interact with AI DJ hands-free using voice commands.

Built With

Share this project:

Updates