█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

Agents-Flex

LLM कॉल, tool calling, durable agents, RAG, MCP और Text2SQL के लिए मॉड्यूलर Java फ़्रेमवर्क

Agent Frameworks & Buildersओपन सोर्स
ताज़ा
v2.3.2
अपडेट किया गया
28 अक्टू॰ 2026
भाषा
Java
लाइसेंस
Apache-2.0

नया क्या है

v2.3.228 अक्टू॰ 2026

Adds prompt-cache token tracking, OpenTelemetry agent-event spans and metrics aligned with the GenAI conventions, a SoMark OCR document-parsing adapter, and Serply and you.com web-search providers.

संक्षेप में

Agents-Flex क्या है?

Agents-Flex LLM कॉल, tool calling, durable agents, RAG, MCP और Text2SQL के लिए मॉड्यूलर Java फ़्रेमवर्क. यह Agents & Automation टूल्स की Agent Frameworks & Builders श्रेणी में आता है; ओपन सोर्स है, Java में लिखा गया है और Apache-2.0 लाइसेंस के तहत है। शुरू करने के लिए: dependency जोड़ें.

अपडेट किया गया Markdown वर्शन ↗

सारांश

Agents-Flex, Java इकोसिस्टम के लिए एक हल्का AI एप्लिकेशन फ़्रेमवर्क है, जिसे प्रोजेक्ट Spring AI के विकल्प के रूप में पेश करता है। यह LLM कॉल, tool calling, agents, RAG, vector stores, embeddings, image generation, audio, MCP, Skills, Text2SQL और संबंधित क्षमताओं को अलग-अलग Maven मॉड्यूल में व्यवस्थित करता है, ताकि एप्लिकेशन सिर्फ़ वही हिस्से लेता है जिनका वह इस्तेमाल करता है, और किसी खास runtime या एप्लिकेशन फ़्रेमवर्क से बंधा नहीं रहता। ज़्यादातर मॉड्यूल JDK 8 या उसके बाद के वर्ज़न पर, सादे Java, Spring Boot या दूसरे JVM स्टैक में चलते हैं; MCP मॉड्यूल को JDK 17 चाहिए।

अलग-अलग प्रोवाइडर के बीच का फ़र्क ChatModel, EmbeddingModel, ImageModel और RerankModel जैसे एकीकृत interfaces के पीछे छिपा रहता है, और blocking व streaming कॉल के लिए वही Prompt, options, interceptor और context तंत्र मिलते हैं। Chat integrations में OpenAI-compatible APIs, Qwen, Ollama, DeepSeek और LiteLLM शामिल हैं, और store मॉड्यूल Redis, Qdrant, Chroma, Pgvector, MariaDB, Milvus, OpenSearch, Elasticsearch और अन्य को कवर करता है। @ToolDef/@ToolParam annotations या Tool.builder() के ज़रिए business methods tools बन जाते हैं, और ToolGroup तभी tools का एक सेट जोड़ता है जब आख़िरी user message उससे मेल खाता है।

The Agents-Flex Agent Runtime demo: an agent configuration panel on the left, a chat in the middle where the agent asks the user to fill a generated form, and a live agent event stream on the right.
The project's full-stack Agent Runtime demo, showing a form-input pause and the live event stream.Agents-Flex docs ↗

Agents के लिए AgentRunner एक turn को tool calls, approval, suspension, resumption और persistence के साथ आगे बढ़ाता है, जिसका आधार snapshot recovery और JDBC या Redis stores हैं। subagents, progressive disclosure वाले file-system Skills, MCP client (stdio, http-sse और http-stream) और एक LLM Wiki tool, जिससे agent एक hierarchical knowledge tree ब्राउज़ कर सकता है, इन्हीं abstractions पर बने हैं। Production से जुड़ी ज़रूरतें, जैसे model routing, retry, load balancing, circuit breaking, OpenTelemetry observability और Text2SQL के लिए read-only SQL checks, पहले से बनी हुई हैं। प्रोजेक्ट Apache-2.0 लाइसेंस के तहत है; v2.3.2 October 28, 2026 को रिलीज़ हुआ था।

यह क्या करता है

  • ChatModel / EmbeddingModel / ImageModel / RerankModel के लिए एकीकृत abstractions, जिनके साथ मेल खाते sync और streaming APIs मिलते हैं
  • Annotation-based या programmatic tool calling, जिसमें ToolGroup से tools तभी जुड़ते हैं जब prompt मेल खाए
  • Durable Agent runtime: snapshot recovery, tool approval, suspend/resume, middleware, event streams और JDBC/Redis persistence
  • RAG के बुनियादी हिस्से: document extraction, splitting, embeddings, दस से ज़्यादा vector stores, retrieval और rerank
  • MCP client, sandboxed execution वाले file-system Skills, subagents, web search, Text2SQL और एक LLM Wiki tool
  • Model routing, retry, load balancing, circuit breaking और OpenTelemetry observability; Spring Boot starter

शुरू करें

Agents-Flex, com.agentsflex group के तहत Maven पर प्रकाशित है। ज़्यादातर मॉड्यूल को JDK 8+ चाहिए, जबकि agents-flex-mcp को JDK 17+ चाहिए।

Dependency जोड़ें

सादे Java के लिए aggregate BOM, Spring Boot के लिए starter इस्तेमाल करें, या agents-flex-chat-openai और agents-flex-store-redis जैसे अलग-अलग मॉड्यूल पर निर्भर रहें।

टेक्स्टटेक्स्ट
<dependency>
    <groupId>com.agentsflex</groupId>
    <artifactId>agents-flex-bom</artifactId>
    <version>2.3.2</version>
</dependency>

एक model को कॉल करें

यह OpenAI-compatible API इस्तेमाल करता है; endpoint, model और apiKey की जगह अपने प्रोवाइडर की वैल्यू डालें।

टेक्स्टटेक्स्ट
ChatModel chatModel = OpenAIChatConfig.builder()
    .endpoint("https://ai.gitee.com")
    .provider("GiteeAI")
    .model("Qwen3-32B")
    .apiKey(System.getenv("GITEE_API_KEY"))
    .buildModel();

String reply = chatModel.chat("Introduce Agents-Flex in one sentence.");
System.out.println(reply);

एक method को tool के रूप में उपलब्ध कराएँ

एक business method पर annotation लगाएँ, class को prompt पर रजिस्टर करें, और model जो tool calls माँगे उन्हें चलाकर फिर दोबारा पूछने से पहले उनका नतीजा दें।

टेक्स्टटेक्स्ट
public class WeatherTools {
    @ToolDef(name = "get_weather", description = "Query the weather for a given city")
    public static String getWeather(
        @ToolParam(name = "city", description = "City name", required = true) String city
    ) {
        return city + ": sunny";
    }
}

SimplePrompt prompt = new SimplePrompt("What is the weather in Beijing today?");
prompt.addToolsFromClass(WeatherTools.class);

AiMessageResponse response = chatModel.chat(prompt);
if (response.hasToolCalls()) {
    prompt.setToolMessages(response.executeToolCallsAndGetToolMessages());
    System.out.println(chatModel.chat(prompt).getMessage().getContent());
}

जवाब को stream करें

वही model एक listener के ज़रिए stream होता है।

टेक्स्टटेक्स्ट
chatModel.chatStream("Explain the Chain of Responsibility pattern in Java.", new StreamResponseListener() {
    @Override
    public void onMessage(StreamContext context, AiMessageResponse response) {
        System.out.print(response.getMessage().getContent());
    }
});

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • मौजूदा Java 8+ या Spring Boot सेवा में फ़्रेमवर्क बदले बिना LLM chat, tool calling और agents जोड़ें
  • जो vector store आप पहले से चलाते हैं, उस पर एक enterprise knowledge base या customer-service bot बनाएँ
  • लंबे agent tasks चलाएँ जिन्हें मानव approval के लिए रुकना पड़े और snapshot से फिर शुरू होना पड़े
  • read-only SQL checks के साथ डेटाबेस पर natural-language में डेटा विश्लेषण की सुविधा दें

How Agents-Flex compares

Agents-Flex alongside other open-source agent frameworks & builders tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
DeepSeek Harness★ 290kDeepSeek का ओपन एजेंट हार्नेस, जहाँ हर क्षमता एक प्लगइन है
AutoGPT★ 188kदोबारा इस्तेमाल होने वाले ब्लॉक्स से निरंतर AI एजेंट बनाएं, डिप्लॉय करें और चलाएं
DeerFlow★ 86.1kसब कुछ पहले से शामिल सुपर एजेंट हार्नेस, जिसमें स्किल्स, सब-एजेंट्स, सैंडबॉक्स और मेमोरी हैं
nanobot★ 50.5kWebUI, मेमोरी, MCP और चैट ऐप्स वाला सेल्फ-होस्टेड पर्सनल एजेंट रनटाइम
LangGraph★ 45.7kलंबे समय तक चलने वाले, stateful AI agents बनाने के लिए low-level orchestration framework
Agno★ 43.4kAI agent प्लेटफ़ॉर्म बनाने, चलाने और मैनेज करने के लिए Python SDK
AgentGPT★ 36.3kब्राउज़र में ही ऑटोनॉमस AI एजेंट बनाएं, कॉन्फ़िगर करें और डिप्लॉय करें
Agents-Flex★ 1.1kLLM कॉल, tool calling, durable agents, RAG, MCP और Text2SQL के लिए मॉड्यूलर Java फ़्रेमवर्क