I had a go at this using the on-device models in edge and chrome, phi4-mini and gemini nano, worked surprisingly well for such small models.
https://ryanseddon.com/ai/how-to-build-an-agent-on-device/