Skip to content

Agentle4j Logo

Agentle4j

This docs was updated at: 2026-03-21

Java 25+, virtual-thread-friendly, Responses API-native

Java License Maven Central

Type-safe agents, streaming, and structured output for Java

Get Started API Reference


✨ Key Features

  • 🤖 Agent Framework


    Complete agent system with tools, guardrails, memory, and handoffs

  • 🎯 Type-safe API


    Full OpenAI Responses API with Java records

  • 🌊 Real-time Streaming


    Virtual thread-based streaming with callbacks

  • 📦 Structured Outputs


    Strongly-typed JSON responses

  • 🔧 Function Calling


    Auto-generated JSON schemas from Java classes

  • 🔭 OpenTelemetry


    Built-in observability with spans/metrics


⚙️ Runtime Model

  • Agentle4j requires Java 25+ with preview features enabled.
  • Core APIs are synchronous-first and designed to be used directly or dispatched onto virtual threads.
  • Streaming is exposed through ResponseStream and AgentStream callbacks.
  • The published artifact version documented here is 0.10.1.

🚀 Quick Example

import com.paragon.responses.Responder;
import com.paragon.responses.spec.CreateResponsePayload;
import com.paragon.responses.spec.Response;

// Create a responder
Responder responder = Responder.builder()
    .openRouter()
    .apiKey("your-api-key")
    .build();

// Build your request
var payload = CreateResponsePayload.builder()
    .model("openai/gpt-4o-mini")
    .addDeveloperMessage("You are a helpful assistant.")
    .addUserMessage("Hello!")
    .build();

// Get the response
Response response = responder.respond(payload);
System.out.println(response.outputText());

📦 Installation

<dependency>
    <groupId>io.github.paragon-intelligence</groupId>
    <artifactId>agentle4j</artifactId>
    <version>0.10.1</version>
</dependency>
implementation 'io.github.paragon-intelligence:agentle4j:0.10.1'

Requires Java 25+ with preview features enabled.


📚 Documentation

Section Description
Installation Detailed setup instructions
Getting Started Quick start guide
Agentic Patterns Visual control-flow guide for agents, delegation, and orchestration
Guides In-depth feature guides
API Reference Auto-generated Javadoc
Examples Code samples

🤝 Contributing

We welcome contributions! Please see our GitHub repository for more information.


Made with ❤️ by Paragon Intelligence