4. Given point $P$ on the hyperbola with eccentricity $\sqrt{2}$
$$
\frac{x^{2}}{a^{2}}-\frac{y^{2}}{b^{2}}=1(a>0, b>0)
$$

$F_{1} 、 F_{2}$ are the two foci of the hyperbola, and $\overrightarrow{P F_{1}} \cdot \overrightarrow{P F_{2}}$ $=0$. Then the ratio of the inradius $r$ to the circumradius $R$ of $\triangle P F_{1} F_{2}$ is
4. $\frac{\sqrt{6}}{2}-1$.

From $\overrightarrow{P F_{1}} \cdot \overrightarrow{P F_{2}}=0 \Rightarrow \angle F_{1} P F_{2}=90^{\circ}$.
Let $\left|P F_{1}\right|=m,\left|P F_{2}\right|=n$.
Also, $\left|F_{1} F_{2}\right|=2 c$, then
$$
\begin{array}{l}
R=c, r=\frac{1}{2}(m+n-2 c), \\
m^{2}+n^{2}=4 c^{2},|m-n|=2 a .
\end{array}
$$

Let $\frac{r}{R}=k$. Then
$$
\begin{array}{l}
r=k R=k c=\frac{1}{2}(m+n-2 c) \\
\Rightarrow m+n=(2 k+2) c .
\end{array}
$$

From conclusion (1) we get
$$
\begin{array}{l}
(2 k+2)^{2} c^{2}+4 a^{2}=8 c^{2} \\
\Rightarrow(k+1)^{2}=2-\frac{1}{e^{2}}=\frac{3}{2} \\
\Rightarrow k=\frac{\sqrt{6}}{2}-1 .
\end{array}
$$