By J. D. BIERSDORFER

Q. How do I know if a Twitter account following me is a bot or a person?

A. Bots are small programs that typically perform repetitive, scripted tasks. On Twitter, they are used for a variety of purposes, including for help and harassment.

If you post a tweet and get a nearly immediate notification that a new account has replied or is following you, odds are the new follower is a bot programmed to search for posts containing certain keywords. As it searches Twitter for posts that match its keyword list, it may automatically follow or reply to the user who published it.

Taking a look at the suspected bot’s profile can also give you a clue. Accounts sporting generic-looking photos or plain “egg” avatars are often bots, as are those following hundreds of accounts — but with only a few followers of their own. Bots also tend to repeat the same message over and over, which should be evident in the profile’s timeline. Some bots even include the word “bot” in their user names.

The bot may be following you in hopes that you will follow it back and therefore be subject to spam tweets, or it may be programmed to glom onto your account if you express certain political views. Twitter recently announced new controls to block accounts without user profile photos or verified email addresses; to enable these new features, go into your account settings, select Notifications and then Advanced Filters.

A recent study by researchers at Indiana University and the University of Southern California estimates that between 9 and 15 percent of all active accounts on Twitter are bots. Twitter bots got a bad reputation after an election year filled with heated commentary and the distribution of fraudulent news stories, but not all bots are bad.

For example, certain public safety agencies use bots to automatically post alerts and information to Twitter in times of emergency. Some businesses may use automated accounts to handle basic customer service queries.