Perform RAG retrieval using the Bailing knowledge base in Spring AI
This guide explains how to integrate the Bailing knowledge base into Spring AI Alibaba to implement Retrieval-Augmented Generation (RAG).
Prerequisites
- Spring AI Alibaba dependency has been added
- Bailing API Key has been configured
- A knowledge base has been created and documents uploaded in the Bailing console
Usage Example
Configuration Properties
| Property | Description | Default |
|---|---|---|
| spring.ai.dashscope.api-key | API Key | - |
| spring.ai.dashscope.rag.index-id | Knowledge base index ID | - |
| spring.ai.dashscope.rag.workspace-id | Workspace ID | - |
| spring.ai.dashscope.rag.top-k | Number of results to return | 5 |