Will mindfulness help me in observing patterns and learning to keep away from a toxic person? I have started mindfulness from past 3 days and am experiencing reduced anxiety.

I have allocated a half an hour time at 9 PM to reflect on the thoughts which may have occurred to me during the day time.
So, during the day time I do NOT dwell on the past emotions. I question myself is there a problem to be solved or the thought is only about feeling bad or good. If there is a problem to be solved, then I solve it otherwise I list the thought in a diary to reflect on it in the night.

Since mindfulness is always about being in present, my fear is that with this attitude I may forget how the person x behaved with me in the past and I may allow the bad/toxic behavior to continue.

I want to learn from the past mistakes, I also want to remember what wrongs did the person x do to me - is there a pattern in them, so that I keep that toxic person away from me.

Will mindfulness help or allow me to recognize patterns and learn from them?
Good practical question.

First of all, I have to tell you, in (Mahayana) Buddhism there is no such thing as a "toxic person". The other person has impulses and reactions because of their own bad past experiences, and something in you triggers them. Doesn't mean you are bad or s\he is bad, it is just inertia from the past.

If you really think about it, there is no "you" and "other person", there is just a dynamic process of interaction between the two sets of past experiences, from which emerge new behaviors, whether healthy or pathological.

What you call mindfulness allows you (me, us) to suspend our typical impulses informed by the past and act with a new, fresh perspective. When you dance your part differently, the other participants can't help but alter their dance as well. Remember, they are not really choosing how to act, most people don't, but when you change, you create a new setting in which their impulses play out.

That's for one, and second, in Mahayana Buddhism we do not worry so much about protecting ourselves. Protection is an instinct of the ego, which is always vulnerable. To make the ego invincible one has to become a kind of demon, wearing a steel-strong-shell, never showing true feelings, always taking care of oneself at the expense of others. In Mahayana we go the opposite way. We open up and have nothing to protect. When we have nothing to protect we are invincible in a different way, and this way to be invincible is actually stronger than the first.

It's a very different attitude to what you are used in the normal world, takes a while to get used to.