The Pythoneers

Your home for innovative tech stories about Python and its limitless possibilities. Discover, learn, and get inspired.

Member-only story

Create Custom AI Agents using LangChain Tools with Python

Amit Chauhan
The Pythoneers
Published in
7 min readFeb 20, 2025

--

Photo by Igor Omilaev on Unsplash

What are AI Agents?

In simple terms, Agents are a system that uses Large Language Models as a brain that will take action based on decision makers i.e. agent types that can be ReAct or other types of Agents. LLMs need to use tools to do some action to expand their capabilities other than just giving text output.

Tools are just functions to get more information from the external world. There are built-in and custom tools, the built-in tools can be web search
engines, python REPL, RAG, and custom tools can be API calls, database interaction, custom web scrapping, IoT device interactions, etc.

Topics to be covered

  1. Tool creation @tool method
  2. Invoke custom tool manually with LLM
  3. Creating AI Agent with a custom tool
  4. Example of real-world application

Tool creation @tool method

This is the simplest method to make a custom tool for an AI Agent. In this method, the decorator takes the function name as a tool name that can be used further use with the llm.

# Syntax Example:

from…

--

--

The Pythoneers
The Pythoneers

Published in The Pythoneers

Your home for innovative tech stories about Python and its limitless possibilities. Discover, learn, and get inspired.

Amit Chauhan
Amit Chauhan

Written by Amit Chauhan

Data Scientist, AI/ML/DL, Azure Cloud

Responses (1)