DEV Community

Achyut Srivastava
Achyut Srivastava

Posted on Originally published at luxurai.in

Building an Autonomous Zero-Cost AI SEO & Multi-Platform Distribution Engine: Architecture, Free Model Routing, and Open-Source Code

Building an Autonomous Zero-Cost AI SEO & Multi-Platform Distribution Engine

Architecture, Free Model Routing, and Open-Source Blueprint

Authors:

  • πŸš€ Achyut Srivastava β€” Founder & Lead Architect (Age 14), LuxurAI
  • 🀝 Shubham Dangi β€” Co-Founder (Age 15), LuxurAI
  • 🌐 Official Platform: LuxurAI (https://luxurai.in)

[!IMPORTANT]
Legal Notice & Intellectual Property:

Β© 2026 Achyut Srivastava (Founder, LuxurAI). All Rights Reserved.

This whitepaper, its architectural concepts, and research materials are the proprietary intellectual property of Achyut Srivastava and LuxurAI. Unauthorized reproduction, resale, or distribution of this text is strictly prohibited.

Open-Source Code License:

All accompanying Python scripts and architectural source code contained herein are licensed under the Apache License, Version 2.0. You may freely use, modify, and distribute the code provided proper copyright attribution to Achyut Srivastava / LuxurAI is preserved.


1. The Problem: The High Cost of Distribution

For solo developers and bootstrapped startups, writing code is only half the battle. Distribution, social discovery signals, and search engine visibility (SEO) are where 90% of great projects die.

Traditional approaches fail:

  • SEO & Social Agencies: Cost $1,500–$3,000/month for generic, non-technical posts.
  • Manual Cross-Posting: Takes 10–15 hours every week away from core product engineering.
  • Paid Search Ads: Completely unsustainable for bootstrapped builders without VC backing.

At LuxurAI, we solved this by designing and deploying an Autonomous Multi-Platform Distribution & SEO Engine that runs 24/7 on a Linux server. It writes authentic engineering deep-dives, routes through 100% free AI models, attaches high-res dynamic tech imagery, and publishes across Dev.to, Hashnode, Instagram, and Threads with canonical backlinks pointing to our primary domain.

Here is the complete architectural breakdown and open-source implementation.


2. System Architecture: The Memory & Multi-Platform Loop

Our engine runs on a lightweight, rock-solid 3-component architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    AUTONOMOUS DISTRIBUTION & SEO ENGINE                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 1. about_company.txt     β”‚ Brand & Technical Source of Truth                β”‚
β”‚ 2. posted.txt            β”‚ Negative History & Anti-Duplication Memory       β”‚
β”‚ 3. Free Model Router     β”‚ OpenRouter Free Tier (Llama-3.3-70B / Gemini)    β”‚
β”‚ 4. Dynamic Image Sourcingβ”‚ Unsplash High-Res CDN Keyword Matcher            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚                               β”‚
             β–Ό                               β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ LONG-FORM TECHNICAL SEO β”‚     β”‚ SHORT-FORM SOCIAL LOOPS β”‚
    β”‚ β”œβ”€ Dev.to (DA 91)       β”‚     β”‚ β”œβ”€ Instagram Graph API  β”‚
    β”‚ └─ Hashnode (DA 87)     β”‚     β”‚ └─ Threads Graph API    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚                               β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚ https://luxurai.in    β”‚
                     β”‚ (100% Authority Boost)β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

Component 1: about_company.txt (The Knowledge Grounding)

A structured markdown/text file containing your exact brand facts, architecture, pricing (e.g. 1 Credit = β‚Ή0.25), founding team, and active beta features. This prevents the LLM from hallucinating fake claims or generic fluff.

Component 2: posted.txt (The Anti-Duplication Memory)

Every time a post is published, its topic, title, and timestamp are appended to posted.txt. When generating the next post, the last 10 entries are injected into the prompt as a negative constraint so topics never repeat.

Component 3: The Canonical Backlink & Social Discovery Pipe

Articles on Dev.to and Hashnode attach canonical_url: "https://yourdomain.com" to pass 100% domain authority to your site, while automated posts to Instagram and Threads trigger live social discovery crawlers.


3. Where & How to Access 100% Free AI Models

You do not need an expensive OpenAI or Anthropic API subscription to run this engine. You can leverage OpenRouter's Free Model Tier:

Top Free Models for Technical Writing:

  1. meta-llama/llama-3.3-70b-instruct:free β€” Exceptional technical reasoning and clean code output.
  2. google/gemini-2.0-flash-exp:free β€” Fast response times and large context windows.
  3. openrouter/free β€” Automatic dynamic routing across all currently available free endpoints.

The Secret: Strict JSON Schema + Low Temperature

Free models can occasionally add conversational chatter. To force clean, structured output, configure:

  • Temperature: 0.2 to 0.3 (for deterministic, factual writing).
  • Format: response_format: {"type": "json_object"}.

4. Attaching High-Res Images Dynamically (Unsplash API)

Both Instagram and Threads require a direct, publicly accessible image URL (https://...). You cannot upload raw file bytes directly in standard automated graph calls.

The AI outputs a 3-word visual keyword (e.g., "developer coding dark mode"), and the script fetches a high-res image from Unsplash:

# Copyright 2026 Achyut Srivastava / LuxurAI (https://luxurai.in)
# Licensed under the Apache License, Version 2.0

import os
import requests

def get_dynamic_tech_image(search_query: str) -> str:
    """Fetches a relevant high-resolution tech image URL from Unsplash."""
    UNSPLASH_ACCESS_KEY = os.getenv("UNSPLASH_ACCESS_KEY")
    url = f"https://api.unsplash.com/photos/random?query={search_query}&orientation=landscape"
    headers = {"Authorization": f"Client-ID {UNSPLASH_ACCESS_KEY}"}

    try:
        res = requests.get(url, headers=headers, timeout=10)
        if res.status_code == 200:
            data = res.json()
            return data["urls"]["regular"]
    except Exception as e:
        print(f"Warning: Image fetch fallback used ({e})")

    # Fallback curated tech wallpaper
    return "https://images.unsplash.com/photo-1555066931-4365d14bab8c"
Enter fullscreen mode Exit fullscreen mode

5. The 2-Step Container Flow (Instagram & Threads API)

Meta's Graph API requires a 2-Step Media Container Architecture for both Instagram and Threads:

  1. Step 1 (Create Container): Send the image_url and caption/text to generate a temporary creation_id.
  2. Step 2 (Publish Container): Commit the creation_id to publish the post live to the feed.

Instagram Graph API Publisher:

# Copyright 2026 Achyut Srivastava / LuxurAI (https://luxurai.in)
# Licensed under the Apache License, Version 2.0

def publish_to_instagram(image_url: str, caption: str):
    IG_USER_ID = os.getenv("INSTAGRAM_USER_ID")
    IG_TOKEN = os.getenv("INSTAGRAM_ACCESS_TOKEN")

    # Step 1: Create Media Container
    container_url = f"https://graph.facebook.com/v21.0/{IG_USER_ID}/media"
    payload = {
        "image_url": image_url,
        "caption": caption,
        "access_token": IG_TOKEN
    }
    res = requests.post(container_url, data=payload, timeout=20)
    res.raise_for_status()
    creation_id = res.json().get("id")

    # Step 2: Publish Container
    publish_url = f"https://graph.facebook.com/v21.0/{IG_USER_ID}/media_publish"
    pub_payload = {
        "creation_id": creation_id,
        "access_token": IG_TOKEN
    }
    pub_res = requests.post(publish_url, data=pub_payload, timeout=20)
    pub_res.raise_for_status()
    print(f"βœ… Published to Instagram! Post ID: {pub_res.json().get('id')}")
Enter fullscreen mode Exit fullscreen mode

Threads Graph API Publisher:

# Copyright 2026 Achyut Srivastava / LuxurAI (https://luxurai.in)
# Licensed under the Apache License, Version 2.0

import time

def publish_to_threads(image_url: str, text_content: str):
    THREADS_USER_ID = os.getenv("THREADS_USER_ID")
    THREADS_TOKEN = os.getenv("THREADS_ACCESS_TOKEN")

    # Step 1: Create Threads Media Container
    container_url = f"https://graph.threads.net/v1.0/{THREADS_USER_ID}/threads"
    payload = {
        "media_type": "IMAGE",
        "image_url": image_url,
        "text": text_content,
        "access_token": THREADS_TOKEN
    }
    res = requests.post(container_url, data=payload, timeout=20)
    res.raise_for_status()
    creation_id = res.json().get("id")

    # Wait 3 seconds for Meta container processing
    time.sleep(3)

    # Step 2: Publish Threads Container
    publish_url = f"https://graph.threads.net/v1.0/{THREADS_USER_ID}/threads_publish"
    pub_payload = {
        "creation_id": creation_id,
        "access_token": THREADS_TOKEN
    }
    pub_res = requests.post(publish_url, data=pub_payload, timeout=20)
    pub_res.raise_for_status()
    print(f"βœ… Published to Threads! Post ID: {pub_res.json().get('id')}")
Enter fullscreen mode Exit fullscreen mode

6. Complete Master Python Blueprint (All-In-One)

Here is the complete orchestrator connecting OpenRouter Free AI, Dev.to canonical publishing, Unsplash images, Instagram, and Threads:

# Copyright 2026 Achyut Srivastava / LuxurAI (https://luxurai.in)
# Licensed under the Apache License, Version 2.0

import os
import json
import time
import requests
import datetime

# --- Environment Variables (Zero Hardcoded Credentials) ---
OPENROUTER_API_KEY = os.getenv("OPENROUTER_API_KEY")
DEVTO_API_KEY = os.getenv("DEVTO_API_KEY")
IG_USER_ID = os.getenv("INSTAGRAM_USER_ID")
IG_TOKEN = os.getenv("INSTAGRAM_ACCESS_TOKEN")
THREADS_USER_ID = os.getenv("THREADS_USER_ID")
THREADS_TOKEN = os.getenv("THREADS_ACCESS_TOKEN")
UNSPLASH_KEY = os.getenv("UNSPLASH_ACCESS_KEY")
CANONICAL_DOMAIN = os.getenv("CANONICAL_DOMAIN", "https://luxurai.in/paper/autonomous-ai-seo-engine")

ABOUT_FILE = "about_company.txt"
HISTORY_FILE = "posted.txt"

def load_context():
    with open(ABOUT_FILE, "r", encoding="utf-8") as f:
        brand_context = f.read()

    history = []
    if os.path.exists(HISTORY_FILE):
        with open(HISTORY_FILE, "r", encoding="utf-8") as f:
            history = [line.strip() for line in f.readlines() if line.strip()][-10:]

    return brand_context, "\n".join(history)

def generate_multiplatform_content(brand_context, recent_history):
    prompt = f"""
BRAND KNOWLEDGE BASE:
----------------------------------------
{brand_context}
----------------------------------------

RECENT TOPICS (DO NOT REPEAT):
----------------------------------------
{recent_history}
----------------------------------------

TASK:
Generate a synchronized technical release:
1. Full Dev.to Markdown engineering article.
2. Instagram caption with bullet points, founder tag, and hashtags.
3. Punchy Threads post under 400 characters ending with hashtags.
4. A 3-word Unsplash search query.

Return ONLY a valid JSON object:
{{
  "devto_title": "<Article title under 90 chars>",
  "devto_body": "<Full Markdown article with headers & code snippets>",
  "devto_tags": ["ai", "python", "webdev", "showdev"],
  "instagram_caption": "<Hook, tech bullets, founder note, and hashtags>",
  "threads_content": "<Conversational post + https://luxurai.in + hashtags>",
  "image_query": "software developer dark mode setup"
}}
"""

    headers = {
        "Authorization": f"Bearer {OPENROUTER_API_KEY}",
        "Content-Type": "application/json"
    }

    payload = {
        "model": "meta-llama/llama-3.3-70b-instruct:free",
        "messages": [
            {"role": "system", "content": "You are a senior build-in-public engineer. Return strict JSON only."},
            {"role": "user", "content": prompt}
        ],
        "temperature": 0.3,
        "response_format": {"type": "json_object"}
    }

    res = requests.post("https://openrouter.ai/api/v1/chat/completions", headers=headers, json=payload, timeout=90)
    res.raise_for_status()
    return json.loads(res.json()["choices"][0]["message"]["content"])

def publish_to_devto(article_data):
    headers = {"api-key": DEVTO_API_KEY, "Content-Type": "application/json"}
    payload = {
        "article": {
            "title": article_data["devto_title"],
            "body_markdown": article_data["devto_body"],
            "tags": article_data.get("devto_tags", ["ai", "python", "showdev"]),
            "canonical_url": CANONICAL_DOMAIN,
            "published": True
        }
    }
    res = requests.post("https://dev.to/api/articles", headers=headers, json=payload, timeout=30)
    res.raise_for_status()
    print(f"βœ… Published to Dev.to: {res.json().get('url')}")

def record_history(title):
    timestamp = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M UTC")
    with open(HISTORY_FILE, "a", encoding="utf-8") as f:
        f.write(f"[{timestamp}] {title}\n")

if __name__ == "__main__":
    print("πŸš€ Running Autonomous Distribution & SEO Engine...")
    context, history = load_context()
    data = generate_multiplatform_content(context, history)

    print(f"πŸ“ Generated Topic: {data['devto_title']}")

    if DEVTO_API_KEY:
        publish_to_devto(data)

    image_url = get_dynamic_tech_image(data.get("image_query", "developer code"))

    if IG_TOKEN and IG_USER_ID:
        publish_to_instagram(image_url, data["instagram_caption"])

    if THREADS_TOKEN and THREADS_USER_ID:
        publish_to_threads(image_url, data["threads_content"])

    record_history(data["devto_title"])
    print("πŸŽ‰ All platforms published and memory log updated!")
Enter fullscreen mode Exit fullscreen mode

7. Running 24/7 on $0 Infrastructure

To make this fully autonomous, deploy it on a lightweight Linux VPS systemd timer:

Create /etc/systemd/system/seo-poster.timer:

[Unit]
Description=Run Autonomous SEO Poster 4x Daily

[Timer]
OnCalendar=*-*-* 03,09,15,21:00:00
Persistent=true

[Install]
WantedBy=timers.target
Enter fullscreen mode Exit fullscreen mode

Enable and start:

sudo systemctl daemon-reload
sudo systemctl enable --now seo-poster.timer
Enter fullscreen mode Exit fullscreen mode

8. Key Results & Impact

  1. Instant Googlebot Discovery: Google crawls high-DA networks like Dev.to, Threads, and Instagram multiple times per hour. New features get indexed within 2–6 hours.
  2. 100% White-Hat Backlink Power: Using canonical_url ensures no duplicate content penalties while passing authentic authority directly to your business domain.
  3. True Bootstrapped Freedom: Zero monthly agency fees, zero paid API costs, and 100% consistency.

🌐 About LuxurAI

LuxurAI is an autonomous AI ecosystem engineered in India by Founder Achyut Srivastava (Age 14) and Co-Founder Shubham Dangi (Age 15). Built to make luxury AI accessible at just β‚Ή0.25 per credit ($0 VC funding, 100% bootstrapped), LuxurAI features autonomous coding agents, desktop coworkers, and zero-handoff UI generators.

Top comments (0)