spring-projects / spring-projects/spring-ai

Add Amazon Bedrock Knowledge Base VectorStore implementation

Open
#5,251 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

Expected Behavior

Add a VectorStore implementation for Amazon Bedrock Knowledge Bases that allows similarity search against pre-configured Knowledge Bases using the Bedrock Agent Runtime Retrieve API.

BedrockKnowledgeBaseVectorStore vectorStore = BedrockKnowledgeBaseVectorStore
    .builder(client, "knowledge-base-id")
    .topK(5)
    .similarityThreshold(0.5)
    .build();

List<Document> results = vectorStore.similaritySearch(
    SearchRequest.builder().query("What is the return policy?").build());

Current Behavior

Spring AI supports Bedrock for chat and embedding models, but there's no integration with Bedrock Knowledge Bases. Users must implement their own integration or use a separate vector store even when their documents are already in a Bedrock Knowledge Base.

Context

Bedrock Knowledge Bases provide fully managed RAG with automatic document ingestion, chunking, and embedding. Unlike other vector stores, it doesn't require an EmbeddingModel - the Knowledge Base handles embeddings internally.

Key features needed:

  • Similarity search with topK and threshold
  • Metadata filtering (Spring AI filter expressions → Bedrock RetrievalFilter)
  • SEMANTIC and HYBRID search types
  • Optional reranking model support
  • Support for multiple data sources (S3, Confluence, SharePoint, etc.)

Note: This is read-only - add() and delete() throw UnsupportedOperationException since documents are managed via KB data source sync.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Spring AI's existing Bedrock chat and embedding integrations, then trace the VectorStore and SearchRequest contracts alongside the Bedrock Agent Runtime Retrieve API. The implementation is done when read-only similarity search supports topK, thresholds, metadata filters, SEMANTIC or HYBRID search, optional reranking, and rejects add() and delete() as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
ai, cloud, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.