A2ABase SDK for Python
Project description
BaseAI Python SDK
One SDK. Unlimited Tools. Build AI Agents in Minutes.
Official Python SDK for building powerful AI agents with access to 50+ built-in tools, 300+ integrations, and all major LLMs—all through a single, unified platform.
🎥 Watch the Demo
🚀 Why BaseAI?
Stop juggling multiple tools, APIs, and accounts. BaseAI consolidates everything you need into one simple SDK.
The Problem You're Solving
Building AI agents today means:
- ❌ Managing 10+ different API keys and accounts
- ❌ Integrating multiple libraries and SDKs
- ❌ Searching for the right tools and benchmarking
- ❌ Building custom integrations from scratch
- ❌ Dealing with authentication and security concerns
- ❌ Paying multiple subscription fees
The BaseAI Solution
One SDK. One API key. Everything you need.
- ✅ 50+ built-in tools - Everything from web search to image editing to web development
- ✅ 300+ MCP integrations - Access 200+ Composio integrations (Gmail, Slack, GitHub, etc.) plus custom MCP servers
- ✅ All LLMs in one place - Unified access to multiple language models
- ✅ Isolated sandboxes - Secure execution environments built-in
- ✅ Pay-as-you-go pricing - 80% cheaper than alternatives
- ✅ Type-safe SDK - Full IDE support for Python
Install one SDK. Access everything. Build a working prototype in minutes.
💰 Pricing
Pay-As-You-Go Model
BaseAI uses transparent, pay-as-you-go pricing with no hidden fees.
80% Cheaper Than Alternatives
Unlike traditional platforms that require:
- Multiple subscription fees for different services
- Per-user licensing costs
- Minimum monthly commitments
- Platform lock-in fees
BaseAI charges you only for what you use, when you use it. No minimums. Just simple, transparent pricing that scales with your needs.
What You Get
- Access to all tools - No per-tool pricing
- All LLMs - Unified access without separate accounts
- 300+ integrations - No per-integration fees
- Isolated sandboxes - Included at no extra cost
- Full SDK support - Python SDK included
Get started today: Get your API key
Installation
pip install a2abase-sdk
📦 Published on PyPI: https://pypi.org/project/a2abase-sdk/
Or install directly from GitHub:
pip install git+https://github.com/A2ABaseAI/sdks.git#subdirectory=python
Requirements
- Python 3.11+
- See requirements.txt for dependencies
🚀 Quick Start
import asyncio
import os
from a2abase import A2ABaseClient
from a2abase.tools import A2ABaseTools
async def main():
api_key = os.getenv("BASEAI_API_KEY")
if not api_key:
raise ValueError("Please set BASEAI_API_KEY environment variable")
client = A2ABaseClient(api_key=api_key, api_url="https://a2abase.ai/api")
thread = await client.Thread.create()
agent = await client.Agent.create(
name="My Assistant",
system_prompt="You are a helpful AI assistant.",
a2abase_tools=[A2ABaseTools.WEB_SEARCH_TOOL],
)
run = await agent.run("Hello, how are you?", thread)
stream = await run.get_stream()
async for chunk in stream:
print(chunk, end="")
asyncio.run(main())
🔑 Getting Your API Key
- Sign up at BaseAI
- Get your API key from the dashboard
- Set it as an environment variable:
export BASEAI_API_KEY="pk_xxx:sk_xxx"
That's it! You're ready to build.
🛠️ Available Tools
The SDK provides access to tools through the A2ABaseTools enum and MCPTools class:
File Management
SB_FILES_TOOL- Read, write, and edit files in the sandbox
Development & Automation
SB_SHELL_TOOL- Execute shell commands in isolated sandboxesSB_DEPLOY_TOOL- Deploy web applications to productionSB_EXPOSE_TOOL- Expose local services to the internet
Image & Vision
SB_VISION_TOOL- Analyze and understand images with AISB_IMAGE_EDIT_TOOL- Edit and manipulate images
Search & Browser
WEB_SEARCH_TOOL- Search the web for informationBROWSER_TOOL- Browse websites and interact with web pages (navigate, click, fill forms, scroll)
Research & Intelligence
- People search - Search for people and enrich profiles
- Company search - Search for companies and business information
- Paper search - Search academic papers and research documents
- Web search - General web search capabilities
Knowledge & Data
DATA_PROVIDERS_TOOL- Access structured data from providers:- LinkedIn - Professional network data
- Yahoo Finance - Financial market data
- Amazon - Product and marketplace data
- Zillow - Real estate data
- Twitter - Social media data
- ActiveJobs - Job listings data
Agent Management
- Agent creation - Create and configure AI agents
- Agent configuration - Manage agent settings and versions
- Workflow management - Create and manage agent workflows
- Trigger management - Set up automated triggers
- Credential profiles - Manage API credentials
Task Management
- Task list - Create, update, and manage tasks organized by sections
- Task tracking - Track completion status and progress
- Batch operations - Manage multiple tasks at once
Communication
- Message tool - Ask questions, inform users, and mark completion
- Message expansion - Expand truncated messages from previous conversations
Automation
- Computer use - Control sandbox browser and GUI (mouse, keyboard, screenshots)
- Document parser - Parse and extract data from documents
Templates & Scaffolding
- Project templates - Generate projects from predefined templates
- Template search - Search and discover available templates
🔌 MCP Integrations
BaseAI supports 300+ MCP (Model Context Protocol) integrations through Composio and custom MCP servers, allowing you to connect any MCP-compatible server. MCPs can be connected via:
- HTTP/HTTPS endpoints
- SSE (Server-Sent Events)
- stdio (standard input/output)
Composio MCP Integrations (200+)
BaseAI integrates with Composio.dev to provide access to 200+ pre-configured MCP servers including:
Productivity & Communication
- Gmail, Google Calendar, Slack, Microsoft Teams, Notion, Linear, Asana, Jira, Trello, Airtable
Code & Development
- GitHub, GitLab, Bitbucket, Docker Hub, AWS, Google Cloud Platform, Azure
CRM & Sales
- Salesforce, HubSpot, Pipedrive, Zoho CRM, Intercom
Data & Analytics
- Google Sheets, Google Drive, Dropbox, Airtable, MongoDB, PostgreSQL, MySQL
Marketing & Social
- Twitter/X, LinkedIn, Facebook, Instagram, Mailchimp, SendGrid
E-commerce & Payments
- Shopify, Stripe, PayPal, WooCommerce, Square
And 150+ more integrations including project management tools, databases, cloud services, APIs, and business applications.
Custom MCP Servers
You can also connect any custom MCP-compatible server by providing the MCP endpoint URL. This enables integration with any tool, API, or service that follows the Model Context Protocol standard.
Usage
Creating an Agent
import asyncio
from a2abase import A2ABaseClient
from a2abase.tools import A2ABaseTools, MCPTools
async def main():
client = A2ABaseClient(api_key="your-api-key", api_url="https://a2abase.ai/api")
# Create an agent with A2ABase tools
agent = await client.Agent.create(
name="My Agent",
system_prompt="You are a helpful assistant.",
a2abase_tools=[A2ABaseTools.WEB_SEARCH_TOOL, A2ABaseTools.SB_FILES_TOOL],
)
# Or create an agent with MCP tools
mcp_tool = MCPTools(endpoint="https://your-mcp-server.com", name="My MCP Server")
await mcp_tool.initialize() # Initialize to discover available tools
agent_with_mcp = await client.Agent.create(
name="My MCP Agent",
system_prompt="You are a helpful assistant.",
a2abase_tools=[mcp_tool],
)
asyncio.run(main())
Running an Agent
import asyncio
from a2abase import A2ABaseClient
from a2abase.tools import A2ABaseTools
async def main():
client = A2ABaseClient(api_key="your-api-key", api_url="https://a2abase.ai/api")
# Create a thread
thread = await client.Thread.create()
# Get or create an agent (see "Creating an Agent" section above)
agent = await client.Agent.create(
name="My Agent",
system_prompt="You are a helpful assistant.",
a2abase_tools=[A2ABaseTools.WEB_SEARCH_TOOL],
)
# Run the agent
run = await agent.run("Your task here", thread)
# Stream the response
stream = await run.get_stream()
async for chunk in stream:
print(chunk, end="")
asyncio.run(main())
Finding an Existing Agent
import asyncio
from a2abase import A2ABaseClient
async def main():
client = A2ABaseClient(api_key="your-api-key", api_url="https://a2abase.ai/api")
# Find agent by name
agent = await client.Agent.find_by_name("My Agent")
if agent:
# Use the existing agent
pass
asyncio.run(main())
📚 Examples
Comprehensive examples are available in the example/ directory, demonstrating:
- Tool-Specific Examples: Each tool from
A2ABaseToolsenum with practical use cases - Common Use Cases: Real-world scenarios like research, content creation, automation, and more
See the examples README for a complete list of available examples.
Running Examples
Python:
- Run scripts:
cd python && PYTHONPATH=. python3 example/<name>.py - Run in Google Colab: See Running Examples in Google Colab for instructions
Running All Examples
cd python
PYTHONPATH=. python3 example/run_all_examples.py
Running Examples in Google Colab
To run examples in Google Colab:
Option 1: Open from GitHub
- Go to Google Colab
- Click "File" → "Open notebook"
- Select the "GitHub" tab
- Enter:
A2ABaseAI/sdks - Navigate to
python/example/quick_start.ipynbor any.pyfile
Option 2: Manual Setup
- Open Google Colab
- Create a new notebook
- Copy the code from any example file
- Adapt it for notebook use (remove
if __name__ == "__main__"and useawaitdirectly)
Quick Start in Colab:
# Install the SDK
!pip install a2abase-sdk
import os
from a2abase import A2ABaseClient
from a2abase.tools import A2ABaseTools
# Set your API key (use Colab's secrets or environment variables)
os.environ['BASEAI_API_KEY'] = 'pk_xxx:sk_xxx'
# Create client
client = A2ABaseClient(api_key=os.getenv("BASEAI_API_KEY"), api_url="https://a2abase.ai/api")
# Create thread and agent
thread = await client.Thread.create()
agent = await client.Agent.create(
name="My Assistant",
system_prompt="You are a helpful AI assistant.",
a2abase_tools=[A2ABaseTools.WEB_SEARCH_TOOL],
)
# Run the agent
run = await agent.run("Hello, how are you?", thread)
stream = await run.get_stream()
# Stream and display results
async for chunk in stream:
print(chunk, end="")
Note: In Google Colab, you can use await directly in cells without asyncio.run().
🧪 Testing
The SDK includes comprehensive test coverage:
- 166 tests covering all functionality
- 99.83% code coverage across all modules
- Tests for agents, threads, tools, API clients, and models
- Full async/await support testing
Run tests locally:
cd python
uv sync --group dev
uv run pytest tests/ -v
📖 Documentation
- PyPI Package: https://pypi.org/project/a2abase-sdk/
- GitHub Repository: https://github.com/A2ABaseAI/sdks
- Full Documentation: See the repository for more examples and API reference.
💬 Support
Need help? Join our Discord community for support and discussions:
- Discord: https://discord.gg/qAncfHmYUm
🤝 Contributing
Contributions are welcome! Please see our contributing guidelines.
📄 License
MIT License - see LICENSE file for details.
Project details
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 a2abase-0.1.0.tar.gz.
File metadata
- Download URL: a2abase-0.1.0.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4f74c684434d9700c92948e20aa740f87d179a6c00b06a7c50366f441d67a83
|
|
| MD5 |
4a01275ac9e0c033077c8dd5ced0c6cf
|
|
| BLAKE2b-256 |
2e506bd23c7f7fbe6045e34643693ff3b9ef95d599926e44f12b0d9772506dd2
|
File details
Details for the file a2abase-0.1.0-py3-none-any.whl.
File metadata
- Download URL: a2abase-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
660d4adc85b8f53eb8307994d23599d272d299f9e383b6fc693152ef65113d68
|
|
| MD5 |
45153c8c291eacfb6a709a67e8cedbb4
|
|
| BLAKE2b-256 |
1387679ecc5e113ab5e90b669f3d6f02f8fd68e1cd440d0ca4537b5476dcfff2
|