No, I think electricity is not essential for AI. In theory AI (a sufficient collection of computational processes that can adapt to changes in their input, thus producing 'intelligent' behavior), could be implemented using any mechanism that can compute that set of essential functions needed to create AI. Basically I'm suggesting the possibility of combining a set of non-electric Turing-equivalent machines into a collective that together can reach the AI-level of performance.
https://en.wikipedia.org/wiki/Turing_machine_equivalents
If AI can be implemented using an electronic computer, it should also be possible to implement it using any non-electronic machine that is computationally equivalent.
To date, several non-electronic machines have been proposed as Turing-equivalent: DNA computers, quantum computers, Babbage's Analytical Engine, animal brains, maybe even a really big network of daisies (perhaps that can communicate via their rhizomes).
In fact, it's plausible that one day we could create a network composed of small brains (perhaps from a less smart species than humans) that with the right kind of genetically architected biological interconnect and scheduler could route data through its network to control a robot -- thus we'd have a synthetic biological AI engine whose brain is made up of 100 chimpanzees, or 10,000 hamster brains, or maybe even 1 million nematodes.