Skip to content

agents-flex/agents-flex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,220 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

An Elegant Java Framework for LLM Application Development | Truly Open Source Β· Easy Integration Β· Production Ready

πŸš€ Core Features

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.

✨ New Core Capabilities (v2.0+)

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

πŸ”§ Core Capabilities Matrix

🧠 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

⚑ Quick Start

1️⃣ Add Dependencies (Maven)

<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>

2️⃣ Hello World

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 via application.properties. For production environments, SLF4J integration is recommended.

πŸ“¦ Module Overview

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-starter with 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,trace for monitoring integration
  • For RAG scenarios, combine: data + embedding + store + rerank modules

πŸ“š Documentation & Resources

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

🀝 Contributing

We follow the Apache Way and Contributor Covenant guidelines:

  1. Fork the repo β†’ Create a feature branch (feature/xxx)
  2. Code style: Run mvn spotless:apply for auto-formatting (Google Java Style)
  3. Add unit tests: Aim for β‰₯ 80% coverage on core modules
  4. 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


πŸ“œ License

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.

About

Agents-flex is A Lightweight Java AI Application Development Framework.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages