How rizwankaka/langgraph-blog-generator works
Project type and purpose
• This is a lightweight full-stack “single-page” Python application built with Streamlit.
• Purpose: let end users enter a blog topic, generate AI-powered titles and full posts with adjustable tone, audience, and length, then export to Markdown/Text.
File structure
• Top-level files only:
• langgraphBlogPost.py – the entire Streamlit UI and business logic in one script
• requirements.txt – Python dependencies
• .env – environment variables (Groq API key)
• README.md, LICENSE – docs and licensing
• No separate frontend/backend directories – everything runs in the same Python process under Streamlit.
• External configuration: the Groq API key is injected via .env
README for additional insights
• Tech stack: Python 3.12, Streamlit for UI, LangGraph SDK to orchestrate prompts, Groq (external inference API) for LLM.
• Key flows described: user input → title generation → title selection → full post generation → export.
a. Main components
1. User Browser (Client)
2. Streamlit Application (UI Layer in langgraphBlogPost.py)
3. Business Logic Modules (inside the script):
– Input Handler (topic, tone, audience, length)
– Title Generator
– Blog Post Generator
– Exporter (Markdown/Text)
4. LangGraph SDK (Python library)
5. Groq Inference API (external service)
6. .env / Config Store (API key)
b. Relationships and interactions
• User → (HTTP/WebSocket) → Streamlit UI
• Streamlit UI → Input Handler → invokes Title Generator
• Title Generator → LangGraph SDK → Groq API call → returns candidate titles → back to UI
• User selects title → triggers Blog Post Generator → again via LangGraph → Groq → full draft
• Blog Post Generator → passes output to Exporter → writes to in-memory buffer or disk (Markdown/Text)
• UI offers download link
c. Architectural patterns / design principles
• Monolithic front-and-backend: UI and logic are collocated in one script
• Event-driven flow: UI callbacks invoke sequential pipeline stages
• Dependency injection for API keys via .env
• Modular functions for extensibility (e.g., you could split each stage into its own module)
d. Key technologies & libraries
• Python 3.12
• Streamlit (UI server + widget callbacks)
• LangGraph (prompt orchestration)
• Groq API (LLM inference)
• dotenv or similar for environment loading
Additional advice
• Keep the sequence: Input → Title → Selection → Full Post → Export so stakeholders see the user journey