For you or me, it might be the recollection that one of us had put some water on to boil. For an E. coli , it is the recollection of a recently sensed concentration. But the working memory contains a version of information encoded in permanent programs. Somersaulting through three dimensions, its flagella cranking every which way, the bacterium would have a dickens of a time sensing, analyzing and figuring out which direction to take. Simplifying complicated problems is one of the hallmarks of intelligent behavior.
Intelligence has other features, one of which is the capacity to learn.
Certain molecules act as sensory stimuli for all cells of a particular strain and can trigger behavior the very first time the cell encounters them. But that's only part of the story. Some molecules become stimuli only if present while the cell is maturing. If a young bacterium does not encounter these molecules at a tender age, it will never develop the mechanisms to perceive them. Thus, bacteria operate by learning as well as by instinct.