How harsha943vf/ai-blog-generator works
This repository generates blog posts through a Streamlit interface and two backend workflows: a LangGraph pipeline with optional research and images, and a separate structured five-step pipeline. The main path classifies a topic, gathers sources when needed, plans and writes sections, then assembles markdown. The graph also preserves the structured workflow and shared model/configuration layer. Relationships for the main pipeline are shown in its wiring; some unsampled implementation details are represented only where documented or supported by the source index.
Main entry points: pipeline.py LangGraph pipeline · config.py LLM configuration · research.py Web research · app.py Streamlit interface
Components 20
User interface
- Streamlit interface
app.py
Blog generation
- Generation service
backend/service.py - LangGraph pipeline
backend/pipeline.py - Topic router
backend/nodes/router.py - Web research
backend/nodes/research.py - Blog planner
backend/nodes/orchestrator.py - Section writer
backend/nodes/worker.py - Markdown reducer
backend/nodes/reducer.py - Image generation
backend/nodes/images.py
Structured workflow
- Structured service
backend/structured_service.py - Structured stages
backend/structured_pipeline.py - Structured prompts
backend/structured_prompts.py
Shared services
- Pipeline state
backend/models.py - Search utilities
backend/tavily_utils.py - LLM configuration
backend/config.py - Retry and cache
backend/utils.py
External services
- Language model provider
- Tavily Search
- Google Gemini Imagen
Other components
- Blog author
Connections 23
- Blog author → Streamlit interface: submits topic
README.md - Streamlit interface → Generation service: requests generation
app.py - Generation service → LangGraph pipeline: invokes graph
backend/service.py - LangGraph pipeline → Topic router: routes to
backend/pipeline.py - LangGraph pipeline → Web research: routes when needed
backend/pipeline.py - LangGraph pipeline → Blog planner: routes to
backend/pipeline.py - LangGraph pipeline → Section writer: routes to
backend/pipeline.py - LangGraph pipeline → Markdown reducer: routes to
backend/pipeline.py - LangGraph pipeline → Image generation: routes optionally
backend/pipeline.py - Web research → Search utilities: uses
backend/nodes/research.py - Web research → Tavily Search: searches
README.md - Section writer → Markdown reducer: provides sections
backend/pipeline.py - Image generation → Google Gemini Imagen: generates images
README.md - Structured service → Structured stages: calls workflow stages
backend/structured_service.py - Structured stages → Structured prompts: uses prompts
backend/structured_pipeline.py - LLM configuration → Language model provider: creates client
backend/config.py - Topic router → LLM configuration: gets model
backend/nodes/router.py - Blog planner → LLM configuration: gets model
backend/nodes/orchestrator.py - Section writer → LLM configuration: gets model
backend/nodes/worker.py - Web research → LLM configuration: gets model
backend/nodes/research.py - LangGraph pipeline → Pipeline state: uses graph state
backend/pipeline.py - Generation service → Retry and cache: uses cache
backend/service.py - Streamlit interface → Structured service: offers demo workflow