% !Mode:: "TeX:UTF-8"
% !TEX encoding = UTF-8 Unicode

\begin{center}
  \begin{tikzpicture}[remember picture]
    \tikzset {
      block/.style={draw,inner sep=0pt,fill=white, minimum width=5cm, minimum height=1.5cm, align=center},
      miniblock/.style={draw,inner sep=0pt,fill=white, minimum width=1.5cm, minimum height=.8cm, align=center, rounded corners=2pt, text width=1.4cm},
      linetext/.style={fill=#1, minimum height=1.5pt, minimum width=.8cm, inner sep=0},
    }
    \def\sep{1cm}
    \def\ssep{1cm}
    \begin{scope}
      \node [block, anchor=north] (b1) at (0,0) {\footnotesize{Experience Collecting}};
      \node [block, anchor=north] (b2) at ([yshift=-\sep]b1.south) {\footnotesize{Skill Generation}};
      \node [block, anchor=north] (b3) at ([yshift=-\sep]b2.south) {\footnotesize{Skill Bank}};
      \node [block, anchor=north] (b4) at ([yshift=-\sep]b3.south) {\footnotesize{Skill-Augmented RL Training}};
      \node [block, anchor=north] (b5) at ([yshift=-\sep]b4.south) {\footnotesize{Recursive Skill Evolution}};

      % \node [anchor=south] (b6) at ([yshift=\sep]b5.north) {\LARGE{$\cdots$}};
      \draw [->] (b1.south) -- (b2.north);
      \draw [->] (b2.south) -- (b3.north);
      \draw [->] (b3.south) -- (b4.north);
      \draw [->] (b4.south) -- (b5.north);
      % \draw [->] (b5.north) -- (b6.south);

      \scriptsize
      \node [anchor=north west, text width=7.6cm] (n1) at ([xshift=\ssep]b1.north east) {Collect interaction trajectories from the enrionment.\\};
      \node [anchor=north west, text width=3.5cm,draw,rounded corners,minimum height=1.5cm] (n12) at ([yshift=-0.1cm]n1.south west) {} ;
      \node [anchor=west, text width=3.5cm,draw,rounded corners,minimum height=1.5cm] (n13) at ([xshift=0.3cm]n12.east) {} ;

      \draw [dashed] ([xshift=0.8cm,yshift=0.1cm]b2.north east) -- ([xshift=9cm,yshift=0.1cm]b2.north east);
      \node [anchor=north west, text width=7.6cm] (n2) at ([xshift=\ssep]b2.north east) {Generate reusable skills from experiences.\\};
      \node [anchor=north west, text width=] (n21) at (n2.south west) {Successful trajectories};
      \node [anchor=west, text width=] (n22) at ([xshift=.2cm]n21.east) {$\rightarrow$~~Skill Principles};
      \node [anchor=north west, text width=] (n23) at (n21.south west) {Failed trajectories};
      \node [anchor=north west, text width=] (n24) at (n22.south west) {$\rightarrow$~~Failed Lessons};

      \draw [dashed] ([xshift=0.8cm,yshift=0.1cm]b3.north east) -- ([xshift=9cm,yshift=0.1cm]b3.north east);
      \node [anchor=north west, text width=7.6cm] (n3) at ([xshift=\ssep]b3.north east) {Construct a hierarchical skill library.};
      \node [anchor=north west, text width=7.6cm,draw,rounded corners,minimum height=0.8cm,align=left] (n31) at (n3.south west) {};
      \node [anchor=west,text width=3cm,align=center] (n311) at ([xshift=0.2cm]n31.west) {\textbf{\small{General Skills}}};
      \node [anchor=west,text width=4cm,align=left] (n312) at ([xshift=0.2cm]n311.east) {bla bla bla bla bla bla bla bla bla bla bla bla bla bla  };
      \node [anchor=north west, text width=7.6cm,draw,rounded corners,minimum height=0.8cm,align=left] (n32) at ([yshift=-0.1cm]n31.south west) {};
      \node [anchor=west,text width=3cm,align=center] (n321) at ([xshift=0.2cm]n32.west) {\textbf{\small{Task-specific Skils}}};
      \node [anchor=west,text width=4cm,align=left] (n322) at ([xshift=0.2cm]n321.east) {bla bla bla bla bla bla bla bla bla bla bla bla bla bla  };
      \draw [decorate,decoration={brace,mirror,raise=5pt,amplitude=6pt}] (n31.north west) -- (n32.south west);

      \draw [dashed] ([xshift=0.8cm,yshift=0.1cm]b4.north east) -- ([xshift=9cm,yshift=0.1cm]b4.north east);
      \node [anchor=north west, text width=7.6cm,align=left] (n4) at ([xshift=\ssep]b4.north east) {Retrieve relevant skills then provide retrieved skills to the agent.
        Optimize the skill-augmented policy with RL.};
      \draw ([yshift=-0.1cm]n4.south west) node (n41) [anchor=north west, text width=1.2cm,draw,rounded corners,minimum height=0.8cm,align=center] {Task}
      ([xshift=0.8cm]n41.east) node (n42) [anchor=west, text width=1.2cm,draw,rounded corners,minimum height=0.8cm,align=center] {Retrieve \\ Skills}
      ([xshift=0.8cm]n42.east) node (n43) [anchor=west, text width=1.2cm,draw,rounded corners,minimum height=0.8cm,align=center] {Agent}
      ([xshift=0.8cm]n43.east) node (n44) [anchor=west, text width=1.2cm,draw,rounded corners,minimum height=0.8cm,align=center] {Reward};
      \draw[->] (n41.east) -- (n42.west);
      \draw[->] (n42.east) -- (n43.west);
      \draw[->] (n43.east) -- (n44.west);

      \draw [dashed] ([xshift=0.8cm,yshift=0.1cm]b5.north east) -- ([xshift=9cm,yshift=0.1cm]b5.north east);
      \node [anchor=north west, text width=7.6cm,align=left] (n5) at ([xshift=\ssep]b5.north east) {Analyze failure trajectories during training.
        Generate new skills or refine existing skills.};
      \node [anchor=north west, text width=6cm,draw,dashed,rounded corners,minimum height=1cm,align=left] (n51) at (n5.south west) {};
      \node [anchor=west,text width=2cm,align=center] (n52) at ([xshift=0.2cm]n51.west) {\textbf{\small{Outcome}}};
      \path (n52.east) node(n53) [anchor=west, text width=1.3cm,draw,rounded corners,minimum height=0.6cm,align=center] {new skill}
      ([xshift=0.5cm]n53.east) node(n54) [anchor=west, text width=1.3cm,draw,rounded corners,minimum height=0.6cm,align=center] {old skill};
      \draw ([xshift=0.1cm]n53.south east) -- ([xshift=-0.1cm]n54.north west);
    \end{scope}
  \end{tikzpicture}
\end{center}
