Skip to content

ranahaani/autogram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– AutoGram

AutoGram is an intelligent AI agent that automates AI news curation and Instagram content management. It seamlessly collects tech news, generates engaging visuals, and maintains your social media presence - all on autopilot.

Demo

๐Ÿ”„ Collect โ†’ ๐Ÿง  Analyze โ†’ ๐ŸŽจ Create โ†’ ๐Ÿ“ฑ Share

โœจ Key Features

  • Smart News Aggregation: Automatically collects and filters AI & tech news
  • AI-Powered Content Creation: Generates unique, branded images for each post
  • Automated Instagram Management: Handles posting and scheduling
  • Performance Analytics: Tracks engagement and optimizes content strategy
  • Self-Learning: Improves content selection based on performance
  • Brand Consistency: Maintains your visual identity across all posts
  • Multi-Model Image Generation: Supports both OpenAI GPT Image and Replicate models

๐Ÿ› ๏ธ Tech Stack

  • Core Engine: Python 3.9+
  • AI Services:
    • Google Gemini (content analysis)
    • OpenAI GPT Image (primary image generation)
    • Replicate ideogram (alternative image generation)
  • News Sources: GNews API
  • Social Platform: Instagram API
  • Processing: aiohttp, asyncio
  • Validation: Pydantic
  • Image Handling: Pillow

๐Ÿš€ Quick Start

  1. Clone & Install
git clone https://github.com/ranahaani/autogram.git
cd autogram
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
  1. Configure Environment
# Create .env file
cp .env.example .env

# Add your API keys
GEMINI_API_KEY=your_key_here
OPENAI_API_KEY=your_openai_key_here
REPLICATE_API_TOKEN=your_token_here
IG_USERNAME=your_username
IG_PASSWORD=your_password
  1. Configure Agent
// config.json
{
    "name": "AutoGram",
    "post_frequency": 3,
    "max_news_age": 24,
    "output_dir": "./output",
    "brand_theme": {
        "primary_color": "#FF6B6B",
        "secondary_color": "#4ECDC4",
        "font_style": "modern"
    },
    "image_generation": {
        "default_provider": "openai",
        "providers": {
            "openai": {
                "model": "gpt-image-1",
                "size": "1024x1024",
                "quality": "medium"
            },
            "replicate": {
                "model": "ideogram-ai/ideogram-v2"
            }
        }
    }
}
  1. Launch
python main.py

๐Ÿ“Š Monitoring Dashboard

๐Ÿ“ˆ Performance Metrics
- Posts Created: 125
- Engagement Rate: 3.2%
- Top Performing Topics: AI, Machine Learning, Tech Innovation
- Average Likes: 234
- Comment Rate: 2.1%

โš™๏ธ Advanced Configuration

Image Generation Settings

You can configure which AI model to use for image generation in config.json:

  1. OpenAI GPT Image (Default)
{
    "image_generation": {
        "default_provider": "openai",
        "providers": {
            "openai": {
                "model": "gpt-image-1",
                "size": "1024x1024",
                "quality": "medium"
            }
        }
    }
}
  1. Replicate Ideogram
{
    "image_generation": {
        "default_provider": "replicate",
        "providers": {
            "replicate": {
                "model": "ideogram-ai/ideogram-v2"
            }
        }
    }
}

Custom News Sources

class NewsSource:
    async def fetch(self) -> List[NewsItem]:
        # Your custom news source logic
        pass

Content Templates

TEMPLATES = {
    "tech_news": "Modern minimalist tech visualization: {title}",
    "ai_update": "Futuristic AI concept representing: {content}",
    "innovation": "Creative tech breakthrough visual for: {topic}"
}

๐Ÿ”„ Workflow

graph LR
    A[News Collection] --> B[AI Analysis]
    B --> C[Content Generation]
    C --> D[Image Creation]
    D --> E[Instagram Posting]
    E --> F[Performance Analysis]
    F --> A
Loading

๐Ÿšง Error Handling

AutoGram includes robust error handling:

  • Automatic retry mechanisms
  • Graceful degradation
  • State persistence
  • Error notifications
  • Performance monitoring

๐Ÿ“ฑ Sample Output

๐Ÿ“ธ Generated Post Example:
- Title: "Breaking: New AI Model Achieves Human-Level Performance"
- Image: Modern tech visualization (via OpenAI GPT Image)
- Hashtags: #AI #TechNews #Innovation #FutureOfTech
- Engagement: 543 likes, 27 comments

๐Ÿ›ก๏ธ Best Practices

  1. Content Strategy

    • Post during peak engagement hours
    • Maintain consistent branding
    • Use trending hashtags
    • Monitor performance metrics
  2. System Management

    • Regular log monitoring
    • Backup configuration files
    • Update API keys periodically
    • Monitor resource usage

๐Ÿ”ฎ Roadmap

  • Multi-model image generation support
  • AI-powered hashtag optimization
  • Advanced analytics dashboard
  • Custom template builder
  • Engagement automation
  • A/B testing system

๐Ÿค Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.

๐Ÿ“œ License

AutoGram is licensed under the MIT License - see the LICENSE file for details.


Built with โค๏ธ by the ranahaani@gmail.com

Copyright ยฉ 2025 AutoGram

About

AI agent that automates AI news curation and post to Instagram using gpt-image-1

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages