A lightweight “New Artist Scout” agent that scans a few web sources for emerging artists in your favorite genres, writes a weekly shortlist, and—most importantly—maintains agent memory in a transparent JSON file.
This repo is intentionally simple and demo-friendly:
- Memory lives outside the LLM (in
memory.json) - The LLM is used for bounded enrichment (short rationales + light genre hints), not for scraping or truth
- Every recommendation includes provenance (where it was found + when)
On each run, the scout:
- Loads
memory.json(preferences + crawl ledger + artist registry) - Fetches new posts from configured sources
- Filters to posts that link to real music platforms (YouTube, Bandcamp, SoundCloud, etc.)
- Extracts a candidate artist name from the title (heuristic)
- Dedupes by canonical URL and:
- If new: stores the candidate and optional LLM enrichment
- If already seen: appends evidence, increments
seen_count, updateslast_seen
- Writes a shortlist to
output/shortlist.md
music_scout/
scout.py
sources.py
memory_store.py
models.py
llm_client.py
enrich.py
ranker.py
shortlist.py
requirements.txt
memory.json # generated after first run
output/
shortlist.md # generated each run
cache/ # optional (if you add caching later)
Main entry point and “agent loop.”
Responsibilities:
- Load/save
memory.json - Run each source adapter
- Split candidates into new vs already known
- Update memory for already-known artists:
- append evidence
- update
last_seen - increment
seen_count - append
seen_history(capped)
- Optionally call the local LLM to enrich new candidates
- Rank + write the shortlist markdown
Run it:
python scout.py run --genres darkwave post-punk shoegaze --top 10
Holds the “connectors” to external sources.
Includes:
RedditJSONSource: pulls/new.jsonfor a subreddit (politely rate-limited)- (Optional)
RSSSource: easy, safe source type if you add RSS feeds later
Key behavior:
- Normalizes URLs (fixes
&, relative URLs, drops fragments) - Filters candidates with a music link gate (only keep posts linking to platforms like YouTube/Bandcamp)
- Extracts an artist name from common title patterns (heuristic)
Defines the core dataclasses used throughout the app:
CandidateArtistandEvidence(what the sources return)UserProfile,CrawlState, andMemorySnapshot(what’s stored in memory)
Loads and saves the agent’s durable state:
user_profileconversation_summarycrawl_ledgerartist_registry
This is the “agent memory” module. It keeps the system transparent and easy to debug.
A tiny HTTP client for OpenAI-compatible endpoints (LM Studio server).
Default assumptions:
- Base URL:
http://localhost:1234/v1 - Model:
google_gemma-3-1b-it
Used by enrich.py / scout.py.
Uses the local LLM to produce small, structured enrichment for candidates:
- normalized name
- 0–3 genre guesses (clamped to allowed list)
- one-sentence
why_match - confidence + human-check flag
Important notes:
- The LLM is not allowed to invent facts.
- Output is validated and sanitized (small-model-friendly).
A simple heuristic scoring function for ordering candidates for the shortlist.
This is intentionally basic in v1. Easy future upgrades:
- add recency boosts
- add per-source weighting
- add embedding similarity for “taste anchors”
Generates output/shortlist.md in a clean format:
- ranked candidates
- primary link
- notes (including the LLM blurb, if present)
- provenance (“Found at” evidence list)
If you’re using LM Studio (OpenAI-compatible server):
PowerShell (Windows):
$env:LLM_BASE_URL="http://localhost:1234/v1"
$env:LLM_MODEL="google_gemma-3-1b-it"
$env:LLM_API_KEY="lm-studio"
Defaults should work if LM Studio is running on localhost:1234.
Step 1. Create and activate a virtual environment
python -m venv .venv
Windows PowerShell
.venv\Scripts\Activate.ps1
macOS or Linux
source .venv/bin/activate
Step 2. Install dependencies
pip install -r requirements.txt
Step 3. Start your local LLM in LM Studio
Load the model named google_gemma-3-1b-it.
Start the OpenAI-compatible server. The default is commonly http://localhost:1234/v1.
Optional environment variables in Windows PowerShell
$env:LLM_BASE_URL="http://localhost:1234/v1"
$env:LLM_MODEL="google_gemma-3-1b-it"
$env:LLM_API_KEY="lm-studio"
Step 4. Run the scout
python scout.py run --genres darkwave post-punk shoegaze --top 10
Output files
output/shortlist.md
memory.json
This project treats agent memory as durable state outside the LLM, stored in memory.json. The LLM helps with short, bounded enrichment, but the JSON file is the source of truth for continuity.
Memory file sections
user_profile
Stores stable preferences and constraints such as genres, filters, anchors, and last_confirmed. This guides enrichment prompts and ranking.
crawl_ledger
Stores per-source run tracking such as last_checked, status, and optional cursors. This prevents the agent from losing track of where it left off.
artist_registry
Stores the long-term record of discovered artists and candidates. Each entry keeps provenance and momentum signals.
What changes on each run
New artists are added with seen_count set to 1.
If an existing artist is encountered again, the record is updated by setting last_seen to today, incrementing seen_count, appending a small entry in seen_history, and merging new provenance into evidence with duplicates removed.
That is the core demo. The scout is not just generating a list. It is building a reliable, inspectable memory of what it has seen over time.
This project is for learning and demos. Be respectful:
- Use rate limits (built in for Reddit)
- Prefer APIs or RSS feeds where possible
- Don’t hammer sites or bypass restrictions
If you want to extend it:
- Add RSS sources for blogs/labels/curators
- Add YouTube Data API adapter (official + clean provenance)
- Add a
trendingcommand (e.g.,seen_count >= 3) - Move registry/ledger to Postgres for multi-user / concurrency
- Add caching + backoff (Redis or filesystem cache)
- Add vector similarity for “sounds like” matching