TITLE: Relative cocompletion of a category
QUESTION [9 upvotes]: $\newcommand{\k}{\mathbf k}$
$\newcommand{\A}{\mathcal A}$
$\newcommand{\B}{\mathcal B}$
$\newcommand{\C}{\mathcal C}$
I'm wondering if anyone knows a reference for the following construction: let $\k$ be a field, say, and assume for convenience everything below is $\k$-linear, and that every category is essentially small. Hereafter "right exact" means "which commutes with finite colimits".
Let $\A$ be a finitely cocomplete category, and $\B$ be an arbitrary (still $\k$-linear and essentially small) category. Suppose we are given a functor
$$
\iota :\A \longrightarrow \B$$
which I'm happy to assume essentially surjective if that helps. Define the relative $\A$-cocompletion of $\B$ to be a category $\B_\A$ equipped with a functor $\nu:\B\rightarrow \B_\A$, universal for the following properties:

$\B_\A$ is finitely cocomplete
for any finitely cocomplete $\C$, restriction along $\nu$ induces a natural equivalence between: (a) right exact functors $\B_\A \rightarrow \C$ and (b) just functors $\B \rightarrow \C $ such that the composition $\A \rightarrow \B \rightarrow \C$ is right exact.

In words, I want to complete $\B$ under finite colimit, without duplicating those already existing in the image of $\A$. If $\A$ is $Vect$ this should just be the free finite cocompletion.
Remember that the finite cocompletion of $\B$ is the full-subcategory of (linear) presheaves on $\B$ which are finite colimits of representables. I believe $\B_\A$ is then the full subcategory of that, of those presheaves having the property that their restriction along $\iota$ is representable. An example which is an inspiration for this definition is the construction of the category of modules over a monad, from the category of free modules, see e.g. https://ncatlab.org/nlab/show/Eilenberg-Moore+category#AsColimitCompletionOfKleisliCategory.
I'm in the process of checking that myself, and it's probably just formal, but I would much rather have a reference where it's done properly.

REPLY [6 votes]: This is a special case of the general construction of cocompletions that preserve existing colimits. The general statement can be found as Theorem 6.23 of Kelly's Basic Concepts of Enriched Category Theory, and more explicitly as Proposition 11.4 and Theorem 11.5 of Fiore's Enrichment and Representation Theorems for Categories of Domains and Continuous Functions (in the case of small cocompletions, though the result is easily modified to work with a class of colimits instead). In summary, for classes $\Phi, \Psi$ of colimits for which the small category $\mathbf B$ is $\Phi$-cocomplete, there is a conservative $\Psi$-cocompletion $\widehat {\mathbf B}_\Phi$ of $\mathbf B$ preserving the $\Phi$-colimits. This means that the restriction of the (restricted) Yoneda embedding $\mathbf B \to \widehat {\mathbf B}_\Phi$ is $\Phi$-cocontinuous and exhibits a bijection between $\Phi$-cocontinuous functors $\mathbf B \to \mathbf C$ into cocomplete categories $\mathbf C$, and $\Phi$- and $\Psi$-cocontinuous functors $\widehat {\mathbf B}_\Phi \to \mathbf C$. Explicitly, $\widehat {\mathbf B}_\Phi$ is the subcategory of the category of presheaves on $\mathbf B$ which are $\Psi$-colimits of representables taking $\Phi$-cocones to limiting $\Phi$-cones.
In your setting, take $\Phi$ to be the class of colimits in the image of $\iota : \mathbf A \to \mathbf B$, and take $\Psi$ to be the class of finite colimits. Then $\widehat {\mathbf B}_\Phi$ is exactly the finite cocompletion of $\mathbf B$ relative to $\iota$.