iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up
« Previous

LangChain HOME

Welcome to the iwantcoding.com LangChain Tutorial. LangChain is the most popular framework for composing LLM apps. Chains, agents, RAG, tools, memory — behind one consistent runnable interface, with first-class evaluation and observability.

What this tutorial covers

ChapterYou will learn
LangChain BasicsInstall, chat & LLM models, prompt templates, output parsers, LCEL (Expression Language).
Building BlocksChains, runnables, streaming, memory, callbacks, tools, agents, structured outputs.
RAGDocument loaders, text splitters, embeddings, vector stores, retrievers, full RAG chains.
ProductionLangGraph (stateful agents), LangSmith (eval & tracing), LangServe, caching, evals, safety.
ExamplesCheatsheet, runnable snippets, quiz, exercises, bootcamp, certificate.

Who this is for

  • App devs adding AI features.
  • RAG builders integrating internal docs.
  • Anyone graduating from a Jupyter notebook to a shippable agent.
How to use this tutorial: read the chapter, run the example with Try it Yourself », do the exercise, then take the quiz at the bottom. Hit Mark complete when you're done — the sidebar will track your progress.

Example

Example
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate

llm = ChatOpenAI(model='gpt-4o-mini')
prompt = ChatPromptTemplate.from_messages([
    ('system', 'You speak like a pirate.'),
    ('human', '{question}'),
])
chain = prompt | llm
print(chain.invoke({'question': 'Why is the sky blue?'}).content)
Try it Yourself »

Exercise

Run a Runnable.

chain. ({'question': 'hi'})

Discussion

Loading…

« Previous