# Is there a *relative* moduli stack of objects functor?

Toen and Vaquie have constructed for any dg category $$\mathcal{C}$$ a stack $$\mathcal{M}_\mathcal{C}$$ parametrising objects in $$\mathcal{C}$$. Its definition is $$\mathcal{M}_\mathcal{C}(R)\ =\ \text{Maps}_{\text{dgCat}}(\text{Perf} R, \mathcal{C})$$ for $$R$$ a ring.

1. It is an Artin stack if $$\mathcal{C}$$ is of finite type.
2. The functor $$\mathcal{M}_{(-)}$$ is right adjoint to the functor taking a 1-stack $$X$$ to the dg category $$\text{Perf}(X)\subseteq \text{QCoh}(X)$$.

My question is: if $$\mathcal{C}$$ is a sheaf of categories* over a space $$B$$ (scheme, stack, prestack, ... ) can we define a space $$\mathcal{M}_{\mathcal{C}/B}\ \stackrel{?}{\to}\ B,$$ in what generality is it defined (i.e. for an arbitrary dg category $$\mathcal{C}$$ and prestack $$B$$?), and are the analogues of 1. and 2. true?

*e.g. if $$B$$ is affine this is the same thing as a dg category plus an algebra action of $$\text{QCoh}(B)$$.

Let me give the relative construction. We'll say our geometric objects are presheaves on some category $$Aff$$, and we'll denote sheaves of categories by $$2QCoh(-)$$.

There's a functor

$$P(Aff)_{/B}^{op} \to 2QCoh(B)$$

$$(f: X \to B) \mapsto Perf(X)$$ sending a presheaf over $$B$$ to a $$Perf(X)$$ viewed as a sheaf of categories over $$B$$, via $$f^*$$. One shows that this preserves limits, and the right adjoint $$M_{(-)/B}$$ is a relative moduli of objects, as a presheaf over $$B$$.

As in the absolute case we have an explicit formula

$$M_{C/B}(Spec(R) \to B) \simeq Map_{2QCoh(B)}(Perf(R), C)$$

where in the first argument on the RHS, $$Perf(R)$$ is endowed with the structure of a sheaf of categories over $$B$$ via the map $$Spec(R) \to B$$. And of course $$B= *$$ case recovers the absolute case.

I expect arguments of Antieau-Gepner about representability of moduli generalize to this relative setting, though I do not have a precise statement at the moment.

Footnote: As you do in the question statement I'm sweeping some presentability issues under the rug here to give the idea, $$2QCoh(-)$$ needs to be constructed carefully, but sounds like you know where to look for these constructions.