Spring AI Application and Agent Examples
A collection of Spring AI examples for Java developers building LLM applications and agents.
- Source repo
- liuyueyi/spring-ai-demo
- Stars
- ★ 155
- Last updated
- 3mo ago
- Primary language
- Java
- FA score
- 42/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API (Partial support)
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- A Java developer wants to learn Spring AI through examples of prompts, conversation context, and structured output.
- Not a fit if
- Teams seeking a turnkey hosted agent service
- Users unwilling to configure a model and API keys
- Website
- ppai.top ↗ set on GitHub
- Maintenance
- Commits in the last 6 monthslast commit 2026-07-31
- Source review
- 42/100 · Major gaps 2 safety controls not found
What does this agent do, and when should you use it?
This repository is a set of independent examples for Java AI application development, centered on Spring Boot, Spring AI, and Maven. Its tutorials cover fundamentals, advanced topics, applications, and framework internals, with additional examples for LangGraph4J, Spring AI Alibaba, and AgentScope Java 2.0. Topics include prompts, structured output, conversation context, tool calls, MCP, multimodal workflows, RAG, graph orchestration, and multi-agent patterns. Each project can be run from its own Application class, after adjusting resources/application.yml for the chosen model. It is intended as a learning and prototyping reference, rather than a hosted agent product ready to use.
A developer selects an example project, runs it from that project's Application class, and configures resources/application.yml for the model they intend to use. The examples demonstrate Spring AI features such as prompts, ChatClient, Advisor, tool calling, MCP clients and servers, asynchronous streaming, and multimodal inputs; other directories show agent and orchestration patterns with LangGraph4J, Spring AI Alibaba, and AgentScope. Individual examples cover persistent chat history, agent routing, weather-based travel and food recommendations, RAG question answering, invoice extraction, speech translation, and natural-language-to-SQL workflows. Model calls and outputs depend on the selected example and its configuration; the README does not specify a single service API or deployment model for the repository.
- A Java developer wants to learn Spring AI through examples of prompts, conversation context, and structured output.
- An engineer needs a reference for Spring AI tool calling or MCP client/server integration.
- A developer wants to explore conversation flows or agent routing with LangGraph4J.
- An application team is prototyping knowledge-base Q&A, invoice extraction, or natural-language-to-SQL.
- A Java team wants examples involving Spring AI Alibaba and AgentScope Java.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Config files
resources/application.yml.env.env.example- Runtime
- Java 17
How do you install or deploy this agent?
The README says each example is an independent project that can be selected and run from its Application class. It does not provide a clone command, a general Maven launch command, or one installation procedure that applies to every example. The listed main stack includes Maven and Java 17; v2 examples use Java 21, Spring Boot 4.x, and Spring AI 2.x. Before running an example, configure it for the chosen model and supply the model access details it requires.
How do you use this agent?
Choose an example project, inspect its resources/application.yml, and replace the model configuration as needed. The README says credentials can be supplied through the environment, startup parameters, hard-coded configuration, or a root-level .env copied from .env.example and populated with an ApiKey; it attributes the .env approach to spring-ai-demo-starter. Then run the project's Application class. No common launch command or first API invocation is documented, so the exact startup procedure depends on the selected project.
What are this agent's strengths and limitations?
- The fundamentals track provides concrete Spring AI examples for prompts, structured output, tool calling, MCP, and multimodal use.
- The README explicitly says projects are independent and can be launched from their own Application classes.
- The repository includes examples spanning LangGraph4J, Spring AI Alibaba, and AgentScope Java 2.0.
- Application examples cover specific workflows such as RAG, speech translation, invoice extraction, and natural-language-to-SQL.
- It is a learning and reference collection; the README says theoretical, architecture, and framework-implementation material may be limited.
- Running an example requires model configuration and credentials, and the README gives no universal first-run command.
- Project stacks vary, including Java 17/Spring Boot 3.5.3 and Java 21/Spring Boot 4.x for v2 examples.
- The README does not identify a license, hosted service, unified API, or usage cost.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Spring AI Application and Agent Examples This agent | 42 · Major gaps | Framework | ★ 155 | 3mo ago | Java | — |
| ReachAI Enterprise Agent Platform | 67 · Some gaps | Self-hosted serviceFree + model costs | ★ 1.1k | 6d ago | Java | OpenAI API |
| ai4j — Java AI Agentic SDK | 60 · Some gaps | Library / SDKFree + model costs | ★ 442 | 1mo ago | Java | OpenAI API · Claude API |
| Agentica | 69 · Some gaps | CLIFree + model costs | ★ 365 | today | Python | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
The workflow limits GitHub permissions to contents:read and pull-requests:write and posts review comments, but uses pull_request_target, creates an App token, and sends diffs to a configurable external model endpoint via secrets. The README recommends hardcoding keys in configuration as one option, and a sampled skill asks to read a local style file. The packet shows no user confirmation, data-flow notice, sensitive-data safeguards, or rollback path. Dependency security is not evidenced; attribution is limited to a linked personal blog, with publisher identity unverified.
The workflow includes environment checks, HTTP/URL error handling, and failure logs, but relies on Python, GitHub APIs, App credentials, and a model endpoint. The default prompt requires a specific output format, while runtime configuration can replace it; behavior when settings are absent is not fully established by the packet. README versions and examples are traceable, but no cross-check or runtime evidence is provided.
The README identifies Java developers as its audience and organizes basic, advanced, and application examples across several frameworks, giving useful scenario and capability boundaries. Skill triggers are stated, though blog_creator is broad and sampled skills describe differing platform tools and workflows. Environment guidance names Java, Spring Boot, Maven, and model configuration, while requiring users to replace model settings and provide credentials.
The README organizes material by tutorial level and directory, and provides startup guidance, technology versions, links, and a statement that the repository is an example project. Skills include templates and examples. No license is supplied; version migration notes are scattered with no changelog, and maintenance responsibility is only loosely indicated through the personal-experience framing and blog link.
The tutorial index, independent-project startup guidance, and sample skills offer reusable learning material. The code-review workflow can post PR feedback, but its prompt routes conditional issues to suggestions, and ordinary use requires a model, GitHub App, and several secrets, increasing setup and upkeep costs.
README claims about stacks, directories, and tutorials use concrete names and paths, while the workflow exposes configuration keys and error handling. Sample skills support their stated purpose, but the packet contains no test results, output examples, or independent validation; skill checklist statements such as code being runnable are instructions, not verified outcomes.
- Not found in source: dependency securityPin versions and run a dependency audit (npm audit, pip-audit) before installing; prefer running it in a container.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- The CI review sends PR diffs to the configured model service; confirm the diff contents, endpoint, and data handling before enabling it.
- The README lists hardcoded configuration keys as an option; avoid committing real credentials to the repository.
FAQ
Is this a hosted agent product I can use immediately?
What do I need to run an example?
Do all examples use the same Java and Spring versions?
Does the repository support only one model provider?
Is Spring AI Application and Agent Examples open source?
Is Spring AI Application and Agent Examples safe to use?
Is Spring AI Application and Agent Examples still maintained?
Who makes Spring AI Application and Agent Examples?
What is Spring AI Application and Agent Examples's official website?
Thanks — we use this to improve the page.