A LangGraph-powered agentic workflow that generates personalized music recommendations based on your Last.fm listening history, with Langfuse tracing and email notifications.
graph TD
A[Fetch Last.fm Listening Data] --> B{Route by Type}
B -->|new releases| C[Search New Releases]
B -->|classics| D[Search Classic Albums]
C --> E[Generate Recommendations]
D --> E
E --> F[Mistral Medium 3.5]
F --> G[Langfuse]
F --> H[Email via Resend]
style F fill:#f59e0b,color:#fff
style G fill:#5046e5,color:#fff
style H fill:#10b981,color:#fff
cd tocadiscos
uv syncThe repository uv.toml keeps dependency installs seven days behind newly
published package versions.
cp .env.example .env
# Edit .env with your API keys# Full workflow (new releases + classics)
uv run python main.py
# Only new releases
uv run python main.py --new-releases
# Only classics, no notifications
uv run python main.py --classics --no-notify
# Different user
uv run python main.py --user someone_elsetocadiscos/
├── main.py # CLI entry point
├── pyproject.toml # Project config & dependencies
├── uv.lock # Locked dependencies
├── uv.toml # uv resolver config with 7-day install delay
├── .env.example # Environment template
└── src/
├── __init__.py
├── agent.py # LangGraph workflow + Langfuse integration
├── lastfm_client.py # Last.fm API wrapper
├── web_search.py # Web search for album discovery
└── notifications.py # Email notifications (Resend)
The agent calls Last.fm API to get your last 30 days of scrobbles, then:
- Aggregates plays by artist
- Extracts top genres from artist tags
- Builds a "taste profile"
Based on your taste profile:
- New Releases: Searches curated music publications for albums released in the last 15 days:
- Pitchfork - Album reviews
- Stereogum - Album of the week
- Consequence of Sound - New album streams
- Resident Advisor - Electronic/dance music
- The Line of Best Fit - Album reviews
- Jenesaispop - Spanish music
- Les Inrockuptibles - French music
- Nova - French music
- Classics: Searches for "greatest albums" lists, excluding artists you already know
Mistral Medium 3.5 analyzes by default:
- Your taste profile (artists, genres, listening patterns)
- Search results from the web
- Produces 5 personalized recommendations with explanations
Set LLM_PROVIDER=anthropic to use the Anthropic path instead.
- All steps are traced to Langfuse for debugging and analysis
- Results can be sent via email (Resend)
MIT - do whatever you want with it!