What is Agents-Flex?
Starting from unified model invocation, Agents-Flex enables on-demand composition of Agents, RAG, multimodal processing, OCR, Skills, and observability capabilities. While maintaining a clear business architecture, it leverages asynchronous task mechanisms to ensure recovery and production-grade operational reliability for long-running tasks.
Key features
It features an Agent Runtime that supports human approval, budget control, retries, suspension, and resumption.
It offers RAG and knowledge storage capabilities, including document extraction, segmentation, embedding, reranking, and integration with various vector databases.
Use cases and audience
This framework is ideal for Java developers, particularly enterprise teams looking to build observable, governable, and orchestratable AI applications and agents in production environments.
- Designed for Java developers building AI applications and agents, it supports model invocation, Agent orchestration, RAG knowledge retrieval, multimodal processing (image generation/OCR/speech/TTS/STT/video), and Skill encapsulation with isolated execution.
- Run long-running asynchronous tasks (such as video generation or OCR processing) in a production environment, with support for suspension, resumption, manual approval, and budget control.
- Integrate multiple capabilities through a unified Java interface: ChatModel for dialogue, ImageModel for image-to-image generation, OcrModel for document recognition, VideoModel for video generation, TextToSpeech for speech synthesis, and more.
It handles text prompts, image files (PNG/JPG/PDF), audio streams, video-generation request parameters, OCR request objects (OcrRequest), Skill scripts and resources (scripts/assets).
It supports streaming or synchronous text responses (ChatModel), image generation (ImageModel), text-to-speech audio, speech-to-text transcription, OCR results (text/Markdown/resource links), video task statuses and download URLs (VideoModel), structured Tool Calling outputs, as well as observability events and snapshots (Turn Store, Events).
Frequently asked questions
Does Agents-Flex mandatorily depend on the Spring framework?
No, Agents-Flex does not enforce a dependency on Spring; it only provides an optional Spring AI compatibility layer.
How do you obtain results from OCR and video-generation capabilities?
OCR and video generation are asynchronous tasks. After submission, you must query the status via TaskStatus, and only retrieve the OcrResponse or video resource once the task is completed.
How to use
- 01
Import the Agents-Flex Java SDK (supports JDK 8+; Apache 2.0 open source).
- 02
Configure OpenAIChatConfig or other models (e.g., .apiKey(System.getenv("AI_API_KEY")) and .model("your-model")).
- 03
Call model.chat("Introduce Agents-Flex in one sentence") to initiate basic dialogue.
- 04
Expand as needed: integrate RAG storage, define Skill scripts, enable sandboxed execution isolation, or add Agent runtime policies.
Official website & sources
Updated on 2026-10-30

