agpeer — P2P search & downloads
Synth can find and pull files over P2P (Soulseek and torrent/magnet) through your local agpeer core’s REST API. Typical use: “get me X song in flac and put it in folder Y” — Synth searches, picks a good peer, downloads into your media root, and reports back. It can also add magnets directly, manage transfers, watch the organized library, and (gated) change the core’s runtime settings.
Setup
Run the agpeer core (default
http://127.0.0.1:41000). The plugin fails closed per action when the core is down — nothing else breaks.Paste the API token into the agpeer API Token field. The token lives in the agpeer core’s data directory as the
tokenfile (<data_dir>/token, e.g.D:\dev\agpeer\run\data\token). It is stored masked and never logged.Set the download root (agpeer Download Root, default
E:\Media\Music). This is the read-write sandbox: every download destination Synth requests must resolve inside it. Relative folder names (“some artist/new album”) are placed inside the root; anything escaping it is rejected. agpeer’s own default root applies when a request carries no destination.
Optionally raise agpeer Request Timeout (s) (default 15) and — only if you
want Synth to be able to cancel/delete transfers — enable
agpeer Allow Cancel/Delete (off by default; delete_data additionally
removes downloaded files).
How it routes
Every agpeer_* action declares external effects, so all agpeer calls run
on the agent route: one agent turn composes search → wait for results →
pick a peer → download → poll until complete. The ordinary chat catalog stays
free of P2P verbs. Like every registered action they are also auto-exposed
as synth_agpeer_* MCP tools.
Actions
Action |
What it does |
|---|---|
|
Core health + per-backend readiness. Call first when something errors. |
|
Start a search — |
|
List searches (ids, states, result counts) — recover a lost |
|
Fetch accumulated results for a |
|
Stop collecting results early by |
|
Download a soulseek |
|
Add a torrent from a magnet URI, local |
|
One transfer by |
|
Per-file selection view of a multi-file torrent ( |
|
Pause/resume a torrent transfer (soulseek rejects these). |
|
Stop a transfer. Refused while Allow Cancel/Delete is off. |
|
Remove a transfer ( |
|
List the organized media library (core’s |
|
Inspect auto-organize jobs (list, or one by |
|
Read runtime settings (full map, or one |
|
Change/remove a runtime setting override. Security level |
Recipes
Soulseek song — agpeer_status → agpeer_search {backend:"soulseek", query:"artist album flac"} → wait ~10–15 s → agpeer_search_results → pick
a peer with free slots and a shallow queue → agpeer_download → poll
agpeer_transfer until terminal.
Torrent / magnet — agpeer_status → obtain a source (user-supplied
magnet/.torrent, or agpeer_search {backend:"hook", query:...} and pick
the result with the most attributes.seeders, taking
backend_metadata.magnet) → agpeer_add_magnet → for multi-file torrents
check agpeer_transfer_files and, if only a subset is wanted, cancel with
data and re-add with file_selection → poll agpeer_transfer every ~3–5 s (pace with agent_wait, and stop + report if a transfer shows no progress across several spaced polls)
(resolving while magnet metadata is being fetched; minutes of resolving
usually means a dead swarm) → on completion, check agpeer_library /
agpeer_postprocess if auto-organize is enabled.
Notes
Downloads don’t resume; a refused/ignored peer just fails the transfer — Synth picks another result and retries, per agpeer’s failure contract.
Searches and results expire server-side (~24 h) — always re-search rather than reusing very old ids.
Disabling this plugin removes every
agpeer_*action from Synth; nothing else depends on it.