How omonuj/spring-ai-agents-rag works
This is a broad Spring AI reference application, with a standalone posture MCP service. The principal workflow accepts a security diagram, runs an agent review with persisted checkpoints and human approvals, then returns a report; the README also documents provider chat, RAG, and multimodal demos. Edges cite the README or sampled callers where available. Several capability branches are documented but their implementation was not sampled, so those links are documented rather than inferred from imports.
Main entry points: SecurityReviewServiceImpl.java Review orchestration · tools Review tools · rag Retrieval and reranking · chat Chat endpoints
Components 22
Security review
- Review API
src/main/java/com/genai/java/spring/aiagent/controller/SecurityReviewController.java - Review orchestration
src/main/java/com/genai/java/spring/aiagent/service/impl/SecurityReviewServiceImpl.java - Review agents
src/main/java/com/genai/java/spring/aiagent/agent - Review tools
src/main/java/com/genai/java/spring/aiagent/tools - Review state and plans
src/main/java/com/genai/java/spring/aiagent/dto - Review state repository
src/main/java/com/genai/java/spring/aiagent/dataaccess/repository/impl/ReviewStateRepositoryImpl.java - Uploaded diagrams
src/main/java/com/genai/java/spring/aiagent/service/impl/FileStorageServiceImpl.java - Posture MCP client tool
src/main/java/com/genai/java/spring/aiagent/mcp/customtoolcallback/PostureCustomToolCallback.java
Posture MCP service
- Posture MCP server
posture-service/src/main/java/com/genai/posture/tools/PostureTools.java - Posture lookup
posture-service/src/main/java/com/genai/posture/service/impl/PostureServiceImpl.java - Posture records
posture-service/src/main/java/com/genai/posture/dataaccess/entity/SecurityPostureEntity.java
Retrieval-augmented generation
- RAG scenarios
src/main/java/com/genai/java/spring/rag/controller - RAG configuration
src/main/java/com/genai/java/spring/rag/config/data/RagConfigData.java - PDF ingestion
src/main/java/com/genai/java/spring/rag/service/RagIngestionService.java - PDF watcher
src/main/java/com/genai/java/spring/rag/service/PdfWatcherService.java - Vector store
src/main/java/com/genai/java/spring/rag/config - Retrieval and reranking
src/main/java/com/genai/java/spring/rag
Chat providers and memory
- AI model providers
src/main/java/com/genai/java/spring/config/AIProviderConfig.java - Chat endpoints
src/main/java/com/genai/java/spring/chat - Conversational memory
src/main/java/com/genai/java/spring/chat/memory
Multimodality
- Media endpoints
src/main/java/com/genai/java/spring/multimodality
Other components
- HTTP user
Connections 25
- HTTP user → Review API: submits review
src/main/java/com/genai/java/spring/aiagent/controller/SecurityReviewController.java - Review API → Review orchestration: routes requests
src/main/java/com/genai/java/spring/aiagent/controller/SecurityReviewController.java - Review orchestration → Review agents: executes review
src/main/java/com/genai/java/spring/aiagent/service/impl/SecurityReviewServiceImpl.java - Review orchestration → Review state and plans: updates state
src/main/java/com/genai/java/spring/aiagent/service/impl/SecurityReviewServiceImpl.java - Review orchestration → Review state repository: loads and saves
- Review state repository → Review state and plans: serializes state
src/main/java/com/genai/java/spring/aiagent/dataaccess/repository/impl/ReviewStateRepositoryImpl.java - Review orchestration → Uploaded diagrams: stores upload
src/main/java/com/genai/java/spring/aiagent/service/impl/SecurityReviewServiceImpl.java - Review agents → Review tools: uses tools
README.md - Review tools → RAG scenarios: queries security docs
README.md - Review tools → Posture MCP client tool: looks up posture
README.md - Posture MCP client tool → Posture MCP server: calls MCP server
README.md - Posture MCP server → Posture lookup: requests posture
posture-service/src/main/java/com/genai/posture/tools/PostureTools.java - Posture lookup → Posture records: reads records
posture-service/src/main/java/com/genai/posture/service/impl/PostureServiceImpl.java - HTTP user → Chat endpoints: sends chat
README.md - Chat endpoints → AI model providers: uses ChatClient
README.md - Chat endpoints → Conversational memory: uses memory
README.md - HTTP user → RAG scenarios: asks questions
README.md - RAG scenarios → Retrieval and reranking: retrieves context
README.md - RAG configuration → PDF ingestion: configures ingestion
src/main/java/com/genai/java/spring/rag/service/RagIngestionService.java - PDF watcher → PDF ingestion: ingests new PDFs
src/main/java/com/genai/java/spring/rag/service/PdfWatcherService.java - PDF ingestion → Vector store: adds chunks
src/main/java/com/genai/java/spring/rag/service/RagIngestionService.java - Retrieval and reranking → Vector store: retrieves vectors
README.md - Retrieval and reranking → AI model providers: augments prompts
README.md - HTTP user → Media endpoints: requests media task
README.md - Media endpoints → AI model providers: uses model capabilities
README.md