DEV Community

Cover image for Feels: Translating Your Spotify Soundtrack into Real Outdoor Places with Local AI and SerpApi
Prathamesh Anvekar
Prathamesh Anvekar

Posted on

Feels: Translating Your Spotify Soundtrack into Real Outdoor Places with Local AI and SerpApi

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

What I Built

Like many developers, I spend hours locked in a sensory bubble at my desk with noise-canceling headphones on, cycling through music while deep in code. Over time, I noticed something undeniable about my daily Spotify queue: my listening history serves as an unfiltered mirror of my mental state and fatigue. When hunting subtle bugs or sprinting against deadlines, my queue naturally shifts to driving, high-tempo electronica. When unwinding after a long refactoring session or mapping system architecture, it settles into minimalist acoustic or atmospheric ambient soundscapes:

Session Window (Last 10 Tracks):
- M83: Midnight City -> 105 BPM, expansive synth wave, high kinetic momentum
- Justice: Genesis -> 117 BPM, distorted analog bass, aggressive forward drive
- The xx: Intro -> 100 BPM, minimalist reverberation, steady contemplative pace
- The Prodigy: Breathe -> 130 BPM, breakbeat rhythm, peak adrenaline burst
- Woodkid: Run Boy Run -> 132 BPM, marching orchestral drums, surging forward drive
Enter fullscreen mode Exit fullscreen mode

Streaming algorithms take this behavioral data and use it to feed more screen addiction, building autoplay queues engineered to keep you in your chair. The moment you push your commits, you close your editor only to open social feeds or video streams instead of getting fresh air.

I built Feels to turn that dynamic around: using your soundtrack as a natural bridge to step away from your desk and reconnect with the outdoors.

Feels is a web application that takes your recent Spotify listening session and interprets its acoustic cadence, energy density, and emotional texture using an open-weight model running locally on your hardware. Rather than trapping you in a conversational chatbot loop, it acts as an environmental scout. It maps your sonic state to geographic search intents, then uses SerpApi's Google Maps engine to find three verified real-world outdoor destinations - such as elevated ridgeline trails, shaded forest loops, or tranquil lakeside parks. Each spot includes verified user ratings, review counts, photos, a grounded explanation of why it fits your current soundtrack, and one-click Google Maps directions.

To ensure the screen stays the shortest part of the experience, the application enforces a strict cap of 15 refreshes per day. You check your curated spots, pick a trail, shut the laptop, and head outside.

Demo

Here is a walkthrough of Feels in action, showing the Spotify authorization, the live four-stage processing indicator, and the resulting outdoor trail cards:

Feels Project Demo

Code

Feels 🌿

Turn your music into a reason to get outside.

An open-weight, privacy-first web application that translates your recent Spotify listening history into curated outdoor destinations using on-device AI and real-time map discovery.

Python FastAPI Ollama Model License Hacktoberfest

Live Demo • Architecture • Configuration • Deployment


Overview

Most streaming apps use your listening history to feed more screen time, generating algorithmic queues engineered to keep you in your chair.

Feels flips that dynamic around.

Instead of another chatbot or infinite playlist, Feels treats your recent soundtrack as an unfiltered mirror of your mental headspace. It reads your 10 most recent tracks once per day, runs an open-weight model (Qwen 2.5 Coder 7B) locally on your machine to analyze tempo, energy density, and emotional cadence, and grounds that mood in real-world outdoor spaces using SerpApi's Google Maps engine.

You get three curated physical destinations - elevated ridge trails, shaded forest loops, or…

How I Built It

The system is designed as an end-to-end pipeline connecting audio streaming telemetry, private on-device reasoning, and grounded spatial exploration. When users open the app, a real-time four-stage status pipeline visualizes the progress as tracks are fetched, analyzed on-device, queried spatially, and curated:

Feels Architecture Diagram

Data ingestion begins with the Spotify Web API, authenticating users via OAuth 2.0 with the user-read-recently-played scope. Rather than polling continuously, Feels retrieves your ten most recently played tracks at most once per calendar day. The backend extracts essential track attributes, artist metadata, and timestamps to evaluate pacing and acoustic density while keeping external requests to a minimum. These tracks are hashed and stored in an embedded SQLite database (feels.db), ensuring that subsequent refreshes throughout the day never spam Spotify servers.

To translate raw music tracks into an outdoor setting, Feels runs Qwen 2.5 Coder 7B locally through Ollama on localhost port 11434. Instead of open-ended conversational completions, the model is constrained to output a strict JSON schema containing acoustic energy levels, dominant emotional descriptors, and targeted spatial search queries:

# Querying local Ollama with JSON schema enforcement and defensive extraction
payload = {
    "model": "qwen2.5-coder:7b",
    "prompt": f"{ENVIRONMENTAL_PSYCHOLOGY_PROMPT}\n\nRecent listening session:\n{tracklist_text}",
    "stream": False,
    "format": "json",
    "options": {"temperature": 0.35, "top_p": 0.9, "num_predict": 700},
}
async with httpx.AsyncClient(timeout=60.0) as client:
    response = await client.post("http://127.0.0.1:11434/api/generate", json=payload)
    analysis = extract_and_validate_json(response.json().get("response", ""))
Enter fullscreen mode Exit fullscreen mode

Those environmental queries feed directly into SerpApi's Google Maps engine to retrieve genuine physical places with verified ratings, reviews, and geographic coordinates. The SQLite cache deduplicates visited spots so each refresh rotates to fresh outdoor locations. For cloud hosting and continuous deployment, Feels includes a native render.yaml blueprint, allowing it to deploy seamlessly to Render as a Python web service with automatic dependency installation, persistent environment variables, and live health monitoring via /api/health.

Why Does Open Innovation Matter?

Listening history is personal behavioral telemetry. What someone plays during late-night debugging or high-pressure sprints reflects their emotional state, stress levels, and daily habits. Routing raw listening history to third-party commercial AI providers exposes private behavioral patterns to corporate tracking pipelines. Running an open-weight model locally ensures that private listening data never leaves the developer's laptop, transmitting only generalized, non-identifying outdoor search terms to map services.

Open innovation also eliminates recurring token anxiety. When small personal utilities depend on metered cloud APIs, every casual refresh incurs a monetary penalty. Running open-weight models on consumer hardware provides predictable, deterministic inference at zero marginal cost, enabling sustainable tools that cost nothing to operate.

Finally, outdoor exploration often takes place near hill ridgelines, nature sanctuaries, and forest paths where mobile reception is weak or unavailable. Because Feels combines local Ollama inference with persistent SQLite caching, the core mood profiling and trail guidance continue to function smoothly even when disconnected from the network.

My Agent Session

Building Feels: Local AI Soundtrack Matcher for Outdoor Spaces
You

Hacktoberfest Dev Challenge: Touch Grass. Build an open-source AI project that gets people off the screen and into the real world, running open-weight models locally with privacy and grounded discovery.

Agent

Designing Feels: a local, privacy-first web application that turns recent Spotify listening history into curated outdoor nature destinations. Architecture uses local Qwen 2.5 Coder 7B via Ollama for mood synthesis, SerpApi for grounded Google Maps venue discovery, SQLite WAL mode for deterministic caching and rate limiting, and editorial neobrutalism UI.

You

Separate the Landing Page and the App. After connecting to Spotify, redirect to the main app with a 4-stage data processing indicator before beautifully revealing the outdoor recommendations. Rename the app to Feels.

Agent

Segregated editorial landing page at / and application dashboard at /app. Integrated real-time 4-stage processing progress bar (track reading, local Qwen inference, SerpApi discovery, and grounding), updated branding to Feels, migrated SQLite to feels.db, and verified 15/day quota enforcement.

Prize Categories

Best Use of Render

Top comments (0)