Intelligent multi-platform content generator using Google's Agent Development Kit. Automatically selects platforms, generates tailored content, and improves quality through AI feedback loops.
LLM analyzes requests → Selects optimal platforms based on content type
Only generates for selected platforms (60-70% API cost savings)
Iterative improvement: Generate → Score → Regenerate if < 6.5/10 (max 3 attempts)
# Install
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Configure .env file
echo "GOOGLE_API_KEY=your_key_here" > .env
# Run
python main.pyCreate .env file:
# Required
GOOGLE_API_KEY=your_google_api_key
# Optional (defaults shown)
GEMINI_TEXT_MODEL=gemini-2.5-flashGet API key: https://aistudio.google.com/app/apikey
Create LinkedIn content about AI trends
Write Instagram post about productivity
Generate blog content about remote work
Create content for X and LinkedIn about leadership
Output (30-90 seconds):
- Platform selection reasoning
- Generated content per platform
- Quality scores + improvement history
- Implementation insights
| Agent | Role | Output |
|---|---|---|
| SmartRouter | Platform selection | JSON decision: platforms, confidence, reasoning |
| XContentSpecialist | X/Twitter content | 280 char conversational posts |
| LinkedInContentSpecialist | LinkedIn content | 500 word professional insights |
| InstagramContentSpecialist | Instagram content | 350 word authentic stories |
| BlogContentSpecialist | Blog content | 800-1500 word articles |
| ResearchEnhancer | Current info gathering | Data, trends, examples |
| QualityChecker | Content assessment | 0-10 scores, improvement suggestions |
| ContentRegenerator | Content improvement | Enhanced versions based on feedback |
Quality Settings (src/config/settings.py):
QUALITY_SCORE_THRESHOLD = 6.5 # Min acceptable score
MAX_QUALITY_ATTEMPTS = 3 # Regeneration limitRate Limits (seconds):
RATE_LIMIT_DELAYS = {
"after_routing": 4,
"after_research": 2,
"between_platforms": 3,
"cooling_period": 15
}Research Config (src/config/__init__.py):
RESEARCH_CONFIG = {
"enabled": True,
"search_queries_per_topic": 2,
"max_sources": 3
}| Platform | Type | Length | Focus |
|---|---|---|---|
| X/Twitter | Quick posts | 280 chars | Viral, trending |
| Professional | 500 words | Thought leadership | |
| Stories | 350 words | Visual, authentic | |
| Blog | Articles | 800-1500 words | Deep analysis, SEO |
Core:
google-adk- Agent Development Kitgoogle-generativeai- Gemini APIpython-dotenv- Environment config
Optional:
google_search- Research enhancement
smart-routing-pipeline/
├── main.py # Entry point
├── .env # API keys
├── requirements.txt
├── src/
│ ├── agents/ # Routing, content, research, quality
│ ├── config/ # Settings, environment
│ ├── pipelines/ # Main orchestration
│ └── utils/ # Parsing, runners, quality
Setup:
python src/config/environment.py # Validate setupCommon Issues:
- Rate limits → Increase delays in
settings.py - Low scores → Be more specific in requests
- No platforms → Clarify content type/audience
- API Efficiency: 60-70% cost reduction
- Quality: 85%+ first-attempt approval, avg 8.1/10
- Speed: 30-90 seconds depending on complexity
Start Creating:
python main.py