Python SDK
Create an assistant, upload documents, and chat with them — from a Python script, notebook, or backend service. Needs an API key first.
Install
bash
pip install workerbee
Upgrade
bash
pip install --upgrade workerbee
Check Change Log before upgrading — this SDK is in beta and its surface can still move.
Initialize assistant
python
from workerbee import Workerbee wb = Workerbee(api_key="WORKERBEE_API_KEY") assistant = wb.assistant.create_assistant(assistant_name="platform-team")
An assistant is a scoped knowledge space — its own uploaded documents, structured onto your graph, isolated from every other assistant in the account.
upload_file example
python
assistant.upload_file(
file_path="/path/to/mei-kowalski-resume.pdf",
metadata={"team": "platform", "document_type": "resume"},
timeout=None,
)Ingestion is asynchronous — poll the returned file’s status until it reads PROCESSED before chatting about it. Supported types: PDF, DOCX, Markdown, plain text, and JSON.
chat example
python
from workerbee.assistant.models.chat import Message
resp = assistant.chat(
messages=[Message(role="user", content="Who could back-fill Mei Kowalski's role?")]
)
print(resp.interpretation)
for row in resp.rows:
print(row.name, row.canonical_occupation, row.seniority_level, row.coverage, row.readiness)Every response carries interpretation, rows ranked with fit and readiness scores, the references it drew on, and an audit block — never just a bare answer.
Was this page helpful?