AI Blog Generator
A repository-backed publishing system that turns source code into reviewable technical articles, then keeps every public version tied to current security and provenance checks.
Overview
AI Systems / Writing workflow
The AI Blog Generator turns GitHub repositories into detailed technical posts with code references, generated diagrams, and repository-aware editing tools. Built on AI SDK 7, it loads repository context before generation and carries a durable source-security snapshot through Inngest. A draft never becomes public by accident: the exact immutable version, its source state, metadata, code, and visual provenance must pass the current publication policy before an atomic canonical promotion. Monaco editing, live preview, diffs, drift maintenance, and retry-safe subscriber delivery keep the article inspectable after publication.
Technical stack
6 stack groups
Core Framework
4 instruments in this layerKey features
9 capability groups
Multi-Agent AI Pipeline
9 implementation notes- 01
Blog Writer: Primary generator using AI SDK 7 ToolLoopAgent for dynamic file reading and diagram creation.
- 02
Blog Reviewer Agent: Independent editorial review backed by a recursive runtime-import frontier and explicit factual-grounding audit.
- 03
Blog Refiner Agent: Improves existing content while preserving diagram tokens via tokenization pipeline.
- 04
Prompt Refiner Agent: Transforms rough ideas into detailed, actionable blog specifications (~150 words).
- 05
Structured JSON output converted to Markdown with embedded diagrams and code references.
- 06
Discovery Grid & Sequential Navigation with intelligent 'Card Wins' de-duplication logic.
- 07
AI-powered semantic search via /api/blog/search with Gemini model cascade and text fallback.
- 08
URL state synchronization for blog filters (search, tags, repo, sort) for deep linking.
- 09
Performance-first rendering using Next.js Static Site Generation (SSG) with generateStaticParams.
Architecture notes
11 recorded decisions
- 01
Context-first architecture pre-loads 'The Map' (repo tree) and user-selected files before AI generation.
- 02
Multi-agent pipeline combines writing, refinement, and prompt optimization with independent editorial, recursive runtime-architecture, and factual-grounding review.
- 03
Tokenization system (<<<DIAGRAM:uuid>>>) protects diagram assets during AI refinement passes.
- 04
Drift detection comparing stored file SHAs with live GitHub state for documentation accuracy.
- 05
One atomic publication boundary promotes a current-policy validated immutable version without letting draft saves replace live content.
- 06
Public reads, navigation, history, related articles, and code evidence share the same fail-closed canonical visibility contract.
- 07
Inngest background jobs carry durable security snapshots; PostgreSQL-backed progress, maintenance audits, and retryable notification intent preserve operational state.
- 08
GDPR-compliant double opt-in delivery uses stable provider idempotency keys and per-recipient attempt state.
- 09
Serialized love toggles and conflict-safe fingerprinted views keep engagement counters consistent under concurrency.
- 10
Gemini-powered semantic search with automated model cascading and long-term caching.
- 11
AI SDK tool system enabling agents to read files, generate diagrams, and create tags on-demand.
Project status
4 status records
Core Features Implemented
12 recorded items- 01
Full blog generation pipeline with multi-agent architecture (Writer + Reviewer).
- 02
Context loading system with repository tree and file pre-loading.
- 03
Automatic quality gates with reviewer agent auto-fixing common issues.
- 04
Three diagram modes: AI images, Mermaid code, and hybrid selection.
- 05
Version control with history timeline, pinning, and auto-pruning.
- 06
Drift detection with SHA comparison and commit history.
- 07
Current-policy canonical publication with fail-closed public reads and range-authorized source evidence.
- 08
Autonomous repair, rollback, and rebaseline that preserve immutable history.
- 09
Monaco split-pane editor with live preview and diff viewing.
- 10
Background job processing with real-time progress tracking.
- 11
AI-powered semantic search with automatic fallback and deep-linkable URLs.
- 12
Tag generation and management with AI suggestions.