Skip to main content

SkillBroker CrewAI Integration

Add expert knowledge to your CrewAI crews with SkillBroker - the marketplace where AI agents pay for human expertise.

Installation

pip install skillbroker-crewai

Quick Start

Basic Agent with Expert Tool

from crewai import Agent, Task, Crew
from skillbroker_crewai import SkillBrokerTool

# Create a tool for a specific skill
tax_tool = SkillBrokerTool(
    skill_id="freelancer-tax-advisor",
    name="Tax Advisor",
    description="Get expert advice on freelancer and self-employment tax questions"
)

# Create an agent with the tool
tax_agent = Agent(
    role="Tax Consultant",
    goal="Provide accurate tax advice to freelancers",
    backstory="You are an expert tax consultant specializing in self-employment taxes.",
    tools=[tax_tool],
    verbose=True
)

# Create a task
task = Task(
    description="Help me understand if I can deduct my home office expenses as a freelancer",
    agent=tax_agent,
    expected_output="Detailed tax advice about home office deductions"
)

# Run the crew
crew = Crew(agents=[tax_agent], tasks=[task])
result = crew.kickoff()
print(result)

Dynamic Expert Tool

Let the agent automatically find the right skill:

from crewai import Agent, Task, Crew
from skillbroker_crewai import SkillBrokerExpertTool

# This tool can handle any domain question
expert_tool = SkillBrokerExpertTool()

# Create a research agent
research_agent = Agent(
    role="Research Assistant",
    goal="Answer complex questions using expert knowledge",
    backstory="You have access to a marketplace of human experts.",
    tools=[expert_tool],
)

task = Task(
    description="What's the best way to structure a holding company for tax efficiency?",
    agent=research_agent,
    expected_output="Expert advice on holding company structure"
)

crew = Crew(agents=[research_agent], tasks=[task])
result = crew.kickoff()

Searching for Skills

from skillbroker_crewai import SkillBrokerSearchTool

# Create a search tool
search_tool = SkillBrokerSearchTool()

# Find relevant skills
results = search_tool.run("financial planning")
print(results)

Using the Client Directly

from skillbroker_crewai import SkillBrokerClient

client = SkillBrokerClient()

# Get registry info
info = client.get_registry_info()
print(f"Total skills available: {info['stats']['totalSkills']}")

# Search for skills
results = client.search("machine learning")
for skill in results.skills:
    print(f"- {skill.name}: {skill.description}")

# Invoke a skill directly
response = client.invoke("skill-id", "Your question here")
print(response.response)

Configuration

Environment Variables

# Optional: Override the API URL (defaults to https://api.skillbroker.io)
export SKILLBROKER_API_URL="https://api.skillbroker.io"

# Optional: API key for authenticated requests
export SKILLBROKER_API_KEY="your-api-key"

Programmatic Configuration

from skillbroker_crewai import SkillBrokerClient, SkillBrokerTool

# Configure client
client = SkillBrokerClient(
    api_url="https://api.skillbroker.io",
    api_key="your-api-key",
    timeout=30,
)

# Configure tools
tool = SkillBrokerTool(
    skill_id="my-skill",
    api_url="https://api.skillbroker.io",
    api_key="your-api-key",
)

Available Tools

Tool Description
SkillBrokerTool Invoke a specific skill by ID
SkillBrokerSearchTool Search the marketplace for skills
SkillBrokerExpertTool Automatically find and invoke the best skill

Multi-Agent Crew Example

from crewai import Agent, Task, Crew, Process
from skillbroker_crewai import SkillBrokerTool, SkillBrokerSearchTool

# Create specialized tools
tax_tool = SkillBrokerTool(
    skill_id="freelancer-tax-advisor",
    name="Tax Advisor",
    description="Tax advice for freelancers"
)

legal_tool = SkillBrokerTool(
    skill_id="contract-reviewer",
    name="Contract Advisor",
    description="Contract and legal document review"
)

search_tool = SkillBrokerSearchTool()

# Create specialized agents
tax_agent = Agent(
    role="Tax Specialist",
    goal="Provide accurate tax guidance",
    backstory="Expert in freelancer taxation",
    tools=[tax_tool],
)

legal_agent = Agent(
    role="Legal Advisor",
    goal="Review contracts and legal matters",
    backstory="Specializes in freelancer contracts",
    tools=[legal_tool],
)

research_agent = Agent(
    role="Research Coordinator",
    goal="Find the right experts for any question",
    backstory="Connects users with domain experts",
    tools=[search_tool],
)

# Create tasks
tax_task = Task(
    description="Analyze tax implications of the new contract",
    agent=tax_agent,
    expected_output="Tax analysis report"
)

legal_task = Task(
    description="Review the contract terms",
    agent=legal_agent,
    expected_output="Contract review with recommendations"
)

# Run as a crew
crew = Crew(
    agents=[research_agent, tax_agent, legal_agent],
    tasks=[tax_task, legal_task],
    process=Process.sequential
)

result = crew.kickoff()

API Reference

SkillBrokerClient

client = SkillBrokerClient(api_url=None, api_key=None, timeout=30)

# Methods
client.get_registry_info() -> dict
client.search(query=None, category=None, limit=20) -> SearchResult
client.get_skill(skill_id) -> Skill
client.invoke(skill_id, query, context=None) -> SkillResponse
client.get_categories() -> list
client.get_top_skills(limit=10, category=None) -> list[Skill]
client.get_recommendations(task_description, limit=5) -> list[Skill]

Models

from skillbroker_crewai import Skill, SkillResponse, SkillQuery

# Skill attributes
skill.id
skill.name
skill.description
skill.category
skill.pricing
skill.stats
skill.quality

# Response attributes
response.success
response.response
response.skill_id
response.tokens_used
response.cost

Support

License

MIT License - see LICENSE file for details.

Metadata

Release files for skillbroker-crewai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skillbroker-crewai 0.1.0
File Size Uploaded
skillbroker_crewai-0.1.0.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for skillbroker-crewai 0.1.0
File Interpreter ABI Platform
skillbroker_crewai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / skillbroker_crewai-0.1.0.tar.gz

Download URL skillbroker_crewai-0.1.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bb5ffaca1e25d069c431cae33021166e9e2297a497fcf0fbe0969067bb12b6d9
BLAKE2b-256 checksum
How to use checksums
8f12fe54883f97ce54548c186c3995c826c61e9a25b4aa555856113ff15c459e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / skillbroker_crewai-0.1.0-py3-none-any.whl

Download URL skillbroker_crewai-0.1.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b95a4b0753b650ebc64230b5e56effc77bd6990ce7f280297d5ca53450fe5033
BLAKE2b-256 checksum
How to use checksums
96655bb8dd4b35a87f1ea5ab7590a137aae8dfeee430280858f9a18330b0fa8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page