An agentic AI workflow system for generating professional architecture presentations using LangGraph orchestration with multi-LLM support (Gemini & SiliconFlow).
- Overview
- Agentic AI Architecture
- System Requirements
- Installation
- Configuration
- Usage Guide
- LLM Provider Selection
- Project Structure
- Workflow Details
- Troubleshooting
ARCH-IA is an agentic AI system that automates the creation of professional presentations for architects. It uses a LangGraph-based workflow to orchestrate multiple AI agents that plan, generate, validate, and create presentation content.
- π€ Multi-LLM Support: Choose between Google Gemini or SiliconFlow (free!) as your AI provider
- π Agentic Workflow: LangGraph-orchestrated pipeline with automatic retry and quality validation
- π Smart Content Generation: Context-aware slide content with speaker-specific focus
- π¨ Template System: Professional templates for architecture presentations
- β Quality Validation: Automated content accuracy and speaker balance checks
- π Multi-Output: Google Slides API integration + PowerPoint fallback
The system implements a linear agentic workflow with conditional retry logic:
flowchart TB
subgraph "π ARCH-IA Agentic Workflow"
START((βΆ START)) --> CP
subgraph "π Planning Phase"
CP[π― Content Planner<br/>βββββββββββββ<br/>β’ Analyze topic & audience<br/>β’ Create presentation structure<br/>β’ Define speaker assignments<br/>β’ Allocate timing per slide]
end
subgraph "οΏ½οΏ½ Generation Phase"
SG[π Slide Generator<br/>βββββββββββββ<br/>β’ Select LLM provider<br/>β’ Generate slide content<br/>β’ Apply speaker-specific prompts<br/>β’ Create speaker notes]
end
subgraph "π¨ Formatting Phase"
TF[ποΈ Template Formatter<br/>βββββββββββββ<br/>β’ Apply JSON templates<br/>β’ Format for Google Slides API<br/>β’ Add design system styles<br/>β’ Structure elements]
end
subgraph "β
Validation Phase"
QV[π Quality Validator<br/>βββββββββββββ<br/>β’ Check content accuracy<br/>β’ Validate speaker balance<br/>β’ Verify timing consistency<br/>β’ Ensure template compliance]
end
subgraph "π€ Creation Phase"
SC[π Slides Creator<br/>βββββββββββββ<br/>β’ Google Slides API<br/>β’ OAuth2 authentication<br/>β’ Batch API requests<br/>β’ PowerPoint fallback]
end
CP --> SG
SG --> TF
TF --> QV
QV --> DECISION{Quality<br/>Passed?}
DECISION -->|β
Yes| SC
DECISION -->|β No & Retries Left| SG
DECISION -->|β No & Max Retries| FAIL((β FAIL))
SC --> SUCCESS((β
DONE))
end
style START fill:#4CAF50,color:#fff
style SUCCESS fill:#4CAF50,color:#fff
style FAIL fill:#f44336,color:#fff
style DECISION fill:#FF9800,color:#fff
style CP fill:#2196F3,color:#fff
style SG fill:#9C27B0,color:#fff
style TF fill:#00BCD4,color:#fff
style QV fill:#FF5722,color:#fff
style SC fill:#8BC34A,color:#fff
flowchart LR
subgraph "π€ LLM Provider Selection"
CONFIG[π batch_config.yaml<br/>llm_provider: choice] --> SWITCH{Provider?}
SWITCH -->|gemini| GEMINI[βοΈ Google Gemini<br/>βββββββββββββ<br/>β’ gemini-2.5-flash<br/>β’ 1M token context<br/>β’ Structured JSON output<br/>β’ GOOGLE_API_KEY]
SWITCH -->|siliconflow| SILICON[π SiliconFlow<br/>βββββββββββββ<br/>β’ qwen3-8b FREE<br/>β’ deepseek-r1-7b<br/>β’ glm-4-9b<br/>β’ SILICONFLOW_API_KEY]
GEMINI --> PROMPT[π Specialized Prompts<br/>βββββββββββββ<br/>β’ Speaker A: Theory<br/>β’ Speaker B: Practice<br/>β’ Layout-specific schemas]
SILICON --> PROMPT
PROMPT --> CONTENT[π Generated Content<br/>βββββββββββββ<br/>β’ Structured JSON<br/>β’ Speaker notes<br/>β’ Visual descriptions]
end
style GEMINI fill:#4285F4,color:#fff
style SILICON fill:#00D4FF,color:#000
style CONFIG fill:#FFC107,color:#000
stateDiagram-v2
[*] --> INITIALIZED: Workflow Start
INITIALIZED --> PLANNING: content_planner_node
PLANNING --> GENERATING: slide_generator_node
GENERATING --> FORMATTING: template_formatter_node
FORMATTING --> VALIDATING: quality_validator_node
VALIDATING --> GENERATING: Retry (quality failed)
VALIDATING --> CREATING: Proceed (quality passed)
VALIDATING --> FAILED: Max retries exceeded
CREATING --> COMPLETED: Success
CREATING --> COMPLETED: Fallback (PowerPoint)
FAILED --> [*]
COMPLETED --> [*]
- Python: 3.9 or higher
- Operating System: Linux, macOS, or Windows
- Memory: 4GB RAM minimum (8GB recommended)
- API Keys: At least one of:
GOOGLE_API_KEYfor GeminiSILICONFLOW_API_KEYfor SiliconFlow (FREE!)
git clone https://github.com/your-username/iarch.git
cd iarchpython -m venv venv
source venv/bin/activate # Linux/macOS
# or
.\venv\Scripts\activate # Windowspip install -r requirements.txtCreate a .env file in the project root:
# Choose ONE or BOTH providers:
# Option A: SiliconFlow (FREE - Recommended for testing)
SILICONFLOW_API_KEY=your_siliconflow_api_key_here
# Option B: Google Gemini
GOOGLE_API_KEY=your_google_api_key_hereGetting API Keys:
| Provider | Free Tier | Get Key |
|---|---|---|
| π SiliconFlow | β Generous free tier | cloud.siliconflow.cn |
| βοΈ Google Gemini | β Free with limits | makersuite.google.com |
For Google Slides output, you need OAuth2 credentials:
- Go to Google Cloud Console
- Create a new project or select existing
- Enable the Google Slides API and Google Drive API
- Create OAuth 2.0 credentials (Desktop application)
- Download and save as
credentials.jsonin project root
# =============================================================================
# LLM Provider Configuration
# =============================================================================
# Choose your LLM provider: "siliconflow" (FREE) or "gemini"
llm_provider: "siliconflow" # <-- Change this to switch providers
# SiliconFlow Settings (FREE models available)
siliconflow_model: "qwen3-8b" # Options: qwen3-8b, deepseek-r1-7b, glm-4-9b
siliconflow_temperature: 0.3
# Gemini Settings
gemini_model: "gemini-2.5-flash"
gemini_temperature: 0.3
# =============================================================================
# Workflow Settings
# =============================================================================
max_retries: 5 # Max retry attempts for quality validation
min_accuracy_score: 0.3 # Minimum content accuracy (0-1)
min_speaker_balance: 0.4 # Speaker time balance threshold
# =============================================================================
# Output Configuration
# =============================================================================
output_directory: "output"
template_directory: "templates"
google_credentials_path: "credentials.json"# Run with default settings (90-minute architecture presentation)
python main.py# Custom topic and duration
python main.py --topic "AI in Urban Design" --duration 60
# Specify audience
python main.py --audience "Architecture Students" --duration 45python main.py --help
Options:
--topic TEXT Presentation topic (default: ARCH-IA standard)
--audience TEXT Target audience (default: Professional architects)
--duration INT Duration in minutes (default: 90)
--config TEXT Configuration file path (default: batch_config.yaml)
--log-level TEXT Logging level: DEBUG, INFO, WARNING, ERROR
--validate-config Only validate configuration without running
--output-format TEXT Output: google_slides, powerpoint, or both# Check configuration without running workflow
python main.py --validate-config# Run with detailed logging
python main.py --log-level DEBUGSiliconFlow offers free access to high-quality open-source models:
# In batch_config.yaml
llm_provider: "siliconflow"
siliconflow_model: "qwen3-8b" # Best free optionAvailable Free Models:
| Model | Description | Best For |
|---|---|---|
qwen3-8b |
Qwen3 8B parameters | General content |
deepseek-r1-7b |
DeepSeek reasoning model | Technical content |
glm-4-9b |
GLM-4 vision-thinking | Complex reasoning |
glm-z1-9b |
GLM-Z1 model | Balanced performance |
hunyuan-7b |
Tencent Hunyuan | Chinese-English |
Google Gemini offers excellent performance with a generous free tier:
# In batch_config.yaml
llm_provider: "gemini"
gemini_model: "gemini-2.5-flash"Available Models:
| Model | Context | Best For |
|---|---|---|
gemini-2.5-flash |
1M tokens | Fast, cost-effective |
gemini-1.5-pro |
2M tokens | Complex tasks |
Simply change the llm_provider value in batch_config.yaml:
# Use SiliconFlow (free)
llm_provider: "siliconflow"
# Or use Gemini
llm_provider: "gemini"iarch/
βββ main.py # οΏ½οΏ½ Entry point & CLI interface
βββ batch_config.yaml # βοΈ Main configuration file
βββ requirements.txt # π¦ Python dependencies
βββ .env # π API keys (create this)
β
βββ src/ # π Source code
β βββ __init__.py
β βββ models.py # π Pydantic models & state definitions
β βββ workflow.py # π LangGraph workflow orchestration
β βββ gemini_client.py # βοΈ Google Gemini API client
β βββ siliconflow_client.py # π SiliconFlow API client
β βββ template_formatter.py # π¨ Slide template formatting
β βββ quality_validator.py # β
Content quality validation
β βββ slides_creator.py # π Google Slides & PPTX creation
β βββ retry_utils.py # π Retry logic & rate limiting
β
βββ templates/ # πΌοΈ Slide templates
β βββ title_slide_template.json
β βββ content_slide_template.json
β βββ quote_slide_template.json
β βββ ...
β
βββ output/ # π€ Generated presentations
βββ logs/ # π Execution logs
βββ temp/ # ποΈ Temporary files
Purpose: Creates the presentation structure based on ARCH-IA requirements.
Input:
- Topic, audience, duration
- Speaker configuration (Data Scientist vs Fullstack Dev)
Output:
PresentationPlanwith slide structure- Speaker assignments per slide
- Timing allocations
Purpose: Generates content for each slide using the selected LLM.
Process:
- Selects LLM client (Gemini or SiliconFlow)
- Creates speaker-specific prompts
- Generates structured JSON content
- Includes speaker notes and visual descriptions
Prompt Structure:
Speaker A (Data Scientist) β Theory, math, history, ANI/AGI concepts
Speaker B (Fullstack Dev) β Practice, tools, prompting, workflows
Purpose: Applies ARCH-IA design system to generated content.
Process:
- Loads JSON templates from
templates/ - Formats content for Google Slides API
- Applies colors, typography, positioning
- Adds branding elements
Purpose: Ensures content meets quality thresholds.
Metrics Validated:
| Metric | Description | Threshold |
|---|---|---|
| Content Accuracy | Technical correctness | 0.3 |
| Speaker Balance | A/B time distribution | 0.4 |
| Timing Consistency | Adds up to target duration | β/β |
| Template Compliance | Required fields present | β/β |
| Concept Coverage | ARCH-IA topics covered | 0.3 |
Retry Logic:
- If validation fails β Retry slide generation (up to 5x)
- If max retries exceeded β Workflow fails
Purpose: Creates the final presentation.
Primary: Google Slides API
- OAuth2 authentication
- Batch API requests
- Rate limiting (300 req/min)
Fallback: PowerPoint (python-pptx)
- Used when Google API unavailable
- Full feature parity
flowchart TD
subgraph "π₯ Input"
IN1[Topic]
IN2[Audience]
IN3[Duration]
IN4[Config YAML]
end
subgraph "π Processing"
STATE[(PresentationState<br/>TypedDict)]
STATE --> |topic, audience| PLAN[Create Plan]
PLAN --> |presentation_plan| GEN[Generate Content]
GEN --> |slides_data| FMT[Format Slides]
FMT --> |formatted_slides| VAL[Validate Quality]
VAL --> |quality_metrics| CREATE[Create Output]
end
subgraph "π€ Output"
OUT1[Google Slides URL]
OUT2[PowerPoint File]
OUT3[Execution Logs]
end
IN1 & IN2 & IN3 --> STATE
IN4 --> |WorkflowConfig| STATE
CREATE --> OUT1
CREATE --> OUT2
STATE --> OUT3
style STATE fill:#E1BEE7,color:#000
# Solution: Add to .env file
echo "SILICONFLOW_API_KEY=your_key_here" >> .env# Solution: Add to .env file
echo "GOOGLE_API_KEY=your_key_here" >> .env# Solution: Delete token and re-authenticate
rm token.json
python main.py
# Follow OAuth flow in browserThe system has built-in retry with exponential backoff. If persistent:
# In batch_config.yaml
max_retries: 10
retry_base_delay: 2.0
retry_max_delay: 128.0Lower the thresholds for testing:
# In batch_config.yaml
min_accuracy_score: 0.2
min_speaker_balance: 0.3# Enable detailed logging
python main.py --log-level DEBUG
# Check logs
tail -f logs/arch_ia_*.logMIT License - See LICENSE for details.
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
Built with β€οΈ using LangGraph + Gemini/SiliconFlow