An advanced Java framework that enables developers to quickly build production-grade intelligent systems.
π Official Website: OxyGent | π Open Source: Python Version | Java Version
OxyGent is an open-source multi-agent framework that unifies Agent/LLM/Tool as composable Oxy components, providing transparent end-to-end pipelines with orchestration capabilities, supporting continuous evolution and unlimited expansion in production environments.
JDOxyGent4J shares the same philosophy as the Python version and is deeply optimized for the Java ecosystem: native type safety and compile-time validation, seamless Spring Boot integration, enterprise-grade concurrency and stability, and developer-friendly APIs for Java developers.
JDOxyGent4J has been validated and applied in multiple real-world business scenarios, proving its stability and scalability in production environments.
βοΈ Deep Java Ecosystem Integration
- Seamlessly integrates with Spring Boot and Java EE standards, providing a type-safe intelligent agent development experience. Supports rapid definition of agent behavior through annotations and configuration files, leveraging Java ecosystem's mature toolchain and dependency injection mechanisms to accelerate enterprise AI application development.
π‘οΈ Enterprise-Grade Reliability Assurance
- Inherits Java platform's security model and exception handling mechanisms, ensuring stable operation of agent systems in production environments. Provides complete access control, audit logs, and observability support, meeting enterprise application security and compliance requirements.
β‘ High-Performance Concurrent Processing
- Based on Java's concurrent programming model, enabling efficient asynchronous execution of agent tasks. Supports large-scale concurrent agent execution, with non-blocking IO for inter-agent communication, showing significant performance improvements over the Python version in concurrency tests.
π Flexible Configuration and Extensible Storage
- Provides unified infrastructure abstraction layer and flexible configuration system, supporting user-defined extensions for various storage implementations (databases, caches, vector libraries, etc.). Through configuration-driven architecture design, easily adapts to local development, cloud deployment, and enterprise runtime environments, achieving hot-pluggable storage layer and seamless migration.
JDOxyGent4J/
βββ oxygent-core/ # Core: Agent/LLM/Tool/MAS with examples
β βββ src/main/java/com/jd/oxygent/core/
β βββ Config.java # Global configuration
β βββ Mas.java # Multi-Agent System (MAS) core
β βββ MasFactoryBean.java # Spring integration and space management
β βββ oxygent/oxy/ # Component implementations
β β βββ agents/ # Chat/ReAct/Workflow/RAG/SSE/Parallel etc.
β β βββ llms/ # HttpLlm, OpenAiLlm etc.
β β βββ function_tools/ # FunctionHub, FunctionTool
β β βββ mcp/ # StdioMCPClient, SSEMCPClient
β βββ oxygent/schemas/ # Request/Response/Memory/Context/Exception/Observation
β βββ oxygent/infra/ # Database, RAG, multimodal abstraction
β βββ oxygent/samples/ # Sample code and servers
β βββ tools/ # Preset tools and example tools
β βββ utils/ # Common utility classes
βββ oxygent-infra/ # Infrastructure implementation
βββ oxygent-starter-core/ # Spring Boot Starter (auto-configuration)
βββ oxygent-studio/ # Web examples and demo UI
βββ docs/ # Documentation (Chinese in docs/docs_zh)
βββ cache_dir/ # Local cache directory
π‘ Quick Start Recommendations:
- Java 17+
- Maven 3.6+
- Spring Boot 3.2.5+
<dependency>
<groupId>com.jd.oxygent</groupId>
<artifactId>oxygent-core</artifactId>
<version>1.0.0</version>
</dependency>git clone https://github.com/jd-opensource/JDOxyGent4J.git
cd JDOxyGent4J
mvn clean install -DskipTestsDue to reflection and dynamic proxy usage, the following JVM parameters must be added:
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/sun.util.calendar=ALL-UNNAMED
--add-opens java.base/java.math=ALL-UNNAMED
Refer to IDEA configuration idea_env_vm_config
ENV Config
OXY_LLM_API_KEY= "your API key"
OXY_LLM_BASE_URL= "your base url"
OXY_LLM_MODEL_NAME= "your model name"
VM config
--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/sun.util.calendar=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.security.action=ALL-UNNAMED --add-exports=java.base/sun.net.util=ALL-UNNAMED
# Return to project root directory
cd ../..
# For mac or linux systems use the following command
./setup-idea.sh
# For windows systems use the following command
setup-idea-windows.bat
# Or double-click setup-idea-windows.bat to configureThe project provides multiple complete examples, located in SAMPLES.md; for more tutorials please read docs/docs_zh.
Example preview after startup:

- Example
import com.jd.oxygent.core.Mas;
import com.jd.oxygent.core.oxygent.oxy.llms.HttpLlm;
import com.jd.oxygent.core.oxygent.oxy.agents.ReActAgent;
import com.jd.oxygent.core.oxygent.oxy.BaseOxy;
import com.jd.oxygent.core.oxygent.tools.PresetTools;
import com.jd.oxygent.core.utils.EnvUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DemoInReadme {
public static void main(String[] args) throws Exception {
List<BaseOxy> oxySpaceList = getDefaultOxySpace();
Mas mas = new Mas("app", oxySpaceList);
mas.setOxySpace(oxySpaceList);
mas.init();
Map<String, Object> info = new HashMap<>();
info.put("query", "What time is it now? Please save it into time.txt.");
System.out.println("Starting chatWithAgent request");
mas.chatWithAgent(info);
}
public static List<BaseOxy> getDefaultOxySpace() {
return Arrays.asList(
HttpLlm.builder()
.name("default_llm")
.apiKey(EnvUtils.getEnv("OXY_LLM_API_KEY"))
.baseUrl(EnvUtils.getEnv("OXY_LLM_BASE_URL"))
.modelName(EnvUtils.getEnv("OXY_LLM_MODEL_NAME"))
.llmParams(Map.of("temperature", 0.01)) // Use Map.of to create immutable Map
.timeout(30)
.build(),
// 2. Time tools (assuming preset_tools.time_tools is a predefined Tool instance)
PresetTools.TIME_TOOLS, // Need to define PresetTools class
// 3. Time agent
ReActAgent.builder()
.name("time_agent")
.desc("A tool that can query the time")
.tools(Arrays.asList("time_tools")) // Tool name list
.build(),
// 4. File tools
PresetTools.FILE_TOOLS,
// 5. File agent
ReActAgent.builder()
.name("file_agent")
.desc("A tool that can operate the file system")
.tools(Arrays.asList("file_tools"))
.build(),
// 6. Math tools
PresetTools.MATH_TOOLS,
// 7. Math agent
ReActAgent.builder()
.name("math_agent")
.desc("A tool that can perform mathematical calculations.")
.tools(Arrays.asList("math_tools"))
.build(),
// 8. Master Agent
ReActAgent.builder()
.isMaster(true) // Set as master agent
.name("master_agent")
.llmModel("default_llm")
.subAgents(Arrays.asList("time_agent", "file_agent", "math_agent")) // Sub-agent list
.build()
);
}
}-
Method 1 (Recommended, Development Mode):
cd oxygent-studio && mvn spring-boot:run
-
Method 2 (Run Main Class Directly):
- Main class:
com.jd.oxygent.web.OpenOxySpringBootApplication - Run in IDE or use
mvn -pl oxygent-studio exec:java -Dexec.mainClass=com.jd.oxygent.web.OpenOxySpringBootApplication
- Main class:
-
Method 3: Spring Boot
@SpringBootApplication
public class OpenOxySpringBootApplication {
public static void main(String[] args) {
SpringApplication.run(OpenOxySpringBootApplication.class, args);
}
}- Web example page:
http://localhost:8080
We welcome contributions of any form! Including but not limited to:
- π Submit bugs or reproduce issues
- π‘ Propose new features or improvement suggestions
- π Improve documentation or supplement examples
- π§βπ» Submit Pull Requests (please base on
devbranch)
Contribution Process:
- Fork this repository
- Create feature branch (
git checkout -b feat/your-feature) - Submit code and push
- Create Pull Request
We appreciate contributions of all forms!πππ If you encounter problems during development, please check our documentation: * Documentation
If you encounter any issues along the way, you are welcomed to submit reproducible steps and log snippets in the project's Issues area, or contact the OxyGent Core team directly via your internal Slack.
Welcome to contact us:
Thank you to all developers who have contributed to the OxyGent project!
This project adopts the Apache License 2.0 open source license.
Β© 2025 JD OxyGent Team ββ Making agent development simpler and more efficient!
