A comprehensive Landing Page Generation Agent built with the Upsonic AI Agent Framework. This example demonstrates how to use DeepAgent with specialized subagents to generate landing page images by coordinating content creation, design recommendations, and SEO optimization, then creating the final visual.
- 🖼️ Image Generation: Generates actual landing page images (PNG format, 1536x1024)
- ✍️ Content Creation: Expert copywriting for headlines, value propositions, CTAs, and feature highlights
- 🎨 Design Recommendations: Color schemes, typography, layout structures, and visual element suggestions
- 🔍 SEO Optimization: Meta tags, keywords, header structure, and technical SEO elements
- 🤖 DeepAgent Orchestration: Automatically plans and coordinates specialized sub-agents to fulfill complex generation goals
- 🧠 Persistent Memory: SQLite-based memory for session persistence and conversation history
- 🏗️ Modular Design: Clean separation of concerns with specialized agents, schemas, and utilities
- Python 3.10+
- OpenAI API key
-
Navigate to this directory:
cd examples/landing_page_generation -
Install dependencies:
# Install all dependencies (API) upsonic install # Or install specific sections: upsonic install api # API dependencies only (default) upsonic install development # Development dependencies only
-
Set up environment variables:
export OPENAI_API_KEY="your-api-key"
To run the agent as a FastAPI server:
upsonic runThe API will be available at http://localhost:8000 with automatic OpenAPI documentation at http://localhost:8000/docs.
OR
You can run the agent directly:
uv run main.pyExample API Call:
curl -X POST http://localhost:8000/call \
-H "Content-Type: application/json" \
-d '{
"product_name": "AI Writing Assistant",
"target_audience": "Content creators and marketers",
"primary_goal": "sign up for free trial",
"key_features": ["AI-powered content", "Multiple templates", "Real-time collaboration"],
"brand_tone": "friendly and professional"
}'landing_page_generation/
├── main.py # Entry point with async main() function
├── upsonic_configs.json # Upsonic configuration and dependencies
├── orchestrator.py # DeepAgent orchestrator creation
├── subagents.py # Specialized subagent factory functions
├── schemas.py # Pydantic output schemas
├── task_builder.py # Task description builder
└── README.md # This file
-
Orchestrator Agent: A
DeepAgentthat coordinates the entire landing page generation process using planning tools and subagent delegation. -
Specialized Subagents: Three domain experts that handle specific generation areas:
- Content Writer: Creates compelling copy, headlines, CTAs, and messaging
- Designer: Provides design recommendations for colors, typography, layout, and visuals
- SEO Specialist: Optimizes for search engines with meta tags, keywords, and structure
-
DeepAgent Coordination: Instead of manually chaining tasks,
DeepAgentautomatically:- Creates execution plans using the planning tool
- Delegates tasks to appropriate specialists
- Passes context between subagents
- Synthesizes all specifications into a detailed image generation prompt
- Generates the final landing page image
-
Image Generation: Uses OpenAI's image generation capabilities to create high-quality landing page visuals based on all gathered specifications.
-
Memory Persistence: Uses SQLite database to store session history, summaries, and generation results for continuity across runs.
- Generate a landing page image for "AI Writing Assistant" targeting "content creators" with goal "sign up"
- Create a landing page image for "E-commerce Platform" targeting "small business owners" with goal "start free trial"
- Generate a landing page image for "Fitness App" targeting "health-conscious individuals" with goal "download app"
product_name(required): Name of the product or servicetarget_audience(required): Description of the target audienceprimary_goal(required): Primary conversion goal (e.g., "sign up", "purchase", "download")key_features(optional): List of key features to highlightbrand_tone(optional): Brand tone for the landing page (default: "professional")enable_memory(optional): Whether to enable memory persistence (default: true)storage_path(optional): Path for SQLite storage (default: "landing_page_generation.db")model(optional): Model identifier (default: "openai-responses/gpt-4o")output_folder(optional): Folder path for saving generated image (default: "landing_page_images")
Returns a dictionary containing:
product_name: The product name for which the landing page was generatedimage_path: Full path to the generated landing page image file (PNG format)generation_completed: Boolean indicating successful completion
The generated image incorporates all specifications from content, design, and SEO subagents into a cohesive visual landing page.