AI Agents with Tools
Learn how to create AI agents that can use tools to interact with external systems and perform actions.
Feature | Knowledge | Tools |
---|---|---|
Purpose | Static reference information | Dynamic interaction capabilities |
Access | Read-only reference | Execute actions and commands |
Updates | Manual through files | Real-time through tool calls |
Storage | Knowledge base | Assigned to specific agents |
Persistence | Permanent until changed | Available during agent execution |
Quick Start
Tools are functions that agents can use to interact with external systems and perform actions. They are essential for creating agents that can do more than just process text.
Creating Custom Tool
Create any function that you want to use as a tool, that performs a specific task.
Assign the tool to an agent
That's it!
Implementing Tools Full Code Example
Install PraisonAI
Install the core package:
Create Agent with Tool
Create app.py
Start Agents
Execute your script:
In-build Tools in PraisonAI
Search Tools
Tools for searching and retrieving information from various sources
Python Tools
Essential Python utilities for data manipulation and scripting
Spider Tools
Web crawling and scraping capabilities for data extraction
Arxiv Tools
Access and search academic papers from arXiv repository
Newspaper Tools
Extract and parse content from news articles and websites
DuckDB Tools
Fast analytical SQL database operations and queries
DuckDuckGo Tools
Web search functionality using DuckDuckGo’s API
Calculator Tools
Perform mathematical calculations and conversions
YAML Tools
Parse and manipulate YAML format data
JSON Tools
Handle JSON data structures and operations
Pandas Tools
Data analysis and manipulation using Pandas
YFinance Tools
Fetch financial market data from Yahoo Finance
Shell Tools
Execute shell commands and system operations
Wikipedia Tools
Access and search Wikipedia articles and data
XML Tools
Process and manipulate XML format data
File Tools
File system operations and management utilities
Excel Tools
Work with Excel spreadsheets and workbooks
CSV Tools
Handle CSV file operations and transformations
Tools Overview
Search Tools
Tools for searching and retrieving information from various sources
File Tools
Tools for reading, writing, and manipulating files
API Tools
Tools for interacting with external APIs and services
Advanced Tool Features
Tool Configuration
Tool Chaining
Tool Categories
Data Collection Tools
- Web scraping
- API integration
- Database queries
Processing Tools
- Data transformation
- Text analysis
- Image processing
Output Tools
- File generation
- Report creation
- Data visualization
Tool Integration
Adding Tools to Agents
Tool Dependencies
Tool Guidelines
Best Practices
-
Type Hints
- Use Python type hints
- Define clear input/output types
- Document complex types
-
Documentation
- Write clear docstrings
- Explain parameters
- Provide usage examples
-
Error Handling
- Handle exceptions gracefully
- Return meaningful errors
- Validate inputs
Tool Types
-
Search Tools
- Web search
- Database queries
- Document search
-
File Tools
- Read/write operations
- File conversion
- Data extraction
-
API Tools
- REST API calls
- GraphQL queries
- Service integration
Best Practices Summary
Following these best practices will help you create robust, efficient, and secure tools in PraisonAI.
Design Principles
Performance Optimization
Security Best Practices
Pro Tip: Start with these practices from the beginning of your project. It’s easier to maintain good practices than to retrofit them later.