⌘K

Java SDK

The same assistant surface as the Python and Node SDKs, for JVM projects — create an assistant, upload documents, and chat with them. Needs an API key first.

Install

Maven:

xml
<dependency>
  <groupId>ai.workerbee</groupId>
  <artifactId>workerbee-java-sdk</artifactId>
  <version>1.0.0-beta.1</version>
</dependency>

Gradle:

groovy
implementation("ai.workerbee:workerbee-java-sdk:1.0.0-beta.1")

Upgrade

Bump the version pin in your Maven or Gradle build file:

groovy
implementation("ai.workerbee:workerbee-java-sdk:1.1.0")

Check Change Log before upgrading — this SDK is in beta and its surface can still move.

Initialize assistant

java
Workerbee wb = Workerbee.builder()
    .apiKey(System.getenv("WORKERBEE_API_KEY"))
    .build();

Assistant assistant = wb.assistant().createAssistant(
    CreateAssistantRequest.builder()
        .assistantName("platform-team")
        .build());

An assistant is a scoped knowledge space — its own uploaded documents, structured onto your graph, isolated from every other assistant in the account.

uploadFile example

java
assistant.uploadFile(UploadFileRequest.builder()
    .filePath(Path.of("/path/to/mei-kowalski-resume.pdf"))
    .metadata(Map.of("team", "platform", "document_type", "resume"))
    .build());

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

java
ChatResponse resp = assistant.chat(ChatRequest.builder()
    .addMessage(Message.user("Who could back-fill Mei Kowalski's role?"))
    .build());

System.out.println(resp.getInterpretation());
for (RankedRow row : resp.getRows()) {
    System.out.println(
        row.getName() + " " + row.getCanonicalOccupation() + " " + row.getSeniorityLevel());
}

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.