hahz hahz Admin OP 2 months ago

TL;DR

Start by installing the LangChain package and using the create_agent function to build your first agent with any model provider.
hahz hahz Admin OP 2 months ago

Learning Resources
LangChain Academy offers self-guided courses on building with LangChain and LangGraph. The official documentation now features a completely redesigned site alongside the 1.0 releases.

hahz hahz Admin OP 2 months ago

Language Options
LangChain is primarily a Python framework, with TypeScript support also available. For document-heavy workloads, LlamaIndex may be a better fit. For production TypeScript teams building agents with built-in Studio environments, Mastra offers a compelling alternative.

hahz hahz Admin OP 2 months ago
Quick Start Steps

1. Install LangChain
bash

pip install langchain

2. Set Up Your Model Provider
LangChain supports any model provider with one-line changes. For OpenAI, set your API key:

bash

export OPENAI_API_KEY="your-key-here"

3. Build Your First Agent
LangChain 1.0 introduces the create_agent abstraction:

python
from langchain.agents import create_agent

weather_agent = create_agent(
model="openai:gpt-5",
tools=[get_weather],
system_prompt="Help the user by fetching the weather in their city.",
)

result = agent.invoke({"role": "user", "what's the weather in SF?"})

4. Add Middleware for Customization
python
from langchain.agents.middleware import HumanInTheLoop, SummarizationMiddleware

agent = create_agent(
"openai:gpt-4o-mini",
tools=[weather_tool],
middleware=[HumanInTheLoop(), SummarizationMiddleware()],
prompt="Help the user by fetching the weather in their city.",

hahz hahz Admin OP 2 months ago

To get started with LangChain, install the package, set up your model provider API key, and build your first agent using the new create_agent abstraction in LangChain 1.0. The framework supports Python 3.10+ and is designed for rapid prototyping across any model provider.