Builds a Reflection Agent using LangGraph that generates and iteratively improves LinkedIn posts. The agent uses a Generate → Reflect → Improve loop — generating content, critiquing it, and refining until quality standards are met. Demonstrates self-improving AI systems with conditional routing.
Domain: Agentic AI — Reflection Pattern
LLM: IBM Watsonx Foundation Models
Use Case: LinkedIn Post Generator with quality improvement
| Component | Technology |
|---|---|
| Workflow | LangGraph StateGraph |
| LLM | IBM Watsonx (langchain-ibm) |
| Prompts | ChatPromptTemplate (generate + reflect) |
| Visualization | pygraphviz |
- Generate node: Creates initial LinkedIn post draft
- Reflect node: Critiques content quality
- Conditional routing: Loop back or accept based on quality
- Message state management with HumanMessage/AIMessage
- Graph visualization with Mermaid/PNG
LangGraph StateGraph · Reflection pattern · Conditional routing · IBM Watsonx · Message-based state management