EN中文

Project / ai

Auto Agent in Threads

A 2024 experiment in a scheduled agent that drafts Cantonese Threads posts and images, then publishes through the Threads API.

AgentsLLMAutomation
Auto Agent in Threads cover from the workbench archive

Auto Agent in Threads is a 2024 portfolio experiment: an agent that can draft social posts and publish them on Threads. The public repository is AutoThreads, a Python Poetry project. The live posting path on the feb_dev branch loads a ComfyUI workflow, writes an image prompt, hosts a JPEG, and calls the Threads Graph API (create, then publish).

The earlier README path is still in the repo: SerpAPI reads Hong Kong Google Trends and news, LangChain writes short copy, and Prefect is meant to run on a schedule. The current text prompt tells the model to write 10–20 characters of Hong Kong Cantonese, avoid copying headlines, skip negative slang, and invite a reply. Image prompts describe a named persona used for the feed. Those rules are the documented editorial layer — there is no separate human-approval screen in the code. Measured reach is not recorded in the repository.

Stack visible in the repo: LangChain with OpenAI-compatible chat models, SerpAPI, Prefect (yiying_threads_flow, randomized interval), ComfyUI/Flux workflows, Cloudinary for image URLs, and the official Threads API. Outcomes after verification still belong in a later update, not here.