# Spring AI RAG Review

> Audits a Spring AI RAG implementation for six failures that make answers wrong or unsafe — unbounded retrieval, vectors left behind after deletion, default chunking, no grounding instruction, unfiltered metadata, PII on the embedding path. Then measures retrieval quality with a golden set.

Spring AI RAG Review is a paid AI agent skill on Agensi by Puneet Swarup, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $15 (one-time purchase)
- Creator: [Puneet Swarup](https://www.agensi.io/creators/puneet-swarup)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/spring-ai-rag-review
- Tags: spring-ai, rag, spring-boot, vector-store, pgvector, retrieval, llm, prompt-injection

## About this skill

A RAG system fails in ways a test suite never catches. It answers confidently from a chunk
that has nothing to do with the question. It retrieves a document the user deleted last
week. It mixes two customers' records because nobody filtered.

This skill finds those, then does the part a scanner cannot: measures whether retrieval
actually works.

### What it does

**Audits the wiring.** Six checks, each with a file and line:

- Retrieval with no top-K or similarity threshold
- Documents deleted from the database while their vectors stay behind
- Chunks embedded with default splitter settings
- No grounding instruction anywhere in the system prompt
- Chunks carrying metadata that no query filters on
- Personal data reaching the embedding path

**Measures retrieval.** The reference walks you through a golden set — twenty questions and
the chunk that answers each — and computes recall@K, the only real measure of whether RAG
works. It includes what good looks like per document type, and the fixes for low recall in
order of likelihood: chunking, threshold, embedding model, vocabulary gap, K.

**Fixes in the right order.** Deletion first, because it is a legal problem. Grounding
second, because one prompt change removes a class of hallucination. Bounds, filters, then
chunking — the most disruptive change, last, when the golden set can prove it helped.

### How it works

It reads the Spring AI APIs you actually use — `VectorStore`, `ChatClient`,
`SearchRequest`, `QuestionAnswerAdvisor`, the splitter — rather than guessing from class
names. The deletion check looks for a repository delete with no vector delete in the same
file, which is the exact shape of the bug. The grounding check is repo-level, because one
system prompt can serve every call site.

It is deliberately quiet on correct code: run against a well-built Spring AI service, it
reports zero findings.

### Where it stops

- Regex-based Java parsing, not a compiler. It cannot see a filter applied in a shared
  helper or a grounding prompt assembled at runtime.
- It measures retrieval wiring, not answer quality. Faithfulness and hallucination rate need
  an evaluation set and a judge.
- It does not know your embedding dimension, your index type (HNSW or IVFFlat), or which
  threshold is right for your corpus. Those need the golden set.
- It does not decide your retention period or legal basis.

If your audit logging has gaps too, the free `spring-audit-coverage` skill finds them.

---

## Requires

- Python

## Known limitations

Java and Spring AI 1.x only. Does not measure answer quality or hallucination rates. Requires manual verification of findings. Cannot detect embedding dimension mismatches at build time.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Spring AI RAG Review skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Does it need network access or an API key?

No. It reads local Java sources and prints a report.

### Does it call my LLM?

No. It never runs your pipeline. Retrieval measurement is done by you or your agent running
your own app.

### Will it work with a vector store other than PGVector?

Yes — it reads the Spring AI `VectorStore` interface, so the store behind it does not
matter.

### Is this the same as the free spring-audit-coverage skill?

No. That one is about audit logging on endpoints. This one is about retrieval quality and
AI safety.

### Can it tell me whether my answers are correct?

No, and it says so. It measures whether the right chunk is retrieved. Answer faithfulness
needs an evaluation set and a judge.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
