  We introduce the ghost algebra, a two-boundary generalisation of the
Temperley-Lieb (TL) algebra, using a diagrammatic presentation. The existing
two-boundary TL algebra has a basis of string diagrams with two boundaries, and
the number of strings connected to each boundary must be even; in the ghost
algebra, this number may be odd. To preserve associativity while allowing
boundary-to-boundary strings to have distinct parameters according to the
parity of their endpoints, as seen in the one-boundary TL algebra, we decorate
the boundaries with bookkeeping dots called ghosts. We also introduce the
dilute ghost algebra, an analogous two-boundary generalisation of the dilute TL
algebra. We then present loop models associated with these algebras, and
classify solutions to their boundary Yang-Baxter equations, given existing
solutions to the Yang-Baxter equations for the TL and dilute TL models. This
facilitates the construction of a one-parameter family of commuting transfer
tangles, making these models Yang-Baxter integrable.
