AI + QA

We Built an AI Agent That Runs Social Media Autonomously

April 25, 2026 · 5 min read

Most “AI social media tools” are glorified template fillers. You give them a topic, they spit out a post, you edit it, you schedule it. The AI does the easy part and you still do all the thinking.

We wanted to build something different — an AI agent that actually thinks. One that researches what’s happening in your industry before writing anything, remembers what it’s already posted, learns from posts you reject, and handles the entire pipeline from strategy to publishing. Humans only step in to approve or reject. Everything else is autonomous.

Here’s how we built it and what we learned.

Why agents, not just prompts

A prompt-based approach to social media content is stateless. Every time you ask an LLM to write a post, it starts from zero — no memory of what you’ve published before, no awareness of what’s trending, no understanding of what performed well or what got rejected.

An agentic approach changes this fundamentally. The AI doesn’t just generate text — it reasons about what to do, executes actions (search the web, query a database, generate an image), observes the results, and decides what to do next. It’s a loop, not a one-shot.

We used a custom ReAct (Reason + Act) pattern. At each step, the agent produces a thought explaining its reasoning, decides which tool to call, observes the result, and then thinks again. This creates a transparent chain of decisions that you can audit and understand.

The 15-tool toolkit

The agent’s power comes from its tools. We built 15 specialized tools that the agent can invoke autonomously based on what the task requires:

Research tools — web search for industry trends, competitor analysis, and news. The agent doesn’t write about topics blindly — it checks what’s actually happening first.

Memory tools — topic history (what has been posted before), rejection memory (what got rejected and why), and case study database (company-specific examples to reference). The agent learns from every interaction.

Content tools — platform-specific post generation (adjusting tone, length, hashtags, and CTAs for each platform), self-critique (the agent reviews its own drafts against quality criteria), and revision (rewrites weak posts before they reach the approval stage).

Visual tools — branded image generation using Python’s Pillow library with multiple visual styles per content type. The agent picks the right visual treatment based on whether the post is educational, promotional, or thought leadership.

Publishing tools — LinkedIn auto-publishing via Playwright browser automation, approval email dispatch with one-click approve/reject buttons, and scheduling.

The weekly rhythm

Here’s what a typical week looks like with the agent running:

Monday: The agent searches for industry trends, reads its posting history, checks rejection memory, and writes a strategy memo explaining what it plans to post and why. This memo goes to the human stakeholder for review — not for approval of individual posts, but to sanity-check the overall direction.

Throughout the week: The agent generates posts according to the strategy, creates branded visuals, self-critiques each draft, and sends approval emails. Approved posts get auto-published to LinkedIn at optimal times. Rejected posts get logged with the rejection reason, and the agent adjusts future content accordingly.

What we learned building it

Self-critique dramatically improves quality. Before we added the self-critique step, roughly 30% of generated posts were rejected by the human approver. After adding a step where the agent evaluates its own draft against criteria (relevance, originality, CTA clarity, tone match), the rejection rate dropped below 10%. The agent catches most of its own weak posts before a human ever sees them.

Rejection memory is the secret weapon. When a human rejects a post and provides a reason — “too salesy”, “we covered this last week”, “wrong tone for this audience” — that feedback gets stored. The agent queries this memory before generating new posts. Over weeks, the agent’s output converges toward what the organization actually wants, without ever being explicitly programmed with style rules.

Observability is non-negotiable. An autonomous agent making decisions about your public brand presence needs full transparency. Every tool call, every reasoning step, every decision is logged to the database and visible through a dashboard. When a post goes out, you can trace exactly why the agent chose that topic, what research informed it, and what alternatives it considered.

Browser automation for publishing is fragile but worth it. Using Playwright to auto-publish to LinkedIn is inherently brittle — LinkedIn changes their UI, sessions expire, selectors break. We built it with circuit breaker patterns and human fallback: if the auto-publish fails, it queues the post and sends a manual-publish link instead of retrying blindly.

The tech stack

The agent runs on Node.js with Express, using PostgreSQL and Prisma for persistent state (posting history, rejection memory, strategy memos, tool call logs). Content generation uses the Claude API. Image generation runs through a Python service using Pillow for template-based branded graphics with FFmpeg for any video processing. LinkedIn publishing uses Playwright for browser automation.

The entire system was built using AI-assisted development — the same approach we use for all our internal tools. Architecture designed through iterative prompting, each component built and tested incrementally.

Who is this for

This isn’t for companies that post once a month. It’s for organizations that need consistent, high-quality social media presence but don’t have (or don’t want) a full-time social media manager. The agent handles the volume and consistency; the human provides strategic direction and final approval.

The pattern is generalizable beyond social media. Any workflow that follows “research → decide → create → review → publish” can be built as an agentic system. We’re seeing the same architecture apply to report generation, compliance document drafting, and customer communication.

  • Agentic AI
  • AI-Assisted Development
  • Automation
  • ReAct Pattern
  • Social Media

Building something that has to hold up?

Bring the process, not a specification. We will tell you honestly whether an agent is the right answer.