Github Link - https://github.com/Sbtech24/music-recommender-AI-agent
Ai Agent api deployed on mastra cloud - https://early-quick-train.mastra.cloud/a2a/agent/musicRecommenderAgent
Have you ever wanted a bot that just gets how you feel and recommends the perfect music for your mood? That’s exactly what I recently built — a Music Recommender Bot powered by Mastra and Telex.
It’s a simple idea: you tell the bot how you’re feeling, and it replies with songs that match your vibe — happy, sad, chill, or energetic. But behind that simplicity is a really interesting use of AI agents, APIs, and automation.
💡 The Idea
Music is emotional. I’ve always believed technology should be too. Instead of static playlists, what if an AI could understand your mood and personalize recommendations instantly?
That thought led me to experiment with Mastra, a framework for creating AI-powered agents, and Telex, a platform that makes it easy to integrate such agents into real-world workflows.
⚙️ The Tools I Used
Mastra — to build and deploy my AI agent.
Telex — to connect the agent so anyone can talk to it.
Music API — to fetch real song data based on mood keywords.
TypeScript — to handle the logic cleanly and reliably.
🧠 How It Works
The bot starts by asking, “How are you feeling today?”
Once you reply (for example, “I feel happy”), it fetches songs that match your mood and sends them back as recommendations — complete with song titles and links.
The best part? You can talk to it naturally. You don’t need to type “search happy songs.” Just express your emotions, and the AI figures out what to do next.
🔌 Integrating with Telex
After building and deploying the bot on Mastra Cloud, I connected it to Telex using webhooks.
That connection allows the bot to handle real-time messages, process moods, and respond with curated song lists — all through Telex’s A2A (App-to-App) communication system.
Once integrated, the bot becomes part of a larger automation ecosystem where it can be triggered, combined, or extended easily.
🪄 The Result
When I message the bot saying “I’m feeling down today,” it responds with:
“I’ve got some songs that might lift your mood — here are a few you’ll enjoy 🎶”
And then it lists cheerful tracks pulled from the music API.
It’s a small but powerful experience — one that blends AI, empathy, and technology beautifully.
🚀 What I Learned
This project taught me how flexible and powerful Mastra agents can be, especially when combined with Telex.
I also learned a lot about how structured communication (like JSON-RPC) powers integrations behind the scenes. It’s fascinating to see how a few lines of configuration can connect entire systems.
    
Top comments (0)