Let your ghost write your post
An intelligent social media automation system that transforms news articles into engaging social media content using cutting-edge AI services.
GhostWriter AI is a comprehensive automation system that:
- Automatically processes news articles from any source
- Generates optimized social media content using local Ollama AI
- Orchestrates multiple AI services for content analysis and generation
- Provides seamless integration with Telegram for team notifications
Let your ghost write your post - while you focus on strategy, GhostWriter handles the content creation.
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Content β β FastAPI β β Telegram β
β Monitor βββββΆβ Orchestrator βββββΆβ Bot β
β (Google Apps) β β (Backend) β β Notifications β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βββββββββββΌββββββββββ
βΌ βΌ βΌ
ββββββββββββββββββββββββββββββββββββ
β Ollama ββ FastVLM ββ Content β
β LLM ββ Vision ββGenerator β
β Service ββ Service ββ Service β
ββββββββββββββββββββββββββββββββββββ
- Lead Developer: FastAPI Backend Orchestrator
- AI Engineer: Ollama/LLM Integration Specialist
- Vision Engineer: FastVLM Vision Processing Service
- DevOps Engineer: Deployment & Integration Management
- Article Relevance Analysis: Automatically filters relevant news using local Ollama
- Image Processing: AI-powered image ranking and caption generation
- Content Optimization: Smart content generation for different social platforms
- Dynamic Service Switching: Mock/Real AI service toggling
- Robust Error Handling: Graceful fallbacks and timeout management
- Health Monitoring: Real-time service status and integration monitoring
- API Key Authentication: Secure access control
- Environment-based Configuration: Secure credential management
- Rate Limiting: API abuse prevention
- Telegram Notifications: Real-time alerts via custom bot
- Approval Workflow: Human-in-the-loop content review
- Multi-platform Distribution: Ready for Facebook, Instagram, Twitter
- Python 3.9+
- Ollama running locally (127.0.0.1:11434)
- Telegram bot credentials
-
Clone the repository
git clone https://github.com/Lucian-Adrian/ghostwriter.git cd ghostwriter -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
cd backend_server pip install -r requirements.txt -
Configure environment
cp .env.example .env # Edit .env with your credentials -
Start the server
uvicorn app.main:app --host 0.0.0.0 --port 8003 --reload
# API Security
API_KEY=your_secure_api_key
AGENTS_API_KEY=your_agents_api_key
# Service URLs
FASTVLM_API_URL=http://localhost:8001
GEMMA9B_API_URL=http://127.0.0.1:11434
# Telegram Bot
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
TELEGRAM_BOT_USERNAME=@YourBot
# Development
DEBUG=TruePOST /api/v1/process-article
Content-Type: application/json
X-API-Key: your_api_key
{
"article_url": "https://fmf.md/article-url",
"source": "fmf_monitor"
}GET /healthPOST /api/v1/config/switch-to-real-services
POST /api/v1/config/switch-to-mock-services
GET /api/v1/config/test-ollama-connection- π Complete API Documentation
- ποΈ Architecture Guide
- π Deployment Guide
cd backend_server
python test_complete_integration.pycurl http://localhost:8003/health- β Backend Orchestrator: FastAPI server operational
- β Telegram Integration: Bot notifications configured
- β Ollama LLM Service: Local AI processing ready
- π‘ Vision Service: FastVLM integration ready for setup
- π‘ Content Monitor: Google Apps Script ready for deployment
- Backend Orchestrator:
http://localhost:8003 - Ollama LLM:
http://127.0.0.1:11434 - Artiom's FastVLM:
http://localhost:8001(configurable) - Telegram Bot:
@OfficialGhostWriterBot
ghostwriter/
βββ README.md # Main documentation
βββ CONTRIBUTING.md # Development guidelines
βββ .gitignore # Git ignore rules
βββ backend_server/
β βββ app/
β β βββ main.py # FastAPI application
β β βββ telegram_handler.py # Telegram integration
β β βββ services/ # AI service integrations
β β β βββ language_service.py # Ollama LLM integration
β β β βββ vision_service.py # FastVLM integration
β β βββ tools/ # Utility functions
β β βββ scraper_tool.py # Web scraping
β β βββ image_editor_tool.py # Image processing
β βββ requirements.txt # Python dependencies
β βββ .env.example # Environment template
β βββ run_simple.py # Simple server startup
β βββ start.bat / start.sh # Platform-specific startup
β βββ processed_images/ # Image cache directory
βββ docs/
βββ API.md # API documentation
βββ ARCHITECTURE.md # Technical architecture
βββ DEPLOYMENT.md # Deployment guide
βββ examples.md # Content examples
βββ google-apps-script.md # GAS integration
βββ monitor.gs # Google Apps Script
- Create service module in
app/services/ - Implement service interface
- Add configuration to
.env - Update orchestrator in
main.py - Write comprehensive tests
- Fork the repository
- Create 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 Pull Request
Switch between mock and real services:
# Switch to real services
curl -X POST http://localhost:8003/api/v1/config/switch-to-real-services \
-H "X-API-Key: your_api_key"
# Switch to mock services
curl -X POST http://localhost:8003/api/v1/config/switch-to-mock-services \
-H "X-API-Key: your_api_key"# Check all services
curl http://localhost:8003/health
# Test Ollama connection
curl -X GET http://localhost:8003/api/v1/config/test-ollama-connection \
-H "X-API-Key: your_api_key"- π Bug Reports: Create GitHub issue with reproduction steps
- π‘ Feature Requests: Open GitHub discussion
- π Documentation: Check the
docs/folder for detailed guides
This project is open source software for AI-powered social media automation.
- Backend orchestrator
- Telegram bot integration
- Ollama LLM integration
- Vision service integration
- Content monitoring setup
- Google Apps Script integration
- Production server deployment
- Performance monitoring
- Advanced error handling
- Multi-platform social media posting
- Content analytics dashboard
- A/B testing for optimization
- Automated content scheduling
GhostWriter AI - Let your ghost write your post
Built with β€οΈ for intelligent content automation