Code snippets
Collect runnable code here as you go.
Naming idea: <topic>-<what-it-does>.py — e.g. memory-postgres-checkpointer.py.
Eight starter snippets already live in the full guide's appendix: first agent, swap models, memory, custom middleware, structured output, MCP tools, Deep Agent, and LangSmith tracing. Copy the ones you use into this folder and tweak them.