{"id":28479187,"url":"https://github.com/rk-vashista/writer","last_synced_at":"2026-05-04T21:36:35.172Z","repository":{"id":297043544,"uuid":"994935465","full_name":"rk-vashista/writer","owner":"rk-vashista","description":"A powerful AI-driven multi-agent platform for generating engaging, platform-optimized content across social media and GitHub. Features a modern web interface, real-time feedback loop, and support for customized strategies, tones, and goals. Built with FastAPI, TailwindCSS, and crewAI.","archived":false,"fork":false,"pushed_at":"2025-06-03T15:06:31.000Z","size":255,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-04T00:59:50.728Z","etag":null,"topics":["ai","automation","contentgeneration","contentmarketing","fastapi","generativeai","llm","multiagent","python","tailwindcss","webapp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rk-vashista.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-02T17:58:40.000Z","updated_at":"2025-06-03T15:06:33.000Z","dependencies_parsed_at":"2025-06-04T00:59:54.230Z","dependency_job_id":"e536bbf5-e717-4920-9fe7-8d3b202161f1","html_url":"https://github.com/rk-vashista/writer","commit_stats":null,"previous_names":["rk-vashista/writer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rk-vashista/writer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rk-vashista%2Fwriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rk-vashista%2Fwriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rk-vashista%2Fwriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rk-vashista%2Fwriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rk-vashista","download_url":"https://codeload.github.com/rk-vashista/writer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rk-vashista%2Fwriter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263300038,"owners_count":23445162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","automation","contentgeneration","contentmarketing","fastapi","generativeai","llm","multiagent","python","tailwindcss","webapp"],"created_at":"2025-06-07T18:08:26.780Z","updated_at":"2026-05-04T21:36:30.140Z","avatar_url":"https://github.com/rk-vashista.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎯 AI Content Generator\n\n\u003cdiv align=\"center\"\u003e\n\n[![Python](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://python.org)\n[![FastAPI](https://img.shields.io/badge/FastAPI-0.115.12-009688.svg)](https://fastapi.tiangolo.com)\n[![CrewAI](https://img.shields.io/badge/CrewAI-0.121.1-orange.svg)](https://github.com/joaomdmoura/crewAI)\n[![OpenAI](https://img.shields.io/badge/OpenAI-1.75.0-412991.svg)](https://openai.com)\n[![LangChain](https://img.shields.io/badge/LangChain-0.3.25-1C3C3C.svg)](https://langchain.com)\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\n\u003c/div\u003e\n\n\u003e A powerful AI-driven content generation platform that creates engaging, platform-optimized content using intelligent multi-agent crews powered by CrewAI and OpenAI GPT-4.\n\n## ✨ Features\n\n### 🤖 Multi-Agent Content Creation\n- **Content Strategist**: Analyzes market trends and develops comprehensive content strategies\n- **Content Creator**: Generates engaging, platform-specific content with optimal formatting\n- **Content Optimizer**: Refines content based on performance metrics and feedback\n- **Platform Specialist**: Ensures platform-specific optimization for algorithms and best practices\n- **Audience Researcher**: Conducts behavioral analysis and audience insights\n- **SEO Specialist**: Optimizes content for search engine visibility and discovery\n- **Viral Content Analyst**: Analyzes viral patterns and engagement factors\n- **Brand Voice Guardian**: Maintains consistent brand voice and tone across content\n- **GitHub Specialist**: Analyzes repositories and generates technical content\n- **Quality Assurance**: Ensures content accuracy, style consistency, and error-free output\n\n### 🎨 Modern Web Interface\n- **Responsive Design**: Beautiful UI built with Tailwind CSS that works on all devices\n- **Real-time Updates**: Live progress tracking via WebSocket connections\n- **Interactive Forms**: Dynamic form fields that adapt to selected platforms\n- **Toast Notifications**: Instant feedback for user actions and status updates\n- **Markdown Rendering**: Rich text display with syntax highlighting for code\n- **Copy-to-Clipboard**: One-click content copying for immediate use\n\n### 📝 Advanced Content Generation\n- **Multi-Platform Support**: Twitter, LinkedIn, Instagram, GitHub, Medium, and more\n- **Content Types**: Posts, threads, articles, captions, repository descriptions, README files\n- **GitHub Integration**: Repository analysis, README generation, and documentation\n- **Tone Customization**: Professional, casual, humorous, authoritative, inspiring tones\n- **Audience Targeting**: Developers, marketers, entrepreneurs, general audience\n- **Goal-Oriented**: Engagement, education, promotion, brand awareness\n- **Quick Mode**: Streamlined content generation for rapid results\n\n### 🔄 Intelligent Feedback System\n- **Iterative Improvement**: Content refinement based on user feedback\n- **Performance Analysis**: Built-in metrics and optimization suggestions\n- **A/B Testing**: Multiple content variations for testing\n- **Continuous Learning**: Agents improve based on feedback patterns\n\n## 🚀 Quick Start\n\n### Prerequisites\n- **Python**: \u003e=3.10,\u003c3.13 (Python 3.11 recommended)\n- **OpenAI API Key**: Required for GPT-4/GPT-3.5 content generation\n- **GitHub Token**: Optional, for analyzing private repositories  \n- **Serper API Key**: Optional, for enhanced web research capabilities\n\n### System Requirements\n- **RAM**: Minimum 4GB (8GB recommended for optimal performance)\n- **Storage**: ~500MB for dependencies\n- **Network**: Stable internet connection for API calls\n- **OS**: Linux, macOS, or Windows (Linux/WSL recommended)\n\n### Core Dependencies\nThis project uses the following key dependencies:\n- **CrewAI**: `0.121.1` - Multi-agent orchestration framework\n- **FastAPI**: `0.115.12` - Modern web framework for APIs\n- **OpenAI**: `1.75.0` - OpenAI API client\n- **LangChain**: `0.3.25` - LLM application framework\n- **Uvicorn**: `\u003e=0.27.0` - ASGI server for FastAPI\n- **WebSockets**: `\u003e=12.0` - Real-time communication\n\n### Installation\n\n1. **Clone and setup the repository**:\n```bash\ngit clone https://github.com/rk-vashista/writer\ncd writer\npython -m venv .venv\nsource .venv/bin/activate \n# On Windows: .venv\\Scripts\\activate\n```\n\n2. **Install dependencies**:\n```bash\n# Using pip (standard method)\npip install -e .\n\n# Or using uv (faster, recommended)\nuv sync\n```\n\n3. **Configure environment variables**:\n```bash\n# Create .env file with your API keys\ncat \u003c\u003c EOF \u003e .env\n# Required\nOPENAI_API_KEY=your_openai_api_key_here\nMODEL=gpt-4-turbo-preview\n\n# Optional: For GitHub repository analysis\nGITHUB_TOKEN=your_github_token_here\n\n# Optional: For enhanced web research\nSERPER_API_KEY=your_serper_api_key_here\n\n# Optional: For debugging and tracing\nLANGCHAIN_TRACING_V2=true\nLANGCHAIN_ENDPOINT=https://api.smith.langchain.com\nLANGCHAIN_API_KEY=your_langchain_api_key\nEOF\n```\n\n### Running the Application\n\n#### Web Interface (Recommended)\n```bash\n# Start the web server\ncontent-generator serve\n\n# Alternative using uvicorn directly\nuvicorn pitch.api:app --reload --host 0.0.0.0 --port 8000\n```\nVisit `http://localhost:8000` in your browser to access the interactive web interface.\n\n#### Command Line Interface\n```bash\n# Generate content via CLI (basic mode)\ncontent-generator\n\n# Train the crew with custom data\ncontent-generator train \u003citerations\u003e \u003ctraining_file.json\u003e\n# Example: content-generator train 5 training_data.json\n\n# Test the crew performance\ncontent-generator test \u003citerations\u003e \u003cmodel\u003e\n# Example: content-generator test 3 gpt-4\n\n# Replay a specific task for debugging\ncontent-generator replay \u003ctask_id\u003e\n# Example: content-generator replay task_abc123\n```\n\n## 🎬 Quick Demo\n\n### 5-Minute Setup\n```bash\n# Clone and setup\ngit clone https://github.com/rk-vashista/writer \u0026\u0026 cd writer\npython -m venv .venv \u0026\u0026 source .venv/bin/activate\npip install -e .\n\n# Add your OpenAI API key\necho \"OPENAI_API_KEY=your_key_here\" \u003e .env\necho \"MODEL=gpt-4-turbo-preview\" \u003e\u003e .env\n\n# Start the server\ncontent-generator serve\n```\n\nThen visit `http://localhost:8000` and try generating content for Twitter about \"AI developments\" with a professional tone!\n\n### Sample Output\nHere's what you might get for a Twitter post about \"AI developments\":\n\n```\n🚀 The AI landscape is evolving at breakneck speed! \n\nKey developments this week:\n✅ GPT-4 Turbo's enhanced reasoning\n✅ New multimodal capabilities \n✅ Reduced API costs by 3x\n\nThe future of human-AI collaboration is here. What's your take on these advancements?\n\n#AI #MachineLearning #GPT4 #Innovation #TechTrends\n```\n\n## 🏗️ Project Architecture\n\n```\ncontent-generator/\n├── 📁 src/pitch/               # Main application package\n│   ├── 🐍 __init__.py         # Package initialization\n│   ├── 🌐 api.py              # FastAPI web server \u0026 REST endpoints\n│   ├── 🤖 crew.py             # CrewAI agent definitions \u0026 orchestration\n│   ├── 🎯 main.py             # CLI entry points \u0026 server launcher\n│   ├── 📡 status_manager.py   # Real-time WebSocket status updates\n│   │\n│   ├── 📁 config/             # Configuration files\n│   │   ├── 🤖 agents.yaml     # Agent roles, goals \u0026 behaviors\n│   │   └── 📋 tasks.yaml      # Task definitions \u0026 workflows\n│   │\n│   ├── 📁 static/             # Web UI assets\n│   │   ├── 🌐 index.html      # Main web interface\n│   │   ├── ⚡ script.js       # Client-side logic \u0026 WebSocket handling\n│   │   └── 🎨 styles.css      # Custom styling \u0026 animations\n│   │\n│   └── 📁 tools/             # AI agent tools \u0026 utilities\n│       ├── 🛠️ custom_tool.py    # Specialized analysis tools\n│       ├── 📄 document_tools.py # PDF/document parsing\n│       ├── 🐙 github_tool.py    # GitHub repository analysis\n│       └── 🔍 serper_tool.py    # Web research capabilities\n│\n├── 📋 pyproject.toml          # Project configuration \u0026 dependencies\n├── 🔒 uv.lock               # Dependency lock file\n├── 📖 README.md              # This documentation\n├── 📊 monitor.py             # WebSocket monitoring utility\n└── 🔧 .env                   # Environment variables (create this)\n```\n\n### Key Components\n\n- **API Layer** (`api.py`): FastAPI server handling HTTP requests and WebSocket connections\n- **Agent Orchestration** (`crew.py`): CrewAI-based multi-agent content generation system\n- **Configuration** (`config/`): YAML-based agent and task definitions for easy customization\n- **Tools** (`tools/`): Specialized utilities for document parsing, GitHub analysis, and web research\n- **Web Interface** (`static/`): Modern, responsive UI with real-time progress tracking\n\n## 🔧 Configuration \u0026 Customization\n\n### Agent Configuration\nEdit `src/pitch/config/agents.yaml` to customize agent behaviors and capabilities:\n\n```yaml\ncontent_strategist:\n  role: Senior Content Strategy Architect\n  goal: Design comprehensive content strategies that maximize engagement\n  backstory: You're a veteran content strategist with 15+ years of experience...\n  verbose: true\n  allow_delegation: true\n\ncontent_creator:\n  role: Master Content Craftsperson \u0026 Writer\n  goal: Create compelling, publication-ready content that stops scrolling\n  backstory: You're a creative polymath and prolific writer...\n  verbose: true\n  allow_delegation: false\n```\n\n### Task Workflows\nModify `src/pitch/config/tasks.yaml` to define custom task sequences:\n\n```yaml\nquick_content_creation_task:\n  description: CREATE IMMEDIATE, PUBLICATION-READY CONTENT\n  expected_output: The actual content as it should appear when published\n  agent: content_creator\n\naudience_research_task:\n  description: Research target audience behavior and preferences\n  expected_output: Actionable audience insights for content optimization\n  agent: audience_researcher\n```\n\n### Environment Variables\nConfigure your `.env` file with the following options:\n\n```bash\n# Required\nOPENAI_API_KEY=your_openai_api_key\n\n# Model Configuration\nMODEL=gpt-4-turbo-preview              # Recommended: gpt-4-turbo-preview, gpt-4, gpt-3.5-turbo\nTEMPERATURE=0.7                        # Creativity level (0.0-1.0)\n\n# Optional Integrations\nGITHUB_TOKEN=your_github_token         # For private repo analysis\nSERPER_API_KEY=your_serper_key        # For enhanced web research\nLANGCHAIN_TRACING_V2=true             # For debugging (optional)\nLANGCHAIN_ENDPOINT=https://api.smith.langchain.com\nLANGCHAIN_API_KEY=your_langchain_api_key\n```\n\n## 📝 Usage Examples\n\n### Web Interface Usage\n\n1. **Access the Interface**\n   - Open `http://localhost:8000` in your browser\n   - Choose your target platform from the dropdown\n\n2. **Basic Content Generation**\n   ```\n   Platform: Twitter\n   Content Type: Social Media Post\n   Topic: \"Latest developments in AI\"\n   Tone: Professional\n   Target Audience: Tech enthusiasts\n   Goals: Drive engagement and educate\n   ```\n\n3. **GitHub Repository Analysis**\n   ```\n   Platform: GitHub\n   Content Type: Repository Description\n   Repository URL: https://github.com/user/repo\n   GitHub Token: [Optional for private repos]\n   Target Audience: Developers\n   ```\n\n4. **Content with Feedback Loop**\n   - Generate initial content\n   - Review the output\n   - Provide specific feedback in the feedback box\n   - Regenerate for improved results\n\n### Command Line Usage\n\n```bash\n# Basic content generation\ncontent-generator\n\n# Training the crew with custom data\ncontent-generator train 10 my_training_data.json\n\n# Testing crew performance\ncontent-generator test 5 gpt-4\n\n# Replaying a specific task for debugging\ncontent-generator replay task_abc123\n```\n\n### API Integration\n\n```python\nimport requests\n\n# Generate content via API\nresponse = requests.post(\"http://localhost:8000/generate\", data={\n    \"platform\": \"twitter\",\n    \"content_type\": \"social media post\",\n    \"topic\": \"Machine Learning trends\",\n    \"tone\": \"professional\",\n    \"target_audience\": \"developers\",\n    \"content_goals\": \"education and engagement\"\n})\n\njob_id = response.json()[\"job_id\"]\n```\n\n### Platform-Specific Features\n\n#### Twitter/X\n- Character limit optimization\n- Hashtag research and recommendations\n- Thread structure for long-form content\n- Engagement-focused hooks\n\n#### LinkedIn\n- Professional tone calibration\n- Industry-specific content\n- Article formatting\n- Network-appropriate messaging\n\n#### GitHub\n- Repository analysis and description generation\n- README file creation\n- Technical documentation\n- Developer community insights\n\n#### Instagram\n- Visual content recommendations\n- Caption optimization\n- Hashtag strategies\n- Story-friendly formatting\n\n## 🛠️ Available Tools \u0026 Integrations\n\n### Content Analysis Tools\n- **Market Research Tool**: Analyzes market trends and audience behavior\n- **Competitor Analysis Tool**: Studies competitor strategies and performance\n- **Trend Analysis Tool**: Identifies trending topics and themes\n- **Viral Content Analyzer**: Analyzes viral patterns and engagement factors\n\n### Optimization Tools\n- **Content Optimization Tool**: Enhances readability and engagement\n- **Hashtag Research Tool**: Finds optimal hashtags for reach\n- **SEO Analyzer**: Optimizes content for search discovery\n- **Performance Predictor**: Forecasts content performance metrics\n\n### Platform-Specific Tools\n- **Platform Analyzer**: Ensures platform-specific optimization\n- **Algorithm Insights Tool**: Adapts to platform algorithms\n- **Format Optimizer**: Optimizes content structure per platform\n\n### Research \u0026 Intelligence\n- **Audience Analysis Tool**: Deep audience behavior analysis\n- **Psychographic Profiler**: Psychological audience insights\n- **Web Research Tool**: Real-time web content research\n- **Document Parser**: Extracts insights from uploaded documents\n\n### Quality Assurance\n- **Quality Checker**: Ensures content accuracy and consistency\n- **Fact Verifier**: Validates factual claims and statements\n- **Style Guide Enforcer**: Maintains brand voice consistency\n- **Brand Voice Analyzer**: Calibrates tone and messaging\n\n## 🚀 Advanced Features\n\n### Real-Time Progress Tracking\n- Live WebSocket updates during content generation\n- Step-by-step progress visualization\n- Detailed logging of agent activities\n- Error handling and recovery notifications\n\n### Multi-Agent Collaboration\n- Agents work together in coordinated workflows\n- Automatic task delegation and management\n- Quality checks at each stage\n- Iterative improvement through feedback loops\n\n### Platform Algorithm Optimization\n- Twitter/X: Engagement-focused content with optimal timing\n- LinkedIn: Professional networking and thought leadership\n- Instagram: Visual storytelling and community building\n- GitHub: Technical documentation and developer engagement\n\n### Content Performance Analytics\n- Built-in performance prediction\n- A/B testing recommendations\n- Engagement optimization suggestions\n- Platform-specific best practices\n\n## 🔧 Troubleshooting\n\n### Common Issues\n\n#### Installation Problems\n```bash\n# If you encounter dependency conflicts\npip install --upgrade pip\npip install -e . --force-reinstall\n\n# For uv users\nuv sync --refresh\n```\n\n#### API Key Issues\n- Ensure your OpenAI API key is valid and has sufficient credits\n- Check that your `.env` file is in the project root directory\n- Verify environment variables are loaded: `echo $OPENAI_API_KEY`\n\n#### WebSocket Connection Issues\n```bash\n# Check if port 8000 is available\nnetstat -tulpn | grep :8000\n\n# Start with different port if needed\nuvicorn pitch.api:app --host 0.0.0.0 --port 8001\n```\n\n#### Permission Errors\n```bash\n# Make sure you have proper permissions\nchmod +x src/pitch/main.py\n\n# Check virtual environment activation\nwhich python  # Should point to your .venv/bin/python\n```\n\n### Performance Optimization\n- Use `gpt-4-turbo-preview` for better performance vs `gpt-4`\n- Enable request caching by setting `LANGCHAIN_CACHE=true`\n- For production, consider using Redis for session management\n\n### Debugging\n```bash\n# Enable verbose logging\nexport LANGCHAIN_VERBOSE=true\n\n# Enable CrewAI debugging\nexport CREWAI_DEBUG=true\n\n# Monitor WebSocket connections\npython monitor.py\n```\n\n### Using the WebSocket Monitor\nThe project includes a monitoring utility for debugging WebSocket connections:\n\n```bash\n# Monitor real-time WebSocket activity\npython monitor.py\n\n# This will show:\n# - Connection status\n# - Message flow between client and server\n# - Agent progress updates\n# - Error messages and debugging info\n```\n\n## 🧪 Development \u0026 Testing\n\n### Running Tests\n```bash\n# Test crew performance\ncontent-generator test 3 gpt-4-turbo-preview\n\n# Test with different models\ncontent-generator test 5 gpt-3.5-turbo\n```\n\n### Development Setup\n```bash\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Run in development mode with hot reload\nuvicorn pitch.api:app --reload --log-level debug\n```\n\n### Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n#### Development Guidelines\n1. Follow PEP 8 style guidelines\n2. Add tests for new features\n3. Update documentation for API changes\n4. Test with multiple OpenAI models\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Built with [crewAI](https://github.com/joaomdmoura/crewAI)\n- UI powered by [Tailwind CSS](https://tailwindcss.com)\n- Developed with [FastAPI](https://fastapi.tiangolo.com)\n\n---\n\n\u003cdiv align=\"center\"\u003e\nMade with ❤️ by content creators, for content creators\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frk-vashista%2Fwriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frk-vashista%2Fwriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frk-vashista%2Fwriter/lists"}