A comprehensive guide and demonstration of LangChain 1.0 features, including the new create_agent workflow, Human-in-the-Loop (HITL) middleware, and Multi-Agent systems.
This project also includes a RAG pipeline that ingests the official LangChain 1.0 announcement blog post to answer questions about the framework updates.
- Standard Agents: Using
create_agentwith custom tools. - Human-in-the-Loop: Pausing execution for approval using
HumanInTheLoopMiddleware. - RAG: Integrating
QdrantandOpenAIEmbeddingsto query external documents. - Multi-Agent Orchestration: Composing agents (Supervisor -> Researcher + Writer).
You'll need to ensure you have uv installed before proceeding.
# Install dependencies
uv syncYou will also need an OpenAI API Key (OPENAI_API_KEY).
The core logic is in the src/ directory, but the best way to explore is via the Jupyter Notebook.
-
Launch the Notebook:
uv run jupyter notebook langchain_v1_0_guide.ipynb
-
Run the Cells:
- The notebook will guide you through setting up your environment.
- It will demonstrate a simple agent, then a HITL agent, then a RAG agent, and finally a Multi-Agent system.
src/agent.py: Contains the agent construction logic (create_agent, middleware setup).src/rag.py: Handles the RAG pipeline (loading the blog post, chunking, vector store).src/tools.py: Simple example tools (get_weather,magic_calculator).langchain_v1_0_guide.ipynb: The interactive guide.pyproject.toml: Dependency management.langgraph.json: Configuration for deploying through LangSmith.
LangSmith is the fastest way to turn agents into production systems.
Your application's code must reside in a GitHub repository. Push this code to a new repository.
- Go to LangSmith and navigate to the Deployments tab.
- Click + New Deployment.
- Connect your GitHub repository.
- LangSmith will detect the
langgraph.jsonfile and automatically configure your deployment.- Entrypoint:
langgraph.jsondefines multiple graphs (agent,hitl_agent,rag_agent,multi_agent). You can choose which one to expose or deploy them all.
- Entrypoint:
- Set your environment variables (e.g.,
OPENAI_API_KEY) in the deployment settings. - Click Deploy.
Once deployed, you can interact with your agent via the LangSmith Studio, API, or SDK.
