spring-ai

Integrate Spring AI chat, embeddings, and RAG into Spring Boot applications.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/dprice-dev/claude-java-skills --skill spring-ai-dprice-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-ai
Source: https://github.com/dprice-dev/claude-java-skills/tree/main/.claude/skills/spring-ai
Command: npx skills add https://github.com/dprice-dev/claude-java-skills --skill spring-ai-dprice-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Spring Boot teams need a consistent, production-friendly way to integrate LLM chat, embeddings, and vector search without stitching together separate clients and glue code.

Core Features & Use Cases

  • LLM Chat & Streaming: Call Spring AI ChatClient for Q&A, system-prompted analysis, and streamed responses.
  • Structured Output: Parse model outputs directly into typed records for reliable downstream logic.
  • RAG with Vector Stores: Implement Retrieval Augmented Generation using VectorStore (e.g., pgvector) for similarity search over indexed documents.
  • Observability & Testing: Track token usage for cost visibility and test AI components without calling real LLMs.

Quick Start

Use the spring-ai skill to implement a ChatClient-powered endpoint that performs a RAG query over pgvector-stored documents.

Frequently Asked Questions about spring-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add LLM chat and RAG to a Spring Boot application?

To add LLM chat and RAG to a Spring Boot application, configure the Spring AI BOM, set up a ChatClient, and use a VectorStore like pgvector for similarity search over indexed documents to ground responses.

How does Spring AI handle structured output from LLM responses?

Spring AI handles structured output by parsing LLM responses directly into typed JSON records. This mechanism ensures reliable downstream logic execution without manual string parsing or fragile glue code between your chat client and business logic.

Can I use pgvector for document similarity search with Spring Boot?

Yes, you can use pgvector for document similarity search with Spring Boot. The integration requires vector store configuration including schema and migrations to enable retrieval-augmented generation grounded in your indexed document data.

What is the best way to track token usage in Spring AI chat workflows?

The best way to track token usage in Spring AI chat workflows is using the framework's built-in observability features. This provides cost visibility by monitoring token consumption during ChatClient calls without extra external tracking libraries.

How do I test AI components in Spring Boot without calling real LLMs?

You can test AI components in Spring Boot without calling real LLMs by applying testable patterns provided by the Spring AI framework. This approach allows you to validate chat workflows and structured output parsing safely without incurring API costs.