Geometry-aware optimization and learning in multi-agent systems