ContentGuardianAgent consolidation:
- Merge 3 duplicate classes into single source in specialized/content_guardian.py
- Watchdog audit_committee() with heuristic scoring, coverage gaps, overlaps, alerts
- Remove misleading rejection_rate() helper; use acceptance_rate directly
- Integrate audit + alerts + trend signals into today_workflow_service.py
Team Activity page:
- QualityAuditPanel: health ring, per-agent critiques, coverage gaps, overlaps
- TrendSignalsPanel: opportunity cards with urgency/impact/coverage bars
- AlertBanner: persistent dismiss via POST /alerts/{id}/mark-read
- AgentHelpModal: dialog showing all 8 agents with descriptions, tools, schedule
- QualityAuditPanel action buttons: Fill gap -> /content-planning, Resolve overlap, View CTA on alerts/issues
- TrendSignalsPanel action buttons: Create content from this trend -> /blog-writer with trend context state
Onboarding system:
- Step 4 validation: no auto-pass via basic_ready; requires persona data or explicit progression
- Step 5 validation: logs warning on auto-pass without integration data
- OnboardingCompletionService: single DB session, transactional task creation, upsert pattern
- Business-without-website: nullable website_url on SIFIndexingTask and MarketTrendsTask
- DeepCompetitorAnalysisExecutor: 5-min timeout, 10-competitor cap, asyncio.wait_for
- Persona generation: async with 30s timeout, falls back to scheduler
- OnboardingProgressService.reset_onboarding(): resets session + pauses all DB tasks
- OnboardingControlService.reset_onboarding(): also cancels APScheduler jobs
- FinalStep TaskSchedulingPanel: shows scheduled/failed tasks after completion, 8s auto-redirect
- onboarding_completed agent activity event logged to feed
Documentation:
- docs-site/features/onboarding/: overview, steps, scheduler-tasks, technical-reference (4 pages)
- docs-site/mkdocs.yml: added Onboarding System nav section
- docs-site/features/sif-agents/: overview, agent-directory, committee-system, content-guardian (4 pages)
- docs-site/features/team-activity/: overview, quality-audit, trend-signals, alert-system (4 pages)
- docs-site/features/todays-workflow/: updated overview, technical-architecture, workflow-guide, api-reference
AI Blog Writer Service Architecture
This directory contains the refactored AI Blog Writer service with a clean, modular architecture.
📁 Directory Structure
blog_writer/
├── README.md # This file
├── blog_service.py # Main entry point (imports from core)
├── core/ # Core service orchestrator
│ ├── __init__.py
│ └── blog_writer_service.py # Main service coordinator
├── research/ # Research functionality
│ ├── __init__.py
│ ├── research_service.py # Main research orchestrator
│ ├── keyword_analyzer.py # AI-powered keyword analysis
│ ├── competitor_analyzer.py # Competitor intelligence
│ └── content_angle_generator.py # Content angle discovery
├── outline/ # Outline generation
│ ├── __init__.py
│ ├── outline_service.py # Main outline orchestrator
│ ├── outline_generator.py # AI-powered outline generation
│ ├── outline_optimizer.py # Outline optimization
│ └── section_enhancer.py # Section enhancement
├── content/ # Content generation (TODO)
└── optimization/ # SEO & optimization (TODO)
🏗️ Architecture Overview
Core Module (core/)
BlogWriterService: Main orchestrator that coordinates all blog writing functionality- Provides a unified interface for research, outline generation, and content creation
- Delegates to specialized modules for specific functionality
Research Module (research/)
ResearchService: Orchestrates comprehensive research using Exa neural search (currently Exa-only for testing)KeywordAnalyzer: AI-powered keyword analysis and extractionCompetitorAnalyzer: Competitor intelligence and market analysisContentAngleGenerator: Strategic content angle discovery
Outline Module (outline/)
OutlineService: Manages outline generation, refinement, and optimizationOutlineGenerator: AI-powered outline generation from research dataOutlineOptimizer: Optimizes outlines for flow, SEO, and engagementSectionEnhancer: Enhances individual sections using AI
🔄 Service Flow
- Research Phase:
ResearchService→KeywordAnalyzer+CompetitorAnalyzer+ContentAngleGenerator - Outline Phase:
OutlineService→OutlineGenerator→OutlineOptimizer - Content Phase: (TODO) Content generation and optimization
- Publishing Phase: (TODO) Platform integration and publishing
🚀 Usage
from services.blog_writer.blog_service import BlogWriterService
# Initialize the service
service = BlogWriterService()
# Research a topic
research_result = await service.research(research_request)
# Generate outline from research
outline_result = await service.generate_outline(outline_request)
# Enhance sections
enhanced_section = await service.enhance_section_with_ai(section, "SEO optimization")
🎯 Key Benefits
1. Modularity
- Each module has a single responsibility
- Easy to test, maintain, and extend
- Clear separation of concerns
2. Reusability
- Components can be used independently
- Easy to swap implementations
- Shared utilities and helpers
3. Scalability
- New features can be added as separate modules
- Existing modules can be enhanced without affecting others
- Clear interfaces between modules
4. Maintainability
- Smaller, focused files are easier to understand
- Changes are isolated to specific modules
- Clear dependency relationships
🔧 Development Guidelines
Adding New Features
- Identify the appropriate module (research, outline, content, optimization)
- Create new classes following the existing patterns
- Update the module's
__init__.pyto export new classes - Add methods to the appropriate service orchestrator
- Update the main
BlogWriterServiceif needed
Testing
- Each module should have its own test suite
- Mock external dependencies (AI providers, APIs)
- Test both success and failure scenarios
- Maintain high test coverage
Error Handling
- Use graceful degradation with fallbacks
- Log errors appropriately
- Return meaningful error messages to users
- Don't let one module's failure break the entire flow
📈 Future Enhancements
Content Module (content/)
- Section content generation
- Content optimization and refinement
- Multi-format output (HTML, Markdown, etc.)
Optimization Module (optimization/)
- SEO analysis and recommendations
- Readability optimization
- Performance metrics and analytics
Integration Module (integration/)
- Platform-specific adapters (WordPress, Wix, etc.)
- Publishing workflows
- Content management system integration
🔍 Code Quality
- Type Hints: All methods use proper type annotations
- Documentation: Comprehensive docstrings for all public methods
- Error Handling: Graceful failure with meaningful error messages
- Logging: Structured logging with appropriate levels
- Testing: Unit tests for all major functionality
- Performance: Efficient caching and API usage
📝 Migration Notes
The original blog_service.py has been refactored into this modular structure:
- Research functionality →
research/module - Outline generation →
outline/module - Service orchestration →
core/module - Main entry point →
blog_service.py(now just imports from core)
All existing API endpoints continue to work without changes due to the maintained interface in BlogWriterService.