Sharing my Agent Flowchart/Pipeline

I've been working on moving our AI logic to Retool Agents so I thought I'd share the flowchart (MS Paint lol) of what we're trying to accomplish and see if anybody had any thoughts, opinions..... improvements?

I tried to organize it the best I could where the answer generation is in the bottom part and the response formatting and tools for replying to external services are on the right.... and Sanitizers/Accuracy guards are in the middle (Input Cleaner Agent, Response Cleaner Agent, Response Fact Checker)

On a random side note, does anybody happen to know how deeply nested recursive Agent calls can get? My 'Fallback' and 'Fact Checker' could both cause some really deep recursive calls under the "perfect" (un-perfect?) conditions

Have you ever used Mermaid? For fun, I screenshot your paint flow and asked ChatGPT to make it a mermaid diagram.

flowchart LR
  %% Top-level preprocessing & validation
  MA(Main Agent)
  IC(Input Cleaner Agent)
  RC(Response Cleaner Agent)
  FC(Response Fact Checker)
  RFT(Response Format Triage)
  MA --> IC --> MT(Main Triage Agent)
  MA --> RC --> FC --> RFT
  FC -. "Retry With New Input Derived from Original" .-> MA
  RFT -. "Fallback" .-> MT

  %% Main triage to specialized agents
  MT --> WSA(Web Security Agent)
  MT --> CA(Cryptocurrency Agent)
  MT --> IA(Insurance Agent)
  MT --> PRA("Personal Research Agent (Planner)")

  %% Personal Research pipeline
  PRA --> PRTA(Personal Research Task Assigner Agent)
  PRTA --> PRT(Personal Research Triage Agent)
  PRT --> PRRA(Personal Research Result Analyst)

  %% Supplemental inputs into Personal Research Triage
  RA(Research Assistant Agent) --> PRT
  CA --> PRT
  IA --> PRT
  PRA --> PRT

  %% Research Assistant tools
  RA -.-> WST(Web Search Tool)
  RA -.-> RST(Retool Storage Tool)
  RA -.-> VST1(Vector Store Tool)
  RA -.-> SST1(Semantic Search Tool)
  RA -.-> WScT(Web Scraper Tool)

  %% Agent-specific tools
  WSA -.-> UST[URL Scanner Tool]
  CA  -.-> CGT[CoinGecko API Tool]
  IA  -.-> VST2[Vector Store Tool]
  IA  -.-> SST2[Semantic Search Tool]

  %% Final response formatting & writers
  RFT --> SMRT(Social Media Response Triage)
  SMRT --> TW(Twitter - Grok - Response Writer)
  SMRT --> TG(Telegram - GPT-4.1 - Response Writer)
  SMRT --> FB(Facebook - Claude 3.5 - Response Writer)
  SMRT --> DSM(Default Social Media Response Writer)
  RFT --> ERW(Email Response Writer)
  ERW -.-> ET[(Email Tool)]
  RFT --> SRW(SMS Response Writer)
  SRW -.-> ST[(SMS Tool)]
  RFT --> BRW(Blog Response Writer)
  BRW -.-> BT[(Blog Tool)]
  RFT --> DRW(Default Response Writer)

mermaid.live example

oh neat thanks!! I only have seen it mentioned, but I never really looked into it so BIG thank you!!

1 Like