This directory contains comprehensive examples demonstrating all available tools and common use cases for the A2ABase Python SDK.
Each example demonstrates a specific tool from the A2ABaseTools enum:
file_manager_agent.py- DemonstratesSB_FILES_TOOLfor reading, writing, and managing filesfile_upload_agent.py- Demonstrates file operations usingSB_FILES_TOOL(note: uses available alternative)
shell_automation_agent.py- DemonstratesSB_SHELL_TOOLfor executing system commands and automationweb_development_agent.py- Demonstrates file operations (note: WEB_DEV_TOOL is deactivated, usesSB_FILES_TOOLas alternative)deployment_agent.py- DemonstratesSB_DEPLOY_TOOLfor deploying web applicationsexpose_service_agent.py- DemonstratesSB_EXPOSE_TOOLfor exposing local services to the internet
vision_analysis_agent.py- DemonstratesSB_VISION_TOOLfor analyzing and understanding imagesimage_search_agent.py- Demonstrates file operations (note: IMAGE_SEARCH_TOOL not available, usesSB_FILES_TOOLas alternative)image_editing_agent.py- DemonstratesSB_IMAGE_EDIT_TOOLfor editing and manipulating images
document_agent.py- Demonstrates file operations (note: DOCS_TOOL not available, usesSB_FILES_TOOLas alternative)spreadsheet_agent.py- Demonstrates file operations (note: SHEETS_TOOL not available, usesSB_FILES_TOOLas alternative)presentation_outline_agent.py- Demonstrates file operations (note: PRESENTATION_OUTLINE_TOOL not available, usesSB_FILES_TOOLas alternative)presentation_agent.py- Demonstrates file operations (note: PRESENTATION_TOOL not available, usesSB_FILES_TOOLas alternative)design_agent.py- Demonstrates file operations (note: DESIGN_TOOL not available, usesSB_FILES_TOOLas alternative)
knowledge_base_agent.py- Demonstrates file operations (note: KB_TOOL not available, usesSB_FILES_TOOLas alternative)data_provider_agent.py- DemonstratesDATA_PROVIDERS_TOOLfor accessing structured data
customer_support_triage.py- DemonstratesWEB_SEARCH_TOOLlead_enrichment_outreach.py- DemonstratesWEB_SEARCH_TOOLandBROWSER_TOOL
These examples demonstrate real-world scenarios using multiple tools:
research_agent.py- Comprehensive research using web search and browser toolsmarket_research_agent.py- Market research with data analysis and reportingdata_analysis_agent.py- Data analysis with files, spreadsheets, and data providers
code_review_agent.py- Code review and analysis using files and shell toolsqa_testing_agent.py- Quality assurance and testing automationcomplex_multi_agent_pipeline.py- Multi-agent workflow (already exists)
content_creation_agent.py- Comprehensive content creation workflowvisual_content_agent.py- Visual content creation and analysissocial_media_agent.py- Social media content creation and managementdocumentation_agent.py- Comprehensive documentation creation
automation_agent.py- Task automation using multiple toolsemail_automation_agent.py- Email processing and automationweb_scraping_agent.py- Web scraping and data extraction
customer_support_triage.py- Customer support automationproduct_analytics_report.py- Product analytics and reportingcontract_summary_risk.py- Contract analysislead_enrichment_outreach.py- Lead enrichmentdaily_support_digest.py- Daily support digestreport_generation_agent.py- Comprehensive report generation
All examples require the BASEAI_API_KEY environment variable to be set:
export BASEAI_API_KEY="pk_xxx:sk_xxx"
cd python
PYTHONPATH=. python3 example/<example_name>.pyTo 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 example file
Option 2: Manual Setup
- Open Google Colab
- Create a new notebook
- Copy code from any example file in this directory
- Adapt for notebook use (remove
if __name__ == "__main__"and useawaitdirectly)
Quick Start in Colab:
# Install the SDK
!pip install a2abase
import os
from a2abase import A2ABaseClient
from a2abase.tools import A2ABaseTools
# Set 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
thread = await client.Thread.create()
# Create agent
agent = await client.Agent.create(
name="Research Agent",
system_prompt="You are a research assistant.",
a2abase_tools=[A2ABaseTools.WEB_SEARCH_TOOL, A2ABaseTools.BROWSER_TOOL],
)
# Run agent
run = await agent.run("Research the latest AI developments", thread)
# Stream results
stream = await run.get_stream()
async for chunk in stream:
print(chunk, end="")Note: In Google Colab, you can use await directly in cells. Click any notebook link above to open it directly in Colab.
Each example follows this pattern:
- Import required modules
- Check for API key (fail fast with helpful error)
- Create or find an agent with appropriate tools
- Run the agent with a specific task
- Stream and print the results
- Clean up if the agent was created
All available tools from A2ABaseTools enum are covered:
- ✅ SB_FILES_TOOL
- ✅ SB_SHELL_TOOL
- ✅ SB_DEPLOY_TOOL
- ✅ SB_EXPOSE_TOOL
- ✅ SB_VISION_TOOL
- ✅ SB_IMAGE_EDIT_TOOL
- ✅ BROWSER_TOOL
- ✅ WEB_SEARCH_TOOL
- ✅ DATA_PROVIDERS_TOOL
Note: Some tools from the previous SDK version are not currently available (WEB_DEV_TOOL, SHEETS_TOOL, DOCS_TOOL, PRESENTATION_TOOL, etc.). Examples that previously used these tools have been updated to use available alternatives (primarily SB_FILES_TOOL).
- ✅ Research and Information Gathering
- ✅ Data Analysis and Reporting
- ✅ Code Review and Quality Assurance
- ✅ Content Creation (Documents, Presentations, Designs)
- ✅ Automation and Workflows
- ✅ Web Scraping and Data Extraction
- ✅ Social Media Management
- ✅ Email Automation
- ✅ Market Research
- ✅ Documentation Generation
- ✅ Visual Content Creation
- ✅ Multi-Agent Pipelines