$ABCD$ is a square and $AB = 1$. Equilateral triangles $AYB$ and $CXD$ are drawn such that $X$ and $Y$ are inside the square. What is the length of $XY$?
1. **Define the coordinates of the square:**
   Let the vertices of the square \(ABCD\) be \(A(0,0)\), \(B(1,0)\), \(C(1,1)\), and \(D(0,1)\).

2. **Find the coordinates of point \(Y\):**
   Since \(AYB\) is an equilateral triangle with \(AB = 1\), the height of the equilateral triangle from \(Y\) to \(AB\) is \(\frac{\sqrt{3}}{2}\). The midpoint of \(AB\) is \(\left(\frac{1}{2}, 0\right)\). Therefore, the coordinates of \(Y\) are:
   \[
   Y = \left(\frac{1}{2}, \frac{\sqrt{3}}{2}\right)
   \]

3. **Find the coordinates of point \(X\):**
   Similarly, for the equilateral triangle \(CXD\) with \(CD = 1\), the height from \(X\) to \(CD\) is \(\frac{\sqrt{3}}{2}\). The midpoint of \(CD\) is \(\left(1, \frac{1}{2}\right)\). Therefore, the coordinates of \(X\) are:
   \[
   X = \left(1 - \frac{1}{2}, 1 - \frac{\sqrt{3}}{2}\right) = \left(\frac{1}{2}, 1 - \frac{\sqrt{3}}{2}\right)
   \]

4. **Calculate the distance \(XY\):**
   Using the distance formula:
   \[
   XY = \sqrt{\left(\frac{1}{2} - \frac{1}{2}\right)^2 + \left(\frac{\sqrt{3}}{2} - \left(1 - \frac{\sqrt{3}}{2}\right)\right)^2}
   \]
   Simplify the expression inside the square root:
   \[
   XY = \sqrt{0 + \left(\frac{\sqrt{3}}{2} - 1 + \frac{\sqrt{3}}{2}\right)^2} = \sqrt{\left(\sqrt{3} - 1\right)^2}
   \]
   Therefore:
   \[
   XY = |\sqrt{3} - 1|
   \]
   Since \(\sqrt{3} > 1\), we have:
   \[
   XY = \sqrt{3} - 1
   \]

The final answer is \(\boxed{\sqrt{3} - 1}\)