Internal CrewAI tools and cores - Distributed via Private PyPI
Project description
CrewAI Enterprise Tools
[!IMPORTANT] INTERNAL PACKAGE This package is for internal use only and is distributed via our Private PyPI registry. Do not publish to public PyPI.
Overview
This repository functions as a centralized Tool Registry for CrewAI agents. It bridges the gap between high-level agentic reasoning and low-level, heavy-duty processing engines.
For: AI Engineers & Agent Developers using CrewAI.
[!NOTE] A compatibility shim is applied for OCR tooling to support legacy langchain interfaces. This is only imported when OCR is used.
Environment Variables
The following environment variables are required for runtime usage:
| Variable | Description | Required For |
|---|---|---|
OPENAI_API_KEY |
OpenAI API Key (starts with sk-) |
Core Agent Logic |
GMAIL_EMAIL |
Google Workspace Email Account | Gmail Tools |
GMAIL_PASSWORD |
App Password (not login password) | Gmail Tools |
Design Philosophy
We follow a strict Four-Tier Architecture to ensure Scalability and Stability:
- Agents (Consumers): The CrewAI agents that define why a task is done.
- Tools (
tools/): The Public Interface. Lightweight wrappers that define how an agent calls a function. - Cores (
cores/): The Heavy Engines. Complex logic (external APIs, protocol handling). - MLCore (
mlcore/): The Intelligence Assets. Proprietary model weights and inference logic.
graph LR
A[Agent] -->|Imports| B(Tool Wrapper)
B -->|Calls| C[Core Engine]
C -->|Invokes| D[MLCore]
D -->|Optional HTTP| S[Persistent Server]
Discovery & Usage
Tools are located in tools/<tool_name>/tool.py.
Installation
- Clone the repository.
- Install in editable mode:
pip install -e .
Usage
Now you can import tools from anywhere on your system:
from crewai import Agent
from apolis_ai_tools import OutlookSendTool
# ... imports ...
# Instantiate
outlook_tool = OutlookSendTool()
data_agent = Agent(
role="...",
goal="...",
tools=[outlook_tool],
verbose=True
)
See individual tool READMEs for specific instructions.
Available Tools
Document Processing
- DocParserTool (
parse_document) - Extract structured data from PDFs with OCR fallback- Uses Docling + PaddleOCR for robust extraction
- Returns pages, blocks, tables, and layout information
- Documentation
Email Integration
- GmailSendTool - Send emails via Gmail SMTP
- GmailSearchTool - Search Gmail inbox with filters
- GmailDraftTool - Create email drafts
Validation
- ValidateExtractionTool - Validate extracted data with automatic confidence scoring
- Type validation (string, number, date, email, currency, percentage, etc.)
- Constraint validation (min/max, patterns, enums)
- Business rule validation
- Pre-built schemas for hotel contracts, invoices, contacts
- Documentation
Enterprise Email
- OutlookTools - Microsoft Outlook integration for enterprise environments
Installation Details
| Method | Command | Use Case |
|---|---|---|
| Editable | pip install -e . |
Best for development. Changes to code update immediately. |
| Standard | pip install . |
Best for deployment. Freezes the code version. |
[!NOTE] The package name is
apolis-ai-tools. All imports must start withapolis_ai_tools..
Strict Usage Rules
- NO Core Imports: Agents must never import from
cores/. Treatcoresas internal implementation details that may change or move to microservices. - Immutability: Do not modify tool code to fit an agent's prompt. Fix the prompt, not the tool.
- Statelessness: Tools should be stateless. If state is needed (e.g., loading a 5GB model), it must remain in the Core or a Server.
Acceleration Infrastructure
Some tools require heavy initialization.
- These tools support an optional Server Mode.
- If a local server is running, the tool automatically detects it for 10x-100x speedups.
- If not, it falls back to local execution.
- See individual tool READMEs for specific server instructions.
Versioning & Stability
- Tools: Semantic Versioning. Breaking changes to input/output schemas will be major version bumps.
- Cores: Internal APIs may change without notice. Only the Tool wrapper is guaranteed stable.
Common Anti-Patterns
- ❌ Importing
cores.tool_name_core.appdirectly in an agent script. - ❌ Hardcoding server start commands inside an agent (Servers should be long-running background processes).
- ❌ Parsing JSON outputs manually with regex (Trust the structured return).
Best Practices: Tool Implementation
When contributing new tools, choose the right implementation pattern:
1. Functional Tools (@tool)
Best for: Simple, Single-Argument Tools
- Use the simple
@tooldecorator. - Pros: Minimal code, easy to read.
- Cons: Limited schema validation. CrewAI infers schema from type hints, which can sometimes fail with complex types.
- Example:
doc_parser(Accepts a singlefile_pathstring).
2. Class-Based Tools (BaseTool + args_schema)
Best for: Complex, Multi-Argument Tools
- Create a class inheriting from
crewai.tools.BaseTool. - Define a Pydantic model for input and assign it to
args_schema. - Why?: This enforces strict validation and generation of correct JSON schemas for the LLM. It prevents common "Action Input" errors where the LLM sends unstructured data.
- Example:
gmail_tools(Requires precise distinct arguments liketo_emails,subject,body).
# Standard Pattern for Robust Tools
class MyToolInput(BaseModel):
arg1: str = Field(..., description="...")
arg2: int = Field(..., description="...")
class MyTool(BaseTool):
name: str = "my_tool"
args_schema: Type[BaseModel] = MyToolInput
def _run(self, arg1: str, arg2: int): ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apolis_ai-0.3.0.tar.gz.
File metadata
- Download URL: apolis_ai-0.3.0.tar.gz
- Upload date:
- Size: 38.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c5ccd767822aa425d9edd00f5eb8c43c9b923b27c477ec0b111da4b725625dd
|
|
| MD5 |
f79bc64b7fb227cf590ed1b9c8688fcd
|
|
| BLAKE2b-256 |
bde914efc6f3a63e90b4f80dca041f51ed1b142cb45809f0722498352399d94e
|
File details
Details for the file apolis_ai-0.3.0-py3-none-any.whl.
File metadata
- Download URL: apolis_ai-0.3.0-py3-none-any.whl
- Upload date:
- Size: 50.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f226a76494cce0068a239ac1dd3a38eeb088b57d30a721eca363a3b35e63079f
|
|
| MD5 |
9f00e08f5282b00269ed5817d2f11731
|
|
| BLAKE2b-256 |
fb87d6a743af259693b4fc2433d9338b96eaae9043cef674ef92423c5bb378a9
|