Search by

abdulkadiragoliya / content-intelligence

Abdulkadiragoliya

AI-powered Content & SEO Intelligence for Craft CMS. Audits, scoring, semantic search, and RAG knowledge assistant.

Package info

github.com/Abdulkadiragoliya/content-intelligence

Documentation

Type:craft-plugin

pkg:composer/abdulkadiragoliya/content-intelligence

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.1 2026-10-13 10:04 UTC

This package is auto-updated.

Last update: 2026-10-13 10:04:33 UTC


README

AI-powered Content & SEO Intelligence for Craft CMS

Content Intelligence is a production-grade, commercial Craft CMS 5 plugin designed to help site owners, marketers, developers, and digital agencies audit, score, optimize, semantically index, and converse with their website content.

๐ŸŒŸ Key Capabilities by Edition

๐ŸŸข Lite Edition (Free)

  • Deterministic Rules Engine: 100% offline, zero API keys required, lightning-fast.
  • Content Audit: Detects thin content (<300 words), missing titles, empty bodies, broken heading structures (missing H1, skipped levels), and stale content (>180 days).
  • SEO Audit Engine: Evaluates meta title and description lengths (Google pixel limits), missing image alt text, internal linking health, and single-H1 compliance.
  • Interactive SERP Preview: Live desktop and mobile Google search snippet preview cards with character counters and truncation warnings.
  • Automated Scoring (0โ€“100): Transparent weighting and health badges (Good, Needs Review, Critical).

๐Ÿ”ต Plus Edition ($99/yr)

  • Everything in Lite, plus:
  • AI Content Assistant (BYOK OpenAI): Bring Your Own Key architecture (supports $OPENAI_API_KEY in .env).
  • Entry Editor Slideout: Integrated seamlessly with Craft 5's native Craft.Slideout UI directly inside the entry sidebar.
  • Smart Meta Generator: One-click generation of click-worthy, SEO-optimized title tags and meta descriptions.
  • Content Improvement with Side-by-Side Diff: AI-assisted rewrites, tone optimization, clarity improvements, and HTML-preserving additions with green/red visual diff comparison.
  • FAQ Generation: Extracts common questions and generates Schema-ready FAQ pairs from entry text.
  • Executive Summaries & Alt Text: Generates concise abstracts and descriptive, accessible image alt attributes.
  • Deep AI SEO Intelligence: Single-pass semantic audit identifying search intent (informational, commercial, navigational, transactional), content depth gaps, semantic entities, and competitive differentiation opportunities.
  • Strict Human-in-the-Loop: All AI suggestions require explicit human approval and staging before being applied to Craft entries.

๐ŸŸฃ Pro Edition ($249/yr)

  • Everything in Plus, plus:
  • Intelligent Heading-Aware Chunking: Hierarchically partitions entry content into coherent ~400-word sections under document heading contexts.
  • Incremental Hash-Based Indexing: SHA-256 fingerprinting skips unchanged chunks during bulk scans (zero API cost and instant re-indexes).
  • Qdrant Vector DB Integration: REST client connecting to self-hosted Qdrant instances (http://localhost:6333) or Qdrant Cloud clusters with automatic Cosine distance collection provisioning.
  • Hybrid Search (Vector + Lexical RRF): Reciprocal Rank Fusion combining high-dimensional OpenAI embeddings (text-embedding-3-small) with MySQL fulltext keyword matching.
  • "Ask Your Website" RAG Assistant: Conversational knowledge assistant grounded strictly in your published entries with inline citations ([1], [2]), confidence scoring, and zero-hallucination guardrails.
  • Semantic Content Recommendations: Suggests related entries based on vector topic similarity for related post widgets.

๐Ÿ“‹ Requirements

  • Craft CMS ^5.0.0
  • PHP ^8.2.0
  • MySQL 8.0+ or PostgreSQL 13+
  • Optional (Plus/Pro): OpenAI API key (gpt-4o-mini, gpt-4o, text-embedding-3-small)
  • Optional (Pro): Qdrant cluster (Local Docker or Qdrant Cloud)

๐Ÿš€ Installation

composer require abdulkadiragoliya/content-intelligence
php craft plugin/install content-intelligence

โš™๏ธ Configuration (.env)

Add any of the following optional environment variables to your .env file:

# Local Development Only: test different tiers (lite | plus | pro)
# (In production, the edition is securely managed by your Craft Plugin Store license)
CONTENT_INTELLIGENCE_EDITION=plus

# OpenAI API Key (Plus & Pro)
OPENAI_API_KEY=sk-...

# Qdrant Vector DB (Pro)
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=
QDRANT_COLLECTION=content_intelligence

๐Ÿ’ป CLI & Scheduled Console Commands

Content Intelligence provides first-class CLI commands for automation, cron jobs, and CI/CD pipelines:

System Diagnostics

php craft content-intelligence/health/check

Outputs active edition, OpenAI connectivity latency, Qdrant cluster reachability, knowledge base chunk coverage, and audit scores.

Run Content & SEO Audits

# Audit all entries across the primary site
php craft content-intelligence/audit/all

# Audit entries for a specific site or section
php craft content-intelligence/audit/all --site=default --section=articles

Semantic Knowledge Base Indexing

# Re-chunk and index all entries (incremental hashing skips unchanged content)
php craft content-intelligence/semantic/index-all

# Prune orphaned embeddings from deleted entries
php craft content-intelligence/semantic/prune

๐ŸŽจ Twig Template API

๐ŸŒ Standalone SEO Metadata Management & Frontend Output

Content Intelligence provides production-ready SEO metadata management even on fresh Craft CMS installations with no other SEO plugins installed (such as SEOmatic or Retour).

๐Ÿ“ Understanding the Data Separation

  • Craft Entry Title (title): The native Craft element title, typically rendered as the visible page heading (<h1>). Content Intelligence never silently modifies or overwrites this field.
  • SEO Title (seoTitle): The value rendered into the HTML <title> tag.
  • SEO Meta Description (metaDescription): The value rendered into <meta name="description" content="...">.
  • Page Body & Custom Fields: Visible body copy and custom fields remain completely independent.

๐Ÿ’พ Persistent Storage Model

Metadata is saved to a dedicated database table ({{%contentintelligence_seo_metadata}}) associated with the specific elementId and siteId. Deleting an entry or site automatically cascades and cleans up associated metadata with zero orphaned data.

๐Ÿท๏ธ Frontend Output in Your Templates

Place the standalone integration directly inside your layout template's <head>:

{# templates/_layout.twig #}
<!DOCTYPE html>
<html lang="{{ currentSite.language }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    {# ================================================================= #}
    {# Content Intelligence Standalone SEO Metadata Output              #}
    {# ================================================================= #}
    {{ craft.contentIntelligence.renderSeoMeta(entry) }}
    {# Alternatively, use the shorthand Twig function: #}
    {# {{ ciSeoMeta(entry) }} #}

    <link rel="stylesheet" href="/assets/css/app.css">
</head>
<body>
    <h1>{{ entry.title }}</h1>
    <div class="content">{{ entry.body }}</div>
</body>
</html>

Rendered HTML Output:

<title>Craft CMS Development Services | Example Company</title>
<meta name="description" content="Discover expert Craft CMS development services for fast, scalable business websites.">
<link rel="canonical" href="https://example.com/services/craft-cms">
<meta property="og:title" content="Craft CMS Development Services | Example Company">
<meta property="og:description" content="Discover expert Craft CMS development services for fast, scalable business websites.">
<meta property="og:url" content="https://example.com/services/craft-cms">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Example Company">
<meta property="og:image" content="https://example.com/assets/og-share.jpg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Craft CMS Development Services | Example Company">
<meta name="twitter:description" content="Discover expert Craft CMS development services for fast, scalable business websites.">
<meta name="twitter:image" content="https://example.com/assets/og-share.jpg">

โš™๏ธ Template Options & Control Panel Settings

You can customize or toggle tags globally in Settings โ†’ Plugins โ†’ Content Intelligence under "Frontend SEO & Social Tags Output":

  • Output Canonical Link Tag (Lightswitch, default: true)
  • Output OpenGraph Tags (Lightswitch, default: true)
  • Output Twitter Card Tags (Lightswitch, default: true)
  • Twitter Card Type (summary_large_image or summary)

Or override per template call:

{{ ciSeoMeta(entry, {
    canonical: true,
    og: true,
    twitter: true,
    ogImage: entry.featuredImage.one().getUrl() ?? '',
    canonicalUrl: 'https://example.com/custom-canonical'
}) }}

๐ŸŽ›๏ธ Advanced / Custom Template Usage

For headless setups or customized template layouts, use getSeo():

{% set seo = craft.contentIntelligence.getSeo(entry) %}

<title>{{ seo.renderedTitle }}</title>
{% if seo.renderedDescription %}
    <meta name="description" content="{{ seo.renderedDescription|e('html_attr') }}">
{% endif %}
{% if seo.canonicalUrl %}
    <link rel="canonical" href="{{ seo.canonicalUrl }}">
{% endif %}

โš™๏ธ Fallback & Duplicate Tag Prevention

  • Safe Fallbacks: If no custom SEO title is defined, the renderer falls back to the Craft entry title with your site's brand name suffix. If no meta description is defined, it safely omits the tag without producing invalid or empty attributes.
  • Deduplication: Content Intelligence maintains a per-request rendering cache. If renderSeoMeta() is called multiple times across nested sub-templates, subsequent calls return an empty string to avoid duplicated <title> or <meta> tags.
  • Zero External API Cost: Frontend rendering performs a single indexed database lookup. It never invokes OpenAI or Qdrant during visitor page loads, ensuring sub-millisecond execution.
  • Compatibility with Existing SEO Plugins: If your project already uses SEOmatic or another SEO plugin for HTML head output, simply omit craft.contentIntelligence.renderSeoMeta() from your template to prevent duplicate tags. You can still use Content Intelligence in the Control Panel for AI-driven SEO audits and metadata suggestions.
  • Search Engine Advisory: Search engines (including Google) evaluate title tags and meta descriptions algorithmically and may choose to truncate or rewrite snippets based on user query intent.

๐ŸŒ Multi-Site & Craft Cloud Compatibility

  • Multi-Site Scoping: Metadata is strictly scoped by siteId. An entry localized across multiple languages or domains maintains separate, isolated SEO titles and descriptions without cross-site leakage.
  • Craft Cloud Agnostic: Built with stateless, vendor-neutral database migrations compatible with both MySQL 8.0+ and PostgreSQL 13+ (AWS Aurora on Craft Cloud). No ephemeral container disk dependencies.

Access Content Intelligence metrics and recommendations directly in your frontend Twig templates:

Entry Scores

{% set score = craft.contentIntelligence.getEntryScore(entry.id) %}
{% if score %}
    <p>Content Health: {{ score.overall }}/100 {{ score.overall|ciScoreBadge }}</p>
    <p>Status: {{ score.status|ciStatusBadge }}</p>
{% endif %}

Semantic Related Entries (Plus)

{# Recommend 3 semantically related entries based on vector embeddings #}
{% set related = craft.contentIntelligence.getRelatedEntries(entry.id, 3) %}

<div class="related-posts">
    <h3>Recommended Reading</h3>
    <ul>
        {% for item in related %}
            <li><a href="{{ item.url }}">{{ item.title }}</a></li>
        {% endfor %}
    </ul>
</div>

Hybrid Frontend Search (Plus)

{% set results = craft.contentIntelligence.search(craft.app.request.getQueryParam('q'), 5) %}

{% for result in results %}
    <div class="search-result">
        <h4><a href="{{ result.entryUrl }}">{{ result.entryTitle }}</a></h4>
        <p>{{ result.snippet|raw }}</p>
        <small>Match Score: {{ result.score }} ({{ result.source }})</small>
    </div>
{% endfor %}

Export Audit Reports (Plus)

# Export CSV directly from the Control Panel or visit:
# admin/content-intelligence/audit/export

๐Ÿงช Automated Testing Suite

Content Intelligence includes a self-contained automated test suite covering unit rules, scoring formulas, edition gating, security/SSRF defenses, and RAG formatting:

php plugins/content-intelligence/tests/run.php

Or via PHPUnit:

vendor/bin/phpunit --configuration plugins/content-intelligence/phpunit.xml.dist

โ˜๏ธ Craft Cloud & Ephemeral Architecture

Content Intelligence is architected from the ground up for Craft Cloud and containerized production environments:

  • Stateless Execution: Never writes to the local filesystem; all persistent models live in MySQL/PostgreSQL and remote vector clusters.
  • Environment Configuration: Secrets and endpoints (OPENAI_API_KEY, QDRANT_URL, etc.) are resolved natively via craft\helpers\App::parseEnv().
  • Asynchronous Queue Jobs: Background batch scans run via Craft's native worker queue (RunContentAuditJob).
  • Asset Bundling: Clean AssetBundle integration (CpAsset::class) compatible with Cloud CDN asset publishing.

๐Ÿ”’ Privacy & Architecture Guiding Principles

  1. Strict Bring-Your-Own-Key (BYOK): No third-party SaaS middleman. Your data is sent directly from your server to your OpenAI and Qdrant instances.
  2. Strict Human-in-the-Loop: The plugin never silently mutates or publishes entry revisions without human approval.
  3. Unpublished Content Protection: Public front-end semantic queries strictly enforce live entry status by default.
  4. Craft Cloud Compatible: Zero persistent local disk dependencies.
  5. Multi-Site Scoped: Every audit record, knowledge chunk, and RAG session is isolated by siteId.

๐Ÿท๏ธ Plugin Store Metadata

  • Name: Content Intelligence
  • Handle: content-intelligence
  • Developer: Abdulkadir Agoliya
  • Categories: Content Management, SEO, AI & Machine Learning
  • Editions & Pricing:
    • Lite: Free (Deterministic Content & SEO Audits, Scoring)
    • Pro: $99 / year (BYOK AI Assistant, Native Slideout, SERP & SEO Intelligence)
    • Plus: $249 / year (Qdrant Vector DB, Hybrid Search, "Ask Your Website" RAG, CSV Export)

๐Ÿ“„ License

Commercial Craft CMS Plugin License. See LICENSE.md.