Automation Pipeline3 min read

My comment bot replied to requests and kept none of them

My Instagram auto-reply bot read every comment to decide whether to answer. Once it decided, nothing recorded what the comment had asked for. I left the reply logic alone and added a rule-based demand tag to every normal comment, logged to a file.

#comments#demand-signals#auto-reply#logging#instagram
Concept diagram: on the left, comments pass through the reply decision and vanish; on the right, the same comments get a demand tag and accumulate in a jsonl file
Reply logic stayed the same; one new line now keeps what each comment asked for.

The code already read every comment

I run a script (insta_engage.py) that auto-replies to Instagram comments. It reads each incoming comment, checks the language, decides whether to reply, and writes the reply if it does.

Once that decision was made, the comment itself was gone. If someone wrote "please make an app like this" or "why doesn't this feature work," the bot read it, decided whether to answer, and moved on. It read comments every day and kept none of what they said.

Is your automation reading an input, using it for one decision, and throwing it away?

I only noticed because I had already changed the Threads engage script first. That change pulled demand signals out of normal comments and logged them. The Instagram script has the same structure, but it didn't have that change. Each channel has its own script, so an improvement in one doesn't carry over to the other on its own.

Replying and demand are different questions

The reply logic asks, "should I answer this comment now?" The demand question is, "what does this comment want?" Both look at the same comment, but they ask different things. If the bot only has reply logic, nobody ever asks the second question.

So I scoped the fix like this:

  • Don't touch reply behavior.
  • Give every normal comment one demand tag.
  • Log the tagged results to a file so the content generation loop can read them later.

Would you go straight to an LLM classifier here, or start with rules?

The fix: five rule-based tags and one jsonl line

I started with rules. Every normal comment gets one of five tags:

  • app_request: asking for an app
  • complaint: a complaint
  • feature_request: asking for a feature
  • question: a question
  • general: everything else

Each result is appended as a line to logs/demand.jsonl. Auto-reply works the same as before. The whole change is 22 lines added and 1 removed in insta_engage.py, plus 8 test lines in test_engage_lang.py.

The reason for rules was simple. At this stage I didn't need accurate classification as much as I needed the signal to stop disappearing. Once the raw comments are saved, I can swap the classifier later and rerun it. A comment I don't save now can never be recovered.

Self-check

  • Does your automation read inputs that it uses for one decision and then drops without a record?
  • If you have the same script per channel, did an improvement to one also land in the others?
  • For the logs you saved "to analyze later," does any code actually read them today?

The honest part

All this change produced is one file and five tags. I haven't checked how accurately the rule-based tags sort comments. The commit message only says the generation loop will mine this file "later," and no code in this commit reads it. Right now the file records demand, but nothing has used it to make a decision yet. I don't know what it will end up changing.

Related