An AI-Powered Automated Content Orchestration Agent
PromptStream is a full-stack AI application designed to transform long-form blog posts into platform-optimized social media content using advanced prompt engineering and Large Language Models (LLMs). It automates the tedious process of content atomization by extracting web content, analyzing its context, and generating tailored posts for Twitter, LinkedIn, and Instagram simultaneously.
Content creators and marketing teams often spend hours manually repurposing blog posts into platform-specific snippets. PromptStream solves this bottleneck by acting as an intelligent linguistic translator. By simply providing a URL, the application scrapes the article, detects its tone and category, and synthesizes ready-to-publish, format-specific social media content.
This project leverages a modern, modular Python stack to ensure high performance, maintainability, and seamless AI integration:
- Backend Framework: FastAPI & Uvicorn (for high-performance REST APIs)
- Frontend Interface: Streamlit (for a reactive, data-driven web UI)
- Web Scraping & Data Extraction: BeautifulSoup4 & Requests
- AI / LLM Integration: Groq API (Llama 3 Models) & Google Generative AI (Gemini Models)
- Configuration Management: Pydantic & python-dotenv
- Language: Python 3.11
Building PromptStream demonstrated proficiency in several key areas of software engineering and artificial intelligence:
- Full-Stack Python Development: Architecting a decoupled system with a FastAPI backend and a Streamlit frontend.
- Applied AI & Prompt Engineering: Designing complex, zero-shot system prompts to enforce specific personas (e.g., Thread Architect for Twitter, Professional Curator for LinkedIn, Visual Narrator for Instagram).
- Web Scraping & DOM Parsing: Building robust web scrapers capable of extracting meaningful content from raw HTML while filtering out noise.
- RESTful API Design: Creating modular and well-documented API endpoints that handle cross-origin requests and asynchronous processing.
- Third-Party API Integration: Seamlessly integrating and switching between leading LLM providers (Groq and Google Gemini) based on configuration.
-
Software Architecture: Implementing a clean, component-based architecture separating concerns (Scraper
$\rightarrow$ Category Detector$\rightarrow$ Orchestrator).
PromptStream integrates state-of-the-art Large Language Models (LLMs) to drive its core logic.
- Models Used: Supports Groq's high-speed inference (defaulting to
llama-3.3-70b-versatile) and Google'sgemini-1.5-flash. - Category & Context Detection: The AI first acts as an analyzer, reading the scraped text to determine the category, tone, themes, target audience, and key insights.
- Multi-Persona Generation: Using the gathered context, the LLM is prompted via dynamically constructed instructions to generate three distinct outputs simultaneously, ensuring each post adheres strictly to the character limits, formatting rules, and stylistic nuances of its target platform.
PromptStream offers two distinct interfaces to cater to different user needs:
- Web Interface (Streamlit): A polished, interactive web application where users can paste a blog URL, select target platforms via a sleek UI, and view the AI's analysis alongside the generated markdown-formatted posts in expandable panels.
- REST API (FastAPI): A programmatic interface exposing a
/api/generateendpoint, allowing developers to integrate the orchestration pipeline into their own automated workflows.
The repository is organized into a clean, decoupled architecture:
PromptStream/
├── backend/ # Core backend logic and APIs
│ ├── main.py # FastAPI application entry point
│ ├── scraper.py # BeautifulSoup web scraping logic
│ ├── category_detector.py # LLM-based context and tone analysis
│ ├── orchestrator.py # Pipeline coordinator (Scrape -> Analyze -> Generate)
│ ├── prompts.py # Platform-specific system prompts
│ └── routes/api.py # REST endpoints
├── frontend/ # User Interface
│ └── app.py # Streamlit web application
├── config/ # Application configuration
│ └── settings.py # Pydantic environment validation
└── requirements.txt # Project dependencies
(Briefly explain how to run the project locally. Example below:)
- Clone the repository.
- Install dependencies:
pip install -r requirements.txt - Configure your API keys in a
.envfile (GROQ_API_KEYorGEMINI_API_KEY). - Start the backend:
uvicorn backend.main:app --reload - Start the frontend:
streamlit run frontend/app.py
This project is licensed under the MIT License.