An Elegant Java Framework for LLM Application Development | Truly Open Source Β· Easy Integration Β· Production Ready
Agents-Flex is designed for Java engineers and architects, delivering a lightweight, modular, and extensible AI agent development experience to help enterprises rapidly build production-grade LLM applications.
| Feature | Description | Use Cases |
|---|---|---|
| MCP Support | Native integration with Model Context Protocol for standardized connection to external data sources and tools | Cross-system context sharing, tool orchestration |
| AI Skills | Encapsulate business capabilities into reusable, composable Skill units | Rapid domain Agent construction, skill marketplace |
| Text2SQL / Smart Data Query | Built-in Text2SQL and natural language data analysis capabilities | Zero-code querying for business users, data insights |
π§ Model Integration π Tool Invocation π Knowledge Enhancement
ββ Mainstream LLMs ββ Function Calling ββ Multi-format Document Loading
ββ Ollama Local Deploy ββ MCP Tool Protocol ββ Intelligent Text Splitting
ββ HTTP/SSE/WS Protocolsββ Local Method Reflection ββ Vector Store Integration
ββ Multi-Provider Mgmt ββ Execution Interceptors ββ Custom Embedding Support
βοΈ Engineering Support π Observability π‘οΈ Enterprise-Grade Assurance
ββ Prompt Template Engineββ OpenTelemetry Integrationββ Sensitive Data Masking
ββ Multi-turn Memory ββ Distributed Tracing ββ Safe Resource Shutdown
ββ Async/Streaming Resp ββ Structured Logging ββ Apache 2.0 License
π‘ Design Principles: Zero-Intrusion Integration Β· Interface-Driven Extension Β· Configuration Over Code Β· Production-Friendly
<dependency>
<groupId>com.agentsflex</groupId>
<artifactId>agents-flex-core</artifactId>
<version>2.0.6</version>
</dependency>
<!-- Optional: Add extension modules as needed -->
<dependency>
<groupId>com.agentsflex</groupId>
<artifactId>agents-flex-mcp</artifactId>
<version>2.0.6</version>
</dependency>public class QuickStart {
public static void main(String[] args) {
// 1. Configure the model (supports GiteeAI / OpenAI / Ollama, etc.)
OpenAIChatModel chatModel = OpenAIChatConfig.builder()
.provider("GiteeAI")
.endpoint("https://ai.gitee.com")
.requestPath("/v1/chat/completions")
.apiKey(System.getenv("GITEE_AI_KEY")) // β
Recommended: load from environment variable
.model("Qwen3-32B")
.buildModel();
// 2. Start a conversation (sync/streaming/async all supported)
String response = chatModel.chat("Explain what humor is in a way that Java developers can understand?");
// 3. Output the result
System.out.println("π€ Agents-Flex: " + response);
}
}Console Output Example:
[Agents-Flex] >>> [GiteeAI/Qwen3-32B] Request: {"model":"Qwen3-32B","messages":[...]}
[Agents-Flex] <<< [GiteeAI/Qwen3-32B] Response: 200 OK (1.2s)
π€ Agents-Flex: Humor is like elegant exception handling in codeβseemingly unexpected, yet meticulously designed...
π The
[Agents-Flex]log prefix can be customized or disabled viaapplication.properties. For production environments, SLF4J integration is recommended.
agents-flex/
βββ agents-flex-bom # π¦ BOM dependency management for unified versioning
βββ agents-flex-core # π§± Core abstractions: Model/Prompt/Memory/Tool SPI
βββ agents-flex-chat # π¬ Chat engine: sync/streaming/async invocation
βββ agents-flex-tool # π§ Function Calling engine: method definition/parsing/execution
βββ agents-flex-mcp # π MCP protocol support: standardized context & tool connection (New)
βββ agents-flex-skills # π― AI Skills: capability encapsulation & dynamic loading (New)
βββ agents-flex-text2sql # π Text2SQL & natural language data analysis (New)
βββ agents-flex-embedding # π’ Embedding service: model integration & vector generation
βββ agents-flex-store # ποΈ Storage extensions: VectorStore/Memory persistence implementations
βββ agents-flex-search-engine # π Search engine integration: ES/DB/custom retrieval sources
βββ agents-flex-rerank # π Re-ranking service: improve RAG retrieval relevance
βββ agents-flex-image # πΌοΈ Image capabilities: text-to-image / image-to-text model integration
βββ agents-flex-spring-boot-starter # βοΈ Spring Boot auto-configuration (Production Recommended)
βββ demos/ # π§ͺ Sample projects: MCP / Skills / Text2SQL demos
βββ docs/ # π Documentation source (VitePress)
βββ testresource/ # π§ͺ Test resource files
β Production-Ready Recommendations:
- Use
agents-flex-spring-boot-starterwith a configuration center for API key management in production - Inject sensitive information (API Keys / DB passwords) via
@Value("${xxx}")+ encrypted configuration - Enable
management.endpoints.web.exposure.include=metrics,tracefor monitoring integration - For RAG scenarios, combine:
data+embedding+store+rerankmodules
| Type | Link | Description |
|---|---|---|
| π Chinese Docs | https://agentsflex.com | Complete API guide + best practices |
| π§ͺ Sample Projects | /demos | MCP integration / Skills orchestration / Text2SQL demos |
| π Changelog | /changes.md | Version history and migration guide |
| π Issue Tracker | GitHub Issues | Bug reports / feature requests |
| π¬ Community | Join Discussion | Q&A, ideas, and community support |
We follow the Apache Way and Contributor Covenant guidelines:
- Fork the repo β Create a feature branch (
feature/xxx) - Code style: Run
mvn spotless:applyfor auto-formatting (Google Java Style) - Add unit tests: Aim for β₯ 80% coverage on core modules
- Submit a PR linked to an issue, describing the motivation and impact of changes
π Especially welcome: Java 8/11/17 compatibility tests, enterprise use cases, and documentation translations
Agents-Flex is released under the Apache License 2.0. You are free to:
- β Use commercially in your projects
- β Modify and deploy privately
- β Contribute code to grow the ecosystem
Please retain the original copyright notice and indicate modifications when distributing. See LICENSE for details.