ContentFTE
Autonomous AI Content Employee (Digital FTE) with Internal Link Knowledge Graph & Sanity Publishing
Free & Open Architecture Alternative To:
💰 Value & Cost Savings Comparison
Traditional Industry Solution
Jasper AI / SurferSEO + Dedicated Content Writers
$1,500 - $3,000 / month
This Project (By Owais Abdullah)
Free for Personal Use (Self-Hosted Open Agent Pipeline)
Save $18,000+/year on ongoing SEO content production
🎯 Pain Points Solved
Why this project was built and the operational friction it eliminates:
The Problem
Publishing 15+ SEO-optimized, thoroughly researched articles daily requires an entire agency team of researchers, copywriters, graphic designers, and CMS publishers.
The Solution
ContentFTE executes the entire publishing lifecycle autonomously: keyword queue discovery, dual-stream web research, long-form writing, image generation, and CMS publishing.
The Problem
Automated AI content often generates dead or hallucinated links and neglects site-wide link architecture, hurting search engine crawlability.
The Solution
Built-in Internal Link Knowledge Graph queries existing Sanity CMS articles via GROQ, matching relevant categories to inject real, contextual internal links with zero dead URLs.
The Problem
AI image generators on commercial plans cost $20–$50/month and fail when credits deplete.
The Solution
Features an intelligent multi-tier visual engine: primary generation on Cloudflare Workers AI (10,000 free neurons/day) with automatic failover to Pexels stock photos.
The Problem
Publishing unreviewed AI drafts directly to production risks brand reputation and factual inaccuracies.
The Solution
Integrated Discord bot delivers interactive approval cards to your private Discord channel, letting you review drafts and approve publishing with a single reaction.
⚡ Core Capabilities & Architecture
Built with Python 3.12 and the OpenAI Agents SDK. A central GitHub Actions workflow orchestrates stages: Triage Agent selects keywords from Google Sheets (or discovers trending topics via Tavily when the queue is empty); Researcher Agent extracts live web data; Brief Agent formulates the structural outline; Writer Agent produces 1500–2500 words with schema FAQs; SanityAdapter resolves categories, injects internal links from existing CMS posts, uploads generated Cloudflare FLUX.2 [dev] visuals, and publishes the finished post to Sanity CMS.
- ✔Semantic Internal Link Knowledge Graph: Actively queries Sanity via GROQ to fetch existing relevant posts and inject natural contextual hyperlinks into new drafts
- ✔Multi-Agent Architecture: Autonomous pipeline coordinating Triage, Researcher, Content Brief, Writer, Evaluation, and Sanity Posting agents
- ✔Google Search Console Integration: Pulls search performance analytics to prioritize underperforming URLs for automated refresh and optimization
- ✔Multi-Tier Visual Engine: Generates featured and inline visuals using Cloudflare Workers AI FLUX.2 [dev] with instant fallback to Pexels stock photography
- ✔Discord Human-in-the-Loop: Review generated titles, summaries, and Markdown drafts in private Discord channels with interactive ✅ reaction approvals
- ✔Anti-AI-Pattern Editorial Engine: Enforces strict style guidelines eliminating em dashes, robotic transitions, and filler phrases for natural human cadence
🛠️ How to Setup & Run Locally
Quick-start guide to clone, configure, and execute this project in your own environment:
Prerequisites
- Python 3.12+ with uv package manager
- Google Cloud Service Account JSON credentials (with Google Sheets & Drive API enabled)
- Sanity.io Project ID, Dataset name, and Write Token
- Google Gemini API Key or OpenRouter API Key
- Tavily Search API Key for web research
- Discord Bot Token and Webhook URL (for approval notifications)
Key Environment Variables (.env)
| Variable | Description | Example / Format |
|---|---|---|
| GEMINI_API_KEY | Primary LLM key for agent drafting and evaluation | AIzaSy... |
| OPENROUTER_API_KEY | Fallback LLM router (openrouter/free & DeepSeek tiers) | sk-or-v1-... |
| GOOGLE_CREDENTIALS | Single-line JSON string of Google Service Account credentials | {"type":"service_account",...} |
| TAVILY_API_KEY | Search engine API key for live web and citation research | tvly-dev-... |
| SANITY_PROJECT_ID | Your Sanity CMS project identifier | y2wkvags |
| SANITY_API_TOKEN | Sanity API token with Editor (write) permissions | skxSO... |
| SANITY_DATASET | Target Sanity dataset name | production |
| CLOUDFLARE_ACCOUNT_ID | Cloudflare Account ID for free FLUX.2 [dev] image generation | 86a1be327... |
| CLOUDFLARE_API_TOKEN | Cloudflare API token with Workers AI:Edit permissions | cfut_... |
| DISCORD_WEBHOOK_URL | Discord channel webhook for approval notifications | https://discord.com/api/webhooks/... |
Execution Steps
1.Clone the repository
git clone https://github.com/MrOwaisAbdullah/ContentFTE.git
cd ContentFTE2.Install dependencies using uv
uv syncThis automatically provisions and manages .venv directly from pyproject.toml.
3.Configure environment variables
cp .env.example .envPopulate .env with your Google Service Account JSON, Gemini/OpenRouter keys, Tavily key, and Sanity tokens.
4.Configure Google Sheets Database
Create two spreadsheets: 'ContentSpark_Keywords' (with Keyword and Status columns) and 'ContentSpark' (with research_data, content_briefs, generated_posts, approved_unpublished, and published_posts worksheets) and share both with your service account email as Editor.
5.Run the full pipeline locally or trigger via GitHub Actions
uv run python scripts/run_stage.py --stage allCan also be scheduled continuously using .github/workflows/pipeline.yml or managed via the Discord bot.
🗺️ Project Roadmap & Planned Improvements
Current release progress and planned future enhancements:
Internal Link Knowledge Graph
Live semantic article graph scanning Sanity CMS via GROQ to auto-inject relevant contextual internal links into new posts.
YouTube-to-Article Video Pipeline
Extract video transcripts and timestamps via AssemblyAI and YouTube APIs to repurpose video content into formatted SEO blog posts.
Multi-Language Auto-Localization
Translate and culturally adapt generated articles into Spanish, Arabic, and German with localized schema markup.
License, Fair Use & Attribution Terms
Creative Commons Attribution-NonCommercial 4.0 (CC BY-NC 4.0)
Free for personal, educational, and non-commercial research use with mandatory attribution to Owais Abdullah. Packaging into paid agency client deliverables or commercial SaaS resale requires authorization.