LangChain
The leading framework for building LLM-powered applications and agents with chains, tools, memory, and retrieval.
LangChain
LangChain is the most widely adopted framework for composing LLM-powered applications. It provides abstractions for chaining LLM calls, attaching tools and retrievers, managing conversation memory, and building full agentic loops — all through a composable, provider-agnostic API.
Key Features
- Chains & LCEL — compose prompts, models, and output parsers with the LangChain Expression Language pipe syntax
- Tool use — attach any callable as a tool; includes 100+ pre-built integrations (search, databases, APIs)
- Memory — short-term buffer, summary, entity, and vector-store-backed long-term memory
- Retrieval — document loaders, text splitters, vector store retrievers, and rerankers
- Agents — ReAct, OpenAI Functions, and custom agent executors with streaming support
- Callbacks — first-class tracing hooks for LangSmith, Arize, W&B, and more
Quick Start
pip install langchain langchain-openai
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
llm = ChatOpenAI(model="gpt-4o")
prompt = ChatPromptTemplate.from_messages([
("system", "You are a helpful assistant."),
("user", "{question}")
])
chain = prompt | llm
response = chain.invoke({"question": "What is the capital of France?"})
print(response.content)
Install via ai-supply
npx ai-supply add langchain-agent-framework
Curated mirror of the open-source LangChain project (MIT). Install upstream from the repository.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/langchain-agent-framework/check). Click a policy:
Consume LangChain programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/langchain-agent-framework
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/langchain-agent-framework/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add langchain-agent-framework
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/langchain-agent-framework/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "langchain-agent-framework" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.