LangChain

Key Components of LangChain

Tools

LangChain’s tools allow your applications to interact with external functions, services, and APIs—enabling sophisticated AI-driven workflows that go beyond pure language generation.

The image is a diagram labeled "Tools" featuring three icons for "Functions," "Services," and "API," each with a distinct color and symbol.

Built-In Tools

LangChain ships with a suite of preconfigured tools for common data sources. Use these when you need reliable access to real-time information or specialized content that enriches your language model’s output.

Tool NameDescriptionUsage Example
WikipediaFetch summaries and article contenttool.run("Tell me about the Apollo missions")
YouTubeRetrieve video metadata and transcriptstool.run("Get video transcript for 'Intro to Python'")
Google SearchPerform web searches with snippetstool.run("Latest news on renewable energy")

The image shows the LangChain logo with icons for Wikipedia, YouTube, and Google Search, labeled as tools.

Creating Custom Tools

When your project requires integration with proprietary services or data sources not covered by the built-in library, you can define a custom tool in just a few steps:

  1. Specify the input schema (usually text).
  2. Call your external API or service.
  3. Format and return the response in a structured form.

Note

Custom tools fit seamlessly into LangChain’s architecture—just implement the run method and register your tool with an agent or chain.

The image is a flowchart showing a process where a user inputs text into a custom tool, which then produces an output.

Toolkits and Agents

  • Toolkits: Group related tools into a single package for streamlined access.
  • Agents: Automatically select and invoke the appropriate tool(s) based on the user’s query.

Combining toolkits with agents unlocks fully autonomous AI pipelines: your application can decide which services to call, compose results, and deliver a coherent response—all without manual orchestration.

Watch Video

Watch video content

Previous
Chains
Next
Agents