agents-flex/agents-flex

Agents-flex is A lightweight Java AI agent development framework (positioned as a counterpart to Spring AI). It supports features such as RAG, MCP, Skills, Text2SQL , LLM Wiki, Sub-agents, Web Search, TTS (synchronous and streaming), and STT.

What it solves

Agents-Flex is a lightweight AI application development framework for the Java ecosystem. It allows developers to build AI-powered services—such as intelligent customer service, enterprise knowledge bases, and natural-language data analysis tools—without being locked into a specific runtime or application framework. It simplifies the integration of multiple model providers and the orchestration of complex AI workflows.

How it works

The framework is organized into modular components that developers can mix and match. It provides unified abstractions for different model types (Chat, Embedding, Image, Rerank) and a consistent API for both synchronous and streaming outputs.

Key mechanisms include:

  • Tool Calling: Supports annotation-based tool definition and dynamic tool building, with a "Tool Group" system that attaches tools only when the user prompt matches specific criteria.
  • Durable Agent Runtime: An AgentRunner manages agent turns, including snapshot recovery, tool approval, and persistence via JDBC or Redis.
  • RAG Pipeline: Provides a full suite of building blocks for document extraction, splitting, embedding, and retrieval using various vector stores.
  • Interceptors: A chain-of-responsibility pattern allows developers to modify prompts, options, and request headers conditionally before they reach the model.
  • Specialized Modules: Includes dedicated support for MCP (Model Context Protocol), Text2SQL for data analysis, and a hierarchical "LLM Wiki" for structured knowledge navigation.

Who it’s for

Java developers building AI applications who need a production-ready, modular framework that integrates with Spring Boot or plain Java (JDK 8+).

Highlights

  • Java Native: Compatible with Java 8+ and integrates seamlessly with Spring Boot.
  • Extensive Integrations: Supports a wide array of LLM providers (OpenAI, Qwen, DeepSeek, Ollama), vector stores (Redis, Milvus, Elasticsearch), and multimodal capabilities (Image, Video, Audio, OCR).
  • Production-Ready: Features built-in model routing, load balancing, circuit breaking, and OpenTelemetry-based observability.
  • Flexible Tooling: Includes a sandbox for isolated skill execution and a system for progressive tool discovery.
  • MCP Support: Converts external MCP tools into native framework tools.

Related

  • Project
  • Project
  • Project
  • Project
  • Project