AI Blog Generator
A context-first blog generation system with multi-agent AI pipeline, drift detection, and version control for technical writing.
Overview
The AI Blog Generator addresses the challenge of creating accurate, code-referenced technical content by implementing a context-first architecture. It pre-loads repository structure ('The Map') and user-selected files before generation, enabling the AI to write with full codebase awareness. The multi-agent pipeline (Blog Writer, Blog Refiner, Prompt Refiner) ensures high-quality output, while drift detection alerts authors when referenced code changes, maintaining documentation accuracy over time.
Technical Stack
Next.js 16 (App Router)
React 19
TypeScript
Vercel Neon Postgres with Drizzle ORM
Key Features
- Blog Writer Agent: Primary generator using AI SDK 6 with tools for file reading and diagram creation.
- Blog Refiner Agent: Improves existing content while preserving diagram tokens via tokenization pipeline.
- Prompt Refiner Agent: Transforms rough ideas into detailed, actionable blog specifications (~150 words).
- Structured JSON output converted to Markdown with embedded diagrams and code references.
Architectural Highlights
- Context-first architecture pre-loads 'The Map' (repo tree) and user-selected files before AI generation.
- Multi-agent pipeline with specialized agents for writing, refinement, and prompt optimization.
- Tokenization system (<<<DIAGRAM:uuid>>>) protects diagram assets during AI refinement passes.
- Drift detection comparing stored file SHAs with live GitHub state for documentation accuracy.
- Version manager with auto-pruning at 50 versions, pinning support, and protected change types.
- Inngest background jobs with Redis-backed progress tracking and atomic database transactions.
- AI SDK 6 tool system enabling agents to read files, generate diagrams, and create tags on-demand.
Project Status
- Full blog generation pipeline with multi-agent architecture.
- Context loading system with repository tree and file pre-loading.
- Three diagram modes: AI images, Mermaid code, and hybrid selection.
- Version control with history timeline, pinning, and auto-pruning.
- Drift detection with SHA comparison and commit history.
- Monaco split-pane editor with live preview and diff viewing.
- Background job processing with real-time progress tracking.
- Tag generation and management with AI suggestions.