Practical Examples
Three examples: RAG agent, multi-tool agent, LangGraph workflow.
Example 1: Doc Q&A bot (RAG agent)
Index docs/ and answer with a search tool + create_agent (see full code in the Chinese edition—structure is identical).
Key steps:
DirectoryLoader+RecursiveCharacterTextSplitterChroma+OpenAIEmbeddings@tool search_knowledge_basewrappingretriever.invokecheckpointerfor multi-turn
Validate with doc-specific questions; inspect tool I/O in LangSmith.
Example 2: Research assistant (multi-tool)
Tools: web search stub, safe math, UTC time.
Do not use eval on untrusted input in production.
Example 3: LangGraph QA workflow
Generate → check length → rewrite until OK:
Anti-patterns
Ship RAG without evals; one global thread for all users; InMemory checkpoints in prod.