Custom particle behavior (flocking) for particles

I would like to create a custom behavior for particles, specificly swarming/flocking with collision physics.
In the end I would like to create something close to this but with the use of particles instead of meshes

link to example video

So my question could I achieve this, how to I get access to write my own custom particle behavior (close the already standard swarm behavior in the cascade system).
Would I need to dig into the engine and implement it in there somewhere or is there a way for me to write something custom on top of the engine?