stream of consciousness

noun
  1. 1

    The continuous flow of thoughts that makes up an individual's conscious experience.

  2. 2

    A literary device that seeks to describe this process by means of a long, unstructured soliloquy.

Source: https://en.wiktionary.org/wiki/stream%20of%20consciousness