| Strategy | LangChain class / API | LangGraph role | Token cost | Structured out | Multi-turn | Agent fit | LC doc status |
|---|---|---|---|---|---|---|---|
| Zero-shot | PromptTemplate | Simple node prompts | Low | ✕ | ✕ | 4/10 | Legacy |
| Few-shot | FewShotChatMessagePromptTemplate | Example injection in system prompt | Medium | Partial | ✓ | 6.5/10 | Active |
| Chain-of-thought | ChatPromptTemplate + system msg | Planner / reasoner node | High | Partial | ✓ | 9/10 | Active |
| ReAct | create_react_agent (LangGraph) | Core agent loop Think→Act→Observe | Very high | ✓ | ✓ | 10/10 | Recommended |
| Role / Persona | ChatPromptTemplate system msg | Agent identity / specialization | Low | Partial | ✓ | 7/10 | Active |
| Structured output | with_structured_output() / bind_tools() | Output node, tool-call parsing | Medium | ✓ | ✓ | 9.5/10 | Recommended |
| Memory / history | MessagesPlaceholder + MemorySaver | Stateful graph across turns | High | ✓ | ✓ | 9/10 | Active |
| Prompt versioning | LangSmith commits + tags | Prod/staging lifecycle | — | — | — | — | Recommended |
- from langchain.prompts import PromptTemplate (root import)
- Completion-style prompts as default
- LLMChain + SequentialChain for chaining steps
- AgentExecutor for ReAct agents
- FewShotPromptTemplate for string-based few-shot
- Memory via ConversationBufferMemory
- No native structured output enforcement
- Prompts hardcoded inside application code
- from langchain_core.prompts import ChatPromptTemplate
- Chat-style prompts as default (system/human/ai roles)
- LCEL
|pipe operator replaces all chain classes - create_react_agent (LangGraph prebuilt) replaces AgentExecutor
- FewShotChatMessagePromptTemplate for chat-native few-shot
- MessagesPlaceholder + MemorySaver / SqliteSaver
- with_structured_output() / bind_tools() as first-class API
- Prompts versioned in LangSmith Hub (commits, tags, environments)