OK 9 dBi, what are the pattern shape guidelines? Is the co-linear "omni" an acceptable pattern.
A yagi has two dimensions (and thickness as well). You say you want a smaller antenna. Smaller than what? What are your minimum dimensions?
If you have to trade-off dimensions and performance what can you give up?
Where is the antenna going to be used? What are the other constraints?
Lay out all your requirements else the folks here may get tired of playing twenty questions.
I anticipate that it will not be practical to get the gain you want in a sufficiently small package. That is usually how antenna design goes, it is not unique to this thread. Think seriously about what compromises you can accommodate.
You might also do a preliminary yagi design to see if it works for you.