SAN JOSE — Alexei Agratchev was working on a video security system to help casinos catch criminals, as part of an internal startup at Cisco Systems, when an idea popped into his head.