An Autonomous AI-Powered Twitter/X Agent
"Intelligent content creation with personality-driven engagement"
Personal Project | 2025
Why build an autonomous social media bot?
Consistent social media presence requires significant daily time investment
Manual posting often misses optimal engagement windows
Engaging with relevant content is overwhelming at scale
Leverage LLMs for personality-consistent, high-quality content
X Bot: Key Capabilities
| Feature | Description |
|---|---|
| 🤖 Autonomous Posting | Generates original tweets based on configurable personality |
| 📖 Intelligent Reading | Scans timeline, identifies posts matching interests |
| 💡 Inspiration Engine | Creates content inspired by curated interesting posts |
| 🔔 Notification Handling | Monitors mentions and replies for engagement |
| 🧠 Memory System | Avoids duplicate content using vector embeddings |
| 📊 Web Dashboard | Real-time monitoring, analytics, settings, and live control |
| 💬 Reply Workflows | Checks mentions/replies and queues notifications for processing |
APScheduler
Posting • Reading • Notifications • Replies • Inspiration
Selenium + undetected-chromedriver + stealth
Generation, validation, reading, notifications workflows
OpenRouter • OpenAI • Google • Anthropic
Embedding cache + duplicate detection (0.85)
JSON runtime state + SQLite analytics
Jinja2 + HTMX + Chart.js + live settings reload
Configurable bot personality via YAML
From timeline reading to intelligent posting
Selenium extraction
LLM evaluation
Store interesting
Inspiration batch
Re-evaluation
Publish to X
ChromaDB vector storage for intelligent memory
0.85data/chroma/ for persistenceFull monitoring and configuration interface
Bot status, uptime, activity stats, rate limit progress
Read, written, rejected, and interesting posts with tabs
Interactive tweet generation with post-to-X option
Hourly token usage graph with Chart.js, provider breakdown
Real-time log viewer with filtering and auto-scroll
Live configuration editing with instant reload
| Limit | Value |
|---|---|
| Max posts/day | 15 |
| Max replies/day | 50 |
| Reset time | 00:00 UTC |
| Action delay | 1-3 seconds (randomized) |
Roadmap and repository snapshot
Dashboard walkthrough
Bot status, uptime, rate limits, activity feed
Read/written/rejected/interested posts with pagination
Token usage graph, provider breakdown, hourly stats
Live configuration with instant scheduler reload
http://localhost:8000
| Layer | Technology |
|---|---|
| Language | Python >= 3.13 with full type hints |
| AI Orchestration | LangChain + LangGraph |
| Providers | OpenRouter, OpenAI, Google, Anthropic |
| Configured Model | x-ai/grok-4.1-fast (OpenRouter) |
| Embeddings | text-embedding-3-small |
| Vector DB | ChromaDB (persistent local storage) |
| Browser | undetected-chromedriver + selenium-stealth |
| Scheduling | APScheduler (background scheduler) |
| State & Analytics | JSON state + SQLite (aiosqlite) |
| Challenge | Solution |
|---|---|
| X/Twitter bot detection | undetected-chromedriver + selenium-stealth |
| LLM provider reliability | Multi-provider fallback (OpenRouter → OpenAI → Google) |
| Rate limiting enforcement | Per-day counters with UTC reset logic |
| Duplicate content prevention | Vector embeddings + cosine similarity threshold |
| Async complexity | Full async/await architecture with aiosqlite |
| Configuration management | YAML config + Pydantic validation + live reload |
Planned enhancements
Clean separation of concerns with dedicated modules for each responsibility
Pydantic v2 models throughout for validation and documentation
Resilient AI integration with automatic fallback between providers
Full dashboard with analytics, logs, and real-time status
Rate limits, bot disclosure, human-like behavior patterns
Easy to add new features, providers, and integrations
Thank you for your attention!
Available on request
Your contact info here