An End-to-End Agentic AI Application for Intelligent Blog Generation with Multi-Language Support
- 🎯 Problem Statement
- 💡 Solution Approach
- 🏗️ System Architecture
- 🔄 Workflow Visualization
- 🛠️ Tech Stack
- 📁 Project Structure
- ⚙️ Installation & Setup
- 🚀 Usage
- 📊 Sample Outputs
- 🔍 LangSmith Tracing
- 🧠 Key Learnings
- 🔮 Future Enhancements
- 📄 License
- 👨💻 Author
In today's digital landscape, content creation faces several critical challenges:
| Problem | Impact |
|---|---|
| Time-Consuming Content Creation | Writers spend 3-4 hours on average to create a single comprehensive blog post |
| Language Barriers | Businesses struggle to reach global audiences due to lack of multilingual content |
| Inconsistent Quality | Manual content creation leads to varying quality and tone across articles |
| Scalability Issues | Traditional content workflows can't scale to meet growing content demands |
| SEO Optimization | Creating SEO-friendly titles and content requires specialized expertise |
"A tech company wants to publish blog content about emerging technologies in multiple languages to reach their global audience. They need consistent, high-quality, SEO-optimized content that maintains cultural relevance across translations."
- How can we automate blog generation while maintaining quality?
- How do we handle multi-language content generation with cultural adaptation?
- How can we create a modular, scalable content generation pipeline?
- How do we orchestrate multiple AI agents to work together seamlessly?
I implemented an Agentic AI System using LangGraph that breaks down the complex task of blog generation into specialized, autonomous agents that collaborate to produce high-quality content.
┌─────────────────────────────────────────────────────────────────────────┐
│ AGENTIC AI PARADIGM │
├─────────────────────────────────────────────────────────────────────────┤
│ Traditional AI vs. Agentic AI (This Project) │
│ ───────────────── ───────────────────────── │
│ • Single monolithic model • Multiple specialized agents │
│ • One-shot generation • Multi-step orchestrated flow │
│ • No state management • Stateful conversation │
│ • Limited control flow • Conditional routing & branching │
│ • Hard to debug/trace • Full observability (LangSmith) │
└─────────────────────────────────────────────────────────────────────────┘
| Feature | Benefit |
|---|---|
| State Management | Maintains context across all nodes, ensuring coherent content |
| Conditional Routing | Dynamically routes to appropriate translation agent based on input |
| Graph Visualization | Clear understanding of workflow with visual representation |
| Fault Tolerance | Each node can handle errors independently |
| Observability | Full tracing with LangSmith for debugging and optimization |
graph TD
A[User Input] -->|topic + language| B[FastAPI Server]
B --> C{GraphBuilder}
C -->|topic only| D[Topic Graph]
C -->|topic + language| E[Language Graph]
D --> F[Title Agent]
F --> G[Content Agent]
G --> H[Return Blog]
E --> I[Title Agent]
I --> J[Content Agent]
J --> K[Router Agent]
K -->|hindi| L[Hindi Translator]
K -->|french| M[French Translator]
L --> N[Return Translated Blog]
M --> N
┌──────────────────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ (REST API / LangGraph Studio) │
└────────────────────────────────┬─────────────────────────────────────────┘
│ HTTP POST /blogs
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ APPLICATION LAYER │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ FastAPI App │───▶│ GraphBuilder │───▶│ StateGraph │ │
│ │ (app.py) │ │ (graph_builder) │ │ (LangGraph) │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└────────────────────────────────┬─────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ AGENT LAYER │
│ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
│ │ Title Agent │ │ Content Agent │ │ Route Agent │ │
│ │ │ │ │ │ │ │
│ │ • SEO Title │ │ • Detailed │ │ • Language │ │
│ │ • Creative │ │ Content │ │ Detection │ │
│ │ • Markdown │ │ • Markdown │ │ • Routing │ │
│ └───────────────┘ └───────────────┘ └───────────────┘ │
│ │ │
│ ┌───────────────────┼───────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────┐ │
│ │Hindi Translator│ │French Translator│ │ More... │ │
│ │ │ │ │ │ │ │
│ │• Cultural │ │• Cultural │ │ │ │
│ │ Adaptation │ │ Adaptation │ │ │ │
│ └──────────────┘ └──────────────┘ └───────────┘ │
└────────────────────────────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ LLM LAYER │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Groq LLM (GPT-OSS-120B) │ │
│ │ │ │
│ │ • Ultra-fast inference (~10x faster than traditional APIs) │ │
│ │ • High-quality text generation │ │
│ │ • Cost-effective for production workloads │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ OBSERVABILITY LAYER │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ LangSmith │ │
│ │ │ │
│ │ • Full trace of agent execution │ │
│ │ • Token usage monitoring │ │
│ │ • Latency tracking │ │
│ │ • Debug failed runs │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ BlogState │
├─────────────────────────────────────────────────────────────────┤
│ { │
│ "topic": "Agentic AI in Healthcare", │
│ "current_language": "hindi", │
│ "blog": { │
│ "title": "Generated SEO Title...", │
│ "content": "Detailed blog content..." │
│ } │
│ } │
└─────────────────────────────────────────────────────────────────┘
│
┌─────────────────────┼─────────────────────┐
▼ ▼ ▼
[Title Node] [Content Node] [Translation Node]
Updates: title Updates: content Updates: content
(translated)
The above diagram shows the complete LangGraph workflow:
- START → Entry point of the graph
- title_creation → Generates SEO-optimized blog title
- content_generation → Creates detailed blog content
- route → Determines the target language
- Conditional Edge → Routes to appropriate translator
- hindi_translation / french_translation → Translates content
- END → Returns final state
| Category | Technology | Purpose |
|---|---|---|
| Framework | LangGraph | Agentic workflow orchestration |
| LLM | Groq (GPT-OSS-120B) | Fast, high-quality text generation |
| API | FastAPI | RESTful API server |
| State Management | TypedDict + Pydantic | Type-safe state handling |
| Tracing | LangSmith | Observability & debugging |
| Language | Python 3.13+ | Modern Python features |
| Technology | Rationale |
|---|---|
| LangGraph over LangChain Agents | Better control flow, explicit state management, and visual debugging |
| Groq over OpenAI | 10x faster inference, cost-effective, comparable quality |
| FastAPI over Flask | Async support, automatic OpenAPI docs, type hints |
| Pydantic | Runtime type validation, automatic serialization |
Agentic-Blog-Generator/
│
├── 📄 app.py # FastAPI application entry point
├── 📄 main.py # Alternative entry point
├── 📄 langgraph.json # LangGraph Studio configuration
├── 📄 requirements.txt # Project dependencies
├── 📄 pyproject.toml # Python project metadata
├── 📄 README.md # Project documentation (you're here!)
│
├── 📁 src/ # Source code package
│ ├── 📄 __init__.py
│ │
│ ├── 📁 graphs/ # LangGraph workflow definitions
│ │ ├── 📄 __init__.py
│ │ └── 📄 graph_builder.py # Graph construction logic
│ │
│ ├── 📁 llms/ # LLM configurations
│ │ ├── 📄 __init__.py
│ │ └── 📄 groqllm.py # Groq LLM wrapper
│ │
│ ├── 📁 nodes/ # Agent node implementations
│ │ ├── 📄 __init__.py
│ │ └── 📄 blog_node.py # Blog generation nodes
│ │
│ └── 📁 states/ # State definitions
│ ├── 📄 __init__.py
│ └── 📄 blogstate.py # BlogState TypedDict
│
├── 📁 assets/ # Images and media
│ ├── 🖼️ blog_generation_flow.png
│ ├── 🖼️ output_1.png # Hindi output screenshot
│ ├── 🖼️ output_2.png # French output screenshot
│ └── 🖼️ sample_input.png # LangSmith input screenshot
│
└── 📁 outputs/ # Generated content samples
├── 📄 output_results.txt # English blog output
├── 📄 output_results_hindi.txt # Hindi translated blog
└── 📄 output_results_french.txt # French translated blog
- Python 3.13 or higher
- Groq API Key (Get it here)
- LangSmith API Key (Optional, for tracing)
git clone https://github.com/BrijeshRakhasiya/Agentic-Blog-Generator.git
cd Agentic-Blog-Generator# Using venv
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Or using uv (recommended)
uv venv
source .venv/bin/activate# Using pip
pip install -r requirements.txt
# Or using uv
uv pip install -r requirements.txtCreate a .env file in the root directory:
# Required
GROQ_API_KEY=your_groq_api_key_here
# Optional (for LangSmith tracing)
LANGCHAIN_API_KEY=your_langsmith_api_key_here
LANGCHAIN_TRACING_V2=true
LANGCHAIN_PROJECT=agentic-blog-generator# Start the FastAPI server
python app.py
# Or using uvicorn directly
uvicorn app:app --host 0.0.0.0 --port 8000 --reloadThe API will be available at http://localhost:8000
POST /blogs
{
"topic": "Agentic AI in Healthcare",
"language": "hindi" // Optional: "hindi", "french", or omit for English
}curl -X POST "http://localhost:8000/blogs" \
-H "Content-Type: application/json" \
-d '{"topic": "Future of Artificial Intelligence"}'curl -X POST "http://localhost:8000/blogs" \
-H "Content-Type: application/json" \
-d '{"topic": "Agentic AI in Healthcare", "language": "hindi"}'curl -X POST "http://localhost:8000/blogs" \
-H "Content-Type: application/json" \
-d '{"topic": "AI in Automotive Industry", "language": "french"}'{
"data": {
"topic": "Agentic AI in Healthcare",
"current_language": "hindi",
"blog": {
"title": "एजेंटिक एआई इन हेल्थकेयर: इंटेलिजेंट मेडिसिन के भविष्य में एक गहन विश्लेषण",
"content": "... detailed translated content ..."
}
}
}You can also visualize and test the graph using LangGraph Studio:
langgraph devThe above screenshot shows the input configuration in LangSmith tracing interface.
📖 Click to see Hindi Output Content
एजेंटिक एआई इन हेल्थकेयर: इंटेलिजेंट मेडिसिन के भविष्य में एक गहन विश्लेषण
द्वारा [Your Name], एआई & हेल्थकेयर थॉट लीडर
प्रकाशित: दिसंबर 2025
सामग्री-सूची
# सेक्शन
1 एजेंटिक एआई क्या है?
2 हेल्थकेयर क्यों है एजेंटिक सिस्टम्स का परफेक्ट प्लेग्राउंड?
3 मुख्य आर्किटेक्चरल स्तम्भ
4 प्रमुख उपयोग‑केस और वास्तविक‑विश्व कार्यान्वयन
5 टेक्निकल ब्लूप्रिंट: एजेंटिक हेल्थकेयर प्लेटफ़ॉर्म बनाना
...
📖 Click to see French Output Content
AI dans l'automobile : Plongée approfondie dans le futur de la mobilité
Par un·e rédacteur·rice expert·e en technologies automobiles
Table des matières
# Section Idée clé
1 Introduction Pourquoi l'IA est le moteur qui propulse la prochaine révolution automobile
2 Bref historique de l'IA dans les voitures Du régulateur de vitesse au niveau 5 d'autonomie
3 Technologies IA de base Capteurs, perception, prise de décision et actionnement
4 Applications concrètes aujourd'hui ADAS, conduite autonome, maintenance prédictive...
...
| Aspect | English | Hindi | French |
|---|---|---|---|
| Topic | Agentic AI in Healthcare | Agentic AI in Healthcare | AI in Automotive |
| Title Style | SEO-optimized | Culturally adapted | Professionally localized |
| Content Format | Markdown tables, headers | Same structure, Hindi text | Same structure, French text |
| Cultural Adaptation | ✓ | ✓ Idioms adapted | ✓ Idioms adapted |
This project integrates with LangSmith for complete observability:
- Full Trace Visualization: See every step of the agent workflow
- Token Usage: Monitor LLM token consumption
- Latency Tracking: Identify performance bottlenecks
- Error Debugging: Debug failed runs with full context
- Run Comparison: Compare different runs side by side
The LangSmith trace shows:
- Input processing (topic + language)
- Title generation step
- Content generation step
- Routing decision
- Translation execution
- Final output
| Learning | Description |
|---|---|
| State Graph Design | Designing state schemas that flow cleanly through nodes is crucial |
| Conditional Routing | LangGraph's conditional edges enable dynamic workflow branching |
| Agent Specialization | Breaking tasks into specialized agents improves output quality |
| Error Handling | Each node should handle errors gracefully to prevent cascade failures |
- Single Responsibility: Each node does one thing well
- State Immutability: Nodes return new state updates, not mutations
- Composability: Graphs can be composed into larger workflows
- Observability First: Built-in tracing from day one
| Challenge | Solution |
|---|---|
| State persistence across nodes | Used TypedDict with proper field definitions |
| Dynamic language routing | Implemented conditional edges with route_decision function |
| LLM response consistency | Added structured prompts with clear formatting instructions |
| Translation quality | Included cultural adaptation instructions in prompts |
| Priority | Enhancement | Description |
|---|---|---|
| 🔴 High | More Languages | Add Spanish, German, Japanese, Chinese support |
| 🔴 High | Image Generation | Integrate DALL-E/Stable Diffusion for blog images |
| 🟡 Medium | SEO Analysis | Add keyword density, readability score analysis |
| 🟡 Medium | Content Caching | Redis-based caching for repeated topics |
| 🟢 Low | Voice Generation | Text-to-speech for audio blog versions |
| 🟢 Low | Scheduling | Automated blog generation on schedule |
Q1 2025: Multi-language support (10+ languages)
Q2 2025: Image generation integration
Q3 2025: SEO optimization agent
Q4 2025: Full CMS integration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 Brijesh Rakhasiya
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



