prafulmemane/ContentGenie
β¨ ContentGenie
AI-Powered Multi-Agent Content Generation Platform powered by LangGraph, OpenAI, Google Gemini, and Anthropic Claude.
Generate high-quality blog posts, LinkedIn content, images, and video scripts using an intelligent multi-agent workflow.
π Live Demo
[Open ContentGenie on Hugging Face Spaces](https://huggingface.co/spaces/YOUR_USERNAME/ContentGenie)
(Replace YOUR_USERNAME with your actual Hugging Face username after deployment)
π― Features
- π€ Multi-Agent Workflow
- Research Agent: Gathers information from web sources
- Content Strategist: Plans your content
- Blog Writer: Generates blog posts
- LinkedIn Writer: Creates social media content
- Image Generator: Creates visual content
- Video Script: Generates video scripts
- π Multiple Response Formats
- JSON: Structured data format
- XML: Markup format
- TOON: ASCII art representation
- π Automatic LLM Failover
- Primary: OpenAI GPT-4o
- Fallback: Google Gemini 2.0 Flash
- Alternative: Anthropic Claude 3 Sonnet
- Local: Ollama support
- π‘οΈ Content Guardrails
- Profanity filtering
- Safety validation
- Intent detection
- Rule-based filtering
- π± Professional UI
- Streamlit-powered interface
- Responsive design
- Real-time content generation
- Format-agnostic output
π§ Setup & Configuration
π Hugging Face Spaces (Live)
The app requires these secrets in your HF Space Settings:
OPENAI_API_KEY # https://platform.openai.com/api-keys
GEMINI_API_KEY # https://aistudio.google.com/app/apikey
HF_TOKEN # https://huggingface.co/settings/tokens
SERPAPI_API_KEY # https://serpapi.com/dashboardOptional secrets for additional features:
STABILITY_KEY # https://platform.stability.ai/account/keys
RUNWAY_API_KEY # https://runwayml.com/settings
ELEVENLABS_API_KEY # https://elevenlabs.io/app/settings/api-keysπ» Local Development
# 1. Clone the repository
git clone https://github.com/YOUR_USERNAME/ContentGenie.git
cd ContentGenie
# 2. Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Set up environment variables
cp .env.example .env
# Edit .env and add your API keys
# 5. Run the app
streamlit run app.pyThe app will open at http://localhost:8501
ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interface (Streamlit) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββ ββββββββββββββββββββββββββββ β
β β Input Panel β β Output Display β β
β β β’ Query text ββββββββββΆβ β’ Format selector (JSON/ β β
β β β’ Format select β β XML/TOON) β β
β β β’ Submit button β β β’ Content output β β
β ββββββββββββββββββββ β β’ Copy/Export buttons β β
β ββββββββββββββββββββββββββββ β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββΌβββββββββββ
β Query Handler β
β (Route & Orchestrate)
ββββββββββββ¬βββββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
βββββΌβββββββββ βββΌββββββββββ βββΌβββββββββββ
β Guardrail β β Research β β Content β
β Engine β β Agent β β Generator β
β β β β β β
β β’ Profanityβ β β’ WebSearch β β’ LLM β
β Filter β β β’ SerpAPI β Chain β
β β’ Safety β β β’ DuckDuckGo β β
β β’ Intent β βββββββββββββ ββββββββββββββ
ββββββββββββββ
β
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββ
β LLM Provider Registry & Fallover β
β ββββββββββββ ββββββββββββ ββββββββββββ β
β βOpenAI ββΆ βGemini ββΆ βClaude β β
β βGPT-4o β β2.0-Flash β β3-Sonnet β β
β ββββββββββββ ββββββββββββ ββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββ
β Format Converter β
β ββββββββββββ ββββββββββββ ββββββββββββ β
β β JSON β β XML β β TOON β β
β β Encoder β β Converterβ βFormatter β β
β ββββββββββββ ββββββββββββ ββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββπ¦ Tech Stack
π Documentation
- [Response Formats Guide](docs/response_formats_guide.md) - Detailed format specifications
- [API Response Formats](docs/api_response_formats.md) - API response structure
- [Architecture Diagrams](docs/architecture_diagrams.md) - System architecture
- [Deployment Guide](docs/deployment_guide.md) - Detailed deployment instructions
π Security & Best Practices
- β
Never commit API keys to git (use
.envand HF Secrets) - β Use environment variables for all sensitive data
- β Rotate API keys regularly
- β
Check
.env.examplefor required variables - β Run guardrail engine for all user inputs
- β Validate all responses before serving
π Troubleshooting
App won't start locally
# Clear Streamlit cache
rm -rf ~/.streamlit
# Reinstall dependencies
pip install --upgrade -r requirements.txt
# Run with debug
streamlit run app.py --logger.level=debugImport errors on HF Spaces
Check that the Dockerfile correctly sets WORKDIR /app and the app.py file has:
import sys
sys.path.insert(0, '.')API key errors
Verify in HF Space Settings β Repository secrets that:
- Secret names match exactly (case-sensitive)
- Secret values are correct
- Spaces have propagated the secrets (wait 30 seconds after adding)
Slow generation times
- First run cold-starts may take 30-60 seconds
- Use GPT-3.5-turbo instead of GPT-4o for speed
- Consider upgrading HF Space hardware for faster responses
π Deployment to Hugging Face Spaces
Quick Start
- Create a Space on HF: https://huggingface.co/spaces
- Select Docker as SDK
- Link your GitHub repository
- Add required secrets in Settings
- Space auto-deploys on each push
Detailed Steps
See Deployment Guide for step-by-step instructions.
π Performance Metrics
π License
MIT License - See LICENSE file for details
π¨βπ» Development
Project Structure
ContentGenie/
βββ app.py # HF Spaces entry point
βββ Dockerfile # Docker configuration
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ .env.example # Environment template
βββ .gitignore # Git exclusions
β
βββ src/
β βββ agents/ # Multi-agent implementations
β β βββ base_agent.py
β β βββ query_handler.py
β β βββ research.py
β β βββ content_strategist.py
β β βββ blog_writer.py
β β βββ ...
β β
β βββ core/ # Core LLM & orchestration
β β βββ base_llm.py
β β βββ registry.py
β β βββ factory.py
β β βββ guardrail_engine.py
β β
β βββ integrations/ # External service clients
β β βββ content_client.py
β β βββ research_client.py
β β βββ visual_client.py
β β βββ ...
β β
β βββ utils/ # Utility functions
β β βββ formatter.py
β β βββ content_optimization.py
β β βββ quality_validation.py
β β
β βββ config/ # Configuration files
β β βββ intents.yaml
β β βββ guardrails.yaml
β β βββ services.yaml
β β
β βββ docs/ # Documentation
β β βββ api_response_formats.md
β β βββ architecture_diagrams.md
β β βββ deployment_guide.md
β β
β βββ web_app/ # Streamlit UI
β βββ app.py
β βββ components/
β βββ assets/
β βββ data/
β
βββ tests/ # Unit & integration tests
βββ unit/
βββ integration/
βββ e2e/π€ Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
π Support
- Issues: Open a GitHub issue for bugs
- Discussions: Use GitHub Discussions for questions
- Email: [your-email@example.com]
- HF Community: Post in Hugging Face forums
π Acknowledgments
Built with:
- Streamlit - UI Framework
- LangGraph - Multi-agent orchestration
- OpenAI - GPT models
- Google AI - Gemini models
- Anthropic - Claude models
- Hugging Face - Model hub & Spaces
Made with β€οΈ for content creators and developers
Last updated: February 2026
