This is python code for a write policy plugin for the strfry nostr relay that implements part of a personal relay solution. You may also be interested in my set of configs (using this write policy plugin) to make deploying a personal relay a 5-minute setup on a plain VPS.
I think that in order for nostr to be what it can be, there needs to be a LOT of small relays all over everywhere as opposed to a short list of giant, "popular" relays that everyone uses which then must inevitably become centralized points of all manner of vulnerabilities that nostr is explicitly about avoiding.
Mike Dilger, author of the nostr client gossip as well as NIP-65 wrote The Gossip Model -- a description of how gossip manages relays in a way that can support this vision of having many smaller relays all over the place and still let people find the content they want to follow via nostr. In that document there is a section called Personal Relays. The write policy in this repo is a first stab at implementing personal relays in that fashion.