tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Agentic AI > CrewAI > CrewAI with LangChain Tools

CrewAI with LangChain Tools

Author: Venkata Sudhakar

CrewAI agents support LangChain tools natively - you can pass any LangChain tool directly to an agent's tools list without any wrapper. This gives CrewAI agents access to the entire LangChain tool ecosystem: web search, Wikipedia, Python REPL, SQL databases, calculators, and hundreds of community-built integrations. For ShopMax India, this means agents can search for competitor pricing, query product databases, and run calculations without custom code.

Pass tools to an agent using the tools parameter. The agent's LLM decides when to call a tool based on the task description. Tools from langchain_community.tools work directly. You can also wrap any Python function as a LangChain tool using the @tool decorator from langchain_core.tools and pass it alongside standard tools.

The following example gives a ShopMax India price research agent a custom LangChain tool that looks up product prices in a mock database, plus a calculator tool for margin calculations.


It gives the following output,

The Sony Headphones WH-1000XM5 is priced at Rs 24,990 at ShopMax India.
With a cost price of Rs 18,000, the gross margin is 27.9%.

Any LangChain community tool - such as DuckDuckGoSearchRun for web search or WikipediaQueryRun for reference lookups - can be imported and passed directly to the agent's tools list in the same way. For ShopMax India agents that need live data, combine a search tool with a custom database tool so agents can blend real-time web information with internal product data in a single task run.


 
  


  
bl  br