ADR-037: AWS Bedrock and S3 Vectors Integration
Status
Accepted
Context
The CLI currently supports multiple LLM providers via Quarkus LangChain4j:
- Ollama (local, default for chat and embeddings)
- Anthropic Claude (cloud chat)
- OpenAI (optional cloud chat)
For vector storage, we use PGVector (PostgreSQL with pgvector extension).
Users have requested AWS integration for:
- AWS Bedrock - Managed LLM service with access to Claude, Titan, Llama, and other models
- Amazon S3 Vectors - New cost-effective vector storage (up to 90% savings vs traditional vector DBs)
Decision
AWS Bedrock Integration (Implemented)
Add quarkus-langchain4j-bedrock extension to support AWS Bedrock as an LLM provider:
Supported Models:
- Amazon Titan (text, embedding)
- Anthropic Claude (via Bedrock)
- Meta Llama
- Amazon Nova
- Cohere, AI21, Mistral (regional availability varies)
Configuration Pattern:
# Provider selection
quarkus.langchain4j.chat-model.provider=bedrock
quarkus.langchain4j.embedding-model.provider=bedrock
# Bedrock configuration
quarkus.langchain4j.bedrock.region=${AWS_REGION:us-east-1}
quarkus.langchain4j.bedrock.chat-model.model-id=anthropic.claude-3-sonnet-20240229-v1:0
quarkus.langchain4j.bedrock.embedding-model.model-id=amazon.titan-embed-text-v2:0
quarkus.langchain4j.bedrock.timeout=120s
# AWS credentials (use default credential chain)
# Environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
# Or: ~/.aws/credentials profile, IAM role, etc.
Benefits:
- Enterprise-grade managed service
- No infrastructure to maintain
- Pay-per-use pricing
- Access to latest Claude models without separate API key
- VPC endpoints for private connectivity
Amazon S3 Vectors (Not Yet Implemented)
Status: Deferred pending LangChain4j support
Amazon S3 Vectors (GA July 2025) provides native vector storage in S3:
- Up to 90% cost reduction vs traditional vector DBs
- 2 billion vectors per index
- Sub-second query latency
- Strong consistency
Current Limitation:
LangChain4j (Java) does not have native S3 Vectors support. Only Python LangChain has AmazonS3Vectors integration via langchain_aws.vectorstores.s3_vectors.
Options Considered:
- Custom EmbeddingStore implementation - High effort, maintenance burden
- Wait for LangChain4j support - Preferred, community-driven
- Use Amazon OpenSearch Serverless - Supported via existing LangChain4j OpenSearch module
Recommendation: Continue using PGVector for now. Monitor LangChain4j for S3 Vectors support. Consider OpenSearch Serverless for AWS-native deployments requiring managed vector search.
Implementation
Dependencies Added
<!-- AWS Bedrock LLM/Embedding support -->
<dependency>
<groupId>io.quarkiverse.langchain4j</groupId>
<artifactId>quarkus-langchain4j-bedrock</artifactId>
<version>${quarkus-langchain4j.version}</version>
</dependency>
Configuration Properties
New properties in application.properties:
# ==================== AWS Bedrock Configuration ====================
# Bedrock model configuration
quarkus.langchain4j.bedrock.region=${AWS_REGION:us-east-1}
quarkus.langchain4j.bedrock.timeout=120s
# Bedrock chat model (Claude 3 Sonnet via Bedrock)
quarkus.langchain4j.bedrock.chat-model.model-id=anthropic.claude-3-sonnet-20240229-v1:0
quarkus.langchain4j.bedrock.chat-model.max-tokens=4096
quarkus.langchain4j.bedrock.chat-model.log-requests=false
quarkus.langchain4j.bedrock.chat-model.log-responses=false
# Bedrock embedding model (Amazon Titan)
quarkus.langchain4j.bedrock.embedding-model.model-id=amazon.titan-embed-text-v2:0
Usage
To use Bedrock instead of Ollama:
# Set provider to bedrock
export LANGCHAIN4J_CHAT_MODEL_PROVIDER=bedrock
export LANGCHAIN4J_EMBEDDING_MODEL_PROVIDER=bedrock
# AWS credentials (one of these methods)
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret
export AWS_REGION=us-east-1
# Or use ~/.aws/credentials profile
export AWS_PROFILE=your-profile
# Run CLI
java -jar idempiere-hub-runner.jar ask "What is iDempiere?"
Consequences
Positive
- Enterprise AWS customers can use managed LLM service
- No need for separate Anthropic API key when using Claude via Bedrock
- Cost optimization through AWS billing integration
- IAM-based access control for LLM usage
- Foundation for future S3 Vectors integration
Negative
- AWS-specific configuration adds complexity for non-AWS users
- Bedrock model availability varies by region
- Embedding dimension may differ between models (Titan: 1024, nomic-embed-text: 768)
Neutral
- S3 Vectors integration deferred until LangChain4j support is available
- PGVector remains the recommended vector store for now