Technologies

GitHub Launches Copilot SDK for Java to Develop Framework-Independent AI Agents

GitHub has introduced the Copilot SDK for Java, which enables server-side Java applications to create sessions for Copilot agents, register tools, send prompts, and receive structured responses. The library is currently available as a preview release and supports Jakarta EE and Spring environments, as well as the BYOK option.

2026-08-10
4 min read
17 views
فريق تحرير certi.news
GitHub Launches Copilot SDK for Java to Develop Framework-Independent AI Agents

GitHub announced Copilot SDK for Java, a client library that enables server-side Java applications to programmatically drive Copilot agents by creating agent sessions, registering tools, sending prompts, and receiving structured responses. GitHub says the library was designed to be independent of Java frameworks and also provides support for the BYOK option, making it not tied to a single artificial intelligence provider.

The library targets Java developers working on enterprise applications and runs in server environments, including Jakarta EE and Spring. It uses interfaces familiar to Java developers, such as CompletableFuture, annotations, lambdas, and virtual threads, rather than imposing an approach tied to a specific framework.

Availability and Requirements

The library is currently available as a Maven dependency, version 1.0.7-preview.1. Its use requires the following:

  • JDK 17 or JDK 25, with JDK 25 recommended to take advantage of virtual threads and other modern features.
  • Maven 3.9 or later.
  • A GitHub account with an active Copilot subscription.
  • Copilot CLI installed locally, version 1.0.71 or later.

GitHub's post presents a complete sample application built on Jakarta EE 11, with the source code provided for experimentation. The company also confirms that developers can build their own agents using the Java frameworks and libraries they choose.

Sample Real Estate Request Management Application

The example uses an application for managing leads in the real estate sector. When a client submits a request, such as searching for a three-bedroom home in London priced below £800,000, the system creates an isolated Copilot agent on a virtual thread to process the request within a defined workflow.

The application uses Jakarta WebSocket to send real-time status updates from the server to the browser, enabling users to track the agents' progress as they call tools. Multiple requests can also be sent at the same time, with each request processed independently within its own Copilot session.

Defining and Managing Tools

The library provides the @CopilotTool interface for defining tools that the model can call. The developer specifies a regular Java method, while the library generates the JSON schema, parses the arguments, and dispatches the call. @CopilotToolParam can be used to describe each parameter so the model knows the value expected from it.

This annotation interface is currently experimental, so experimental SDK interfaces must be enabled through the compiler option -Acopilot.experimental.allowed=true, along with registering the library in the annotation processor path in the Maven configuration. The processing generates tool metadata during compilation.

In addition to annotations, tools can be defined directly at the point of use through a lambda-based approach using ToolDefinition.from(...). This allows a tool to be created without a dedicated method, while overridesBuiltInTool(true) provides a way to replace a built-in tool with custom behavior. Tools can also be placed in classes separate from the agent logic and then registered through ToolDefinition.fromObject.

Messages and the Agent Workflow

The SDK allows the system message to be customized through SystemMessageMode.CUSTOMIZE, replacing specific sections while retaining the rest of the message, including safety guardrails. It also provides APPEND mode to add content to the default system message without replacing it.

The agent's complete workflow begins through sendAndWait(...). When the prompt is sent, the model can reason and call the registered tools multiple times before returning the final result, while the library passes the tool results back to the model until the task is complete. Virtual threads allow waiting through get() without consuming a traditional thread while waiting for the result. session.on(...) also enables handling events emitted by the session.

News source
ف
Author

فريق تحرير certi.news

In the same category

You may also like

View all news