Step 1: Factorize the quadratic factor.
\[
x^2-x-2=(x-2)(x+1)
\]
Hence \(x=2\) and \(x=-1\) are roots of
\[
f(x)=x^4-x^3+ax^2+bx+4
\]
Step 2: Use \(f(2)=0\).
\[
16-8+4a+2b+4=0
\]
\[
12+4a+2b=0
\]
\[
2a+b=-6
\]
\[
\cdots (1)
\]
Step 3: Use \(f(-1)=0\).
\[
1+1+a-b+4=0
\]
\[
a-b=-6
\]
\[
\cdots (2)
\]
Step 4: Solve equations (1) and (2).
From (2),
\[
a=b-6
\]
Substituting into (1),
\[
2(b-6)+b=-6
\]
\[
3b=6
\]
\[
b=2
\]
\[
a=-4
\]
Therefore
\[
\boxed{(a,b)=(-4,2)}
\]