HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/PraisonAI/docs/tools/langchain.mdx
---
title: "Langchain Tools"
description: "Guide for integrating Langchain tools and utilities with PraisonAI, including direct tool integration and wrapper implementations"
icon: "link"
---

# Langchain Tools

## Integrate Langchain Direct Tools

```bash
pip install youtube_search praisonai langchain_community langchain
```

```python
# tools.py
from langchain_community.tools import YouTubeSearchTool
```

```yaml
# agents.yaml
framework: crewai
topic: research about the causes of lung disease
roles:
  research_analyst:
    backstory: Experienced in analyzing scientific data related to respiratory health.
    goal: Analyze data on lung diseases
    role: Research Analyst
    tasks:
      data_analysis:
        description: Gather and analyze data on the causes and risk factors of lung
          diseases.
        expected_output: Report detailing key findings on lung disease causes.
    tools:
    - 'YouTubeSearchTool'
```

## Integrate Langchain with Wrappers

```bash
pip install wikipedia langchain_community
```

```python
# tools.py
from langchain_community.utilities import WikipediaAPIWrapper
class WikipediaSearchTool(BaseTool):
    name: str = "WikipediaSearchTool"
    description: str = "Search Wikipedia for relevant information based on a query."

    def _run(self, query: str):
        api_wrapper = WikipediaAPIWrapper(top_k_results=4, doc_content_chars_max=100)
        results = api_wrapper.load(query=query)
        return results
```

```yaml
# agents.yaml
framework: crewai
topic: research about nvidia growth
roles:
  data_collector:
    backstory: An experienced researcher with the ability to efficiently collect and
      organize vast amounts of data.
    goal: Gather information on Nvidia's growth by providing the Ticket Symbol to YahooFinanceNewsTool
    role: Data Collector
    tasks:
      data_collection_task:
        description: Collect data on Nvidia's growth from various sources such as
          financial reports, news articles, and company announcements.
        expected_output: A comprehensive document detailing data points on Nvidia's
          growth over the years.
    tools:
    - 'WikipediaSearchTool'
```