Implementation:ANative Lab EvoAgentX ToolExamples
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Examples, Tools |
| Last Updated | 2026-10-21 00:00 GMT |
Overview
Concrete example scripts demonstrating integration of search, database, image, Gmail, and API converter toolkits with EvoAgentX agents.
Description
The `examples/tools/` directory contains comprehensive example scripts demonstrating each toolkit category:
- tools_search.py (748 lines) — Demonstrates all search tools: `GoogleSearchToolkit`, `DDGSSearchToolkit`, `WikipediaSearchToolkit`, `SerpAPISearchToolkit`, `SerperAPISearchToolkit`, `ExaSearchToolkit`. Shows API key setup and search result handling.
- tools_database.py (455 lines) — Demonstrates `MongoDBToolkit` and `PostgreSQLToolkit` for database operations — CRUD, queries, and schema management.
- tools_images.py (336 lines) — Demonstrates `OpenAIImageToolkit`, `FluxImageGenerationToolkit`, and `OpenRouterImageToolkit` for image generation, editing, and analysis.
- tools_converters.py (423 lines) — Demonstrates `APITool` and `APIToolkit` to wrap REST API endpoints as agent tools. Shows request formatting, authentication, and response parsing.
- gmail_example.py (516 lines) — Demonstrates `GmailToolkit` for email operations — message retrieval, thread reading, draft creation, and sending. Requires Gmail API OAuth setup.
Usage
- Search tools: Run `tools_search.py` to test different search provider integrations.
- Database tools: Run `tools_database.py` to test MongoDB and PostgreSQL operations.
- Image tools: Run `tools_images.py` to test image generation and analysis.
- API converters: Run `tools_converters.py` to learn how to wrap REST APIs as tools.
- Gmail integration: Run `gmail_example.py` to test Gmail API operations.
Code Reference
Source Location
- Repository: EvoAgentX
- Search Example: examples/tools/tools_search.py (L1-748)
- Database Example: examples/tools/tools_database.py (L1-455)
- Images Example: examples/tools/tools_images.py (L1-336)
- Converters Example: examples/tools/tools_converters.py (L1-423)
- Gmail Example: examples/tools/gmail_example.py (L1-516)
Signature
# Example scripts demonstrating tool integration
# Each script creates a CustomizeAgent with the relevant toolkit
# and demonstrates tool-calling workflows
Import
from evoagentx.tools.search_exa import ExaSearchToolkit
from evoagentx.tools.search_ddgs import DDGSSearchToolkit
from evoagentx.tools.database_mongodb import MongoDBToolkit
from evoagentx.tools.database_postgresql import PostgreSQLToolkit
from evoagentx.tools.image_tools.openai_image_tools.toolkit import OpenAIImageToolkit
from evoagentx.tools.image_tools.flux_image_tools.toolkit import FluxImageGenerationToolkit
from evoagentx.tools.api_converter import APITool, APIToolkit
from evoagentx.tools.gmail_tools import GmailToolkit
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| api_keys | str | Yes (paid tools) | API keys from environment variables |
| credentials | str | Yes (Gmail) | OAuth credentials path |
Outputs
| Name | Type | Description |
|---|---|---|
| stdout | str | Example output showing tool results |
Usage Examples
Run Search Example
# python examples/tools/tools_search.py
# Demonstrates all search toolkit integrations
Run Database Example
# python examples/tools/tools_database.py
# Demonstrates MongoDB and PostgreSQL toolkit operations
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment