\usetikzlibrary{fit,backgrounds}

\begin{figure}[!t]
\centering
\begin{tikzpicture}
    % Nodes
    \node[circle, draw, fill=fullQueryNode] (theta) {$\theta$};
    \node[circle, draw, below of=theta, yshift=-0.4cm, fill=partialQueryNode] (q) {$q$};
    \node[circle, draw, below of=q,yshift=-0.5cm,fill=llmNode] (a) {$a$};
    \node[circle, draw, right of=a, xshift=1.5cm, fill=partialQResponseNode] (o) {$o$};
    
    % Edges
    % \faUser
    \draw[->] (theta) -- node[left] {\faUser} (q); %\textcolor{brainColor}{\faBrain}} (q); % Red color
    %\draw[->] (theta) -- node[left] {\emoji{brain}} (q); % Red color
    \draw[->] (q) -- node[left] {$\pi$} (a); %{$\pi^{\textcolor{blue}{p}}$} (a);
    % \draw[->, out=-45, in=-135] (a) to[out=-45, in=-135] node[below] {\textcolor{brainColor}{\faBrain}} (o);
    \draw[->, out=-45, in=-135] (a) to[out=-45, in=-135] node[below] {\faUser} (o);
    % \draw[->, out=-45, in=-135] (a) to[out=-45, in=-135] node[below] {\emoji{brain}} (o);
    \draw[->, out=135, in=45] (o) to[out=135, in=45] node[above] {$\pi^{\textcolor{blue}{p}}$} (a);

    % Background box
    \begin{scope}[on background layer]
      \node[fit=(q) (a) (o), draw, inner sep=10pt+1.5mm, fill=gray!7, rounded corners, yshift=-3.5mm] (backgroundbox) {};
        \node[above right, xshift=-27mm, yshift=-7mm] at (backgroundbox.north east) {$\mathcal{C} := \querydomain \times \conversationHistoryDomain$};
    \end{scope}

     \begin{scope}[yshift=-1cm, on background layer]
            % Background box
            \node[fit=(backgroundbox), draw, inner sep=10pt+2mm, rounded corners, yshift=-5.5mm] (additionalbox) {};
            % Equation
            \node[below left, xshift=20mm, yshift=7mm] at (additionalbox.south west) {$\beta: \mathcal{C} \rightarrow \textcolor{blue}{\prompt}$};
        \end{scope}
\end{tikzpicture}
\caption{PODP plate diagram illustrating user-chatbot interactions, prompt-induced policies ($\pi^p$), and the meta-policy mapping from conversations to prompts ($\beta$).}
\label{fig:podp}
\end{figure}
