Skip to content

Conversation

@zoharsan
Copy link
Contributor

@zoharsan zoharsan commented Nov 7, 2025

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces a new sample application demonstrating Retrieval Augmented Generation (RAG) using AWS Bedrock-hosted LLM models integrated with Vespa. The application showcases how to leverage AWS Bedrock's OpenAI-compatible chat completions API for generation while using Vespa's hybrid search capabilities (combining BM25 text search and vector similarity) for retrieval.

Key Changes:

  • New sample application aws-simple-rag with configuration for AWS Bedrock LLM integration
  • Hybrid search implementation combining text search (BM25) and vector similarity search using E5 embeddings
  • Comprehensive documentation covering AWS Bedrock setup, Vespa deployment, and structured output generation

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
aws-simple-rag/services.xml Configures Vespa services including E5 embedder component, AWS Bedrock OpenAI client with secret management, and RAGSearcher for generation
aws-simple-rag/schemas/passage.sd Defines the passage document schema with text indexing, vector embeddings, and hybrid ranking profile
aws-simple-rag/README.md Provides comprehensive setup instructions for AWS Bedrock configuration, Vespa deployment, and query examples including structured output
aws-simple-rag/.vespaignore Specifies files to exclude from the Vespa application package
aws-simple-rag/ext/edit-app-access.png Screenshot illustrating the secret access configuration in Vespa Cloud console
README.md Adds reference to the new AWS Bedrock RAG sample application in the main repository index

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +38 to +40
expression: 2 * closeness(field, embedding) + bm25(text) / 11
}
match-features: bm25(text) closeness(field, embedding)
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closeness(field, embedding) function appears to be using incorrect syntax. The closeness function typically takes the field name as a string or just the field name directly, not the literal word "field". This should likely be closeness(embedding) or the correct field reference.

Suggested change
expression: 2 * closeness(field, embedding) + bm25(text) / 11
}
match-features: bm25(text) closeness(field, embedding)
expression: 2 * closeness(embedding) + bm25(text) / 11
}
match-features: bm25(text) closeness(embedding)

Copilot uses AI. Check for mistakes.

document passage {

field id type string {
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation: the field id block uses irregular spacing with 1 space before field while the field text block uses proper indentation. The opening brace is also on a different line than expected for the id field.

Suggested change
field id type string {
field id type string {

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +14
<component id="e5_small" type="hugging-face-embedder">
<transformer-model url="https://github.com/vespa-engine/sample-apps/raw/master/examples/model-exporting/model/e5-small-v2-int8.onnx"/>
<tokenizer-model url="https://raw.githubusercontent.com/vespa-engine/sample-apps/master/examples/model-exporting/model/tokenizer.json"/>
<prepend> <!-- E5 prompt instructions -->
<query>query:</query>
<document>passage:</document>
</prepend>
</component>
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation: the component definition uses 5 spaces while the rest of the file uses standard 2-space indentation. The component should align with other elements at the same level.

Suggested change
<component id="e5_small" type="hugging-face-embedder">
<transformer-model url="https://github.com/vespa-engine/sample-apps/raw/master/examples/model-exporting/model/e5-small-v2-int8.onnx"/>
<tokenizer-model url="https://raw.githubusercontent.com/vespa-engine/sample-apps/master/examples/model-exporting/model/tokenizer.json"/>
<prepend> <!-- E5 prompt instructions -->
<query>query:</query>
<document>passage:</document>
</prepend>
</component>
<component id="e5_small" type="hugging-face-embedder">
<transformer-model url="https://github.com/vespa-engine/sample-apps/raw/master/examples/model-exporting/model/e5-small-v2-int8.onnx"/>
<tokenizer-model url="https://raw.githubusercontent.com/vespa-engine/sample-apps/master/examples/model-exporting/model/tokenizer.json"/>
<prepend> <!-- E5 prompt instructions -->
<query>query:</query>
<document>passage:</document>
</prepend>
</component>

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +12
# Retrieval Augmented Generation (RAG) in Vespa using AWS BedRock models

This sample application demonstrates an end-to-end Retrieval Augmented
Generation application in Vespa, leveraging [AWS BedRock](https://aws.amazon.com/bedrock/) hosted models.
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect capitalization: "BedRock" should be "Bedrock" (lowercase 'r'). The official AWS product name is "Amazon Bedrock" not "BedRock".

Suggested change
# Retrieval Augmented Generation (RAG) in Vespa using AWS BedRock models
This sample application demonstrates an end-to-end Retrieval Augmented
Generation application in Vespa, leveraging [AWS BedRock](https://aws.amazon.com/bedrock/) hosted models.
# Retrieval Augmented Generation (RAG) in Vespa using AWS Bedrock models
This sample application demonstrates an end-to-end Retrieval Augmented
Generation application in Vespa, leveraging [AWS Bedrock](https://aws.amazon.com/bedrock/) hosted models.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +12
# Retrieval Augmented Generation (RAG) in Vespa using AWS BedRock models

This sample application demonstrates an end-to-end Retrieval Augmented
Generation application in Vespa, leveraging [AWS BedRock](https://aws.amazon.com/bedrock/) hosted models.
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect capitalization: "BedRock" should be "Bedrock" (lowercase 'r'). The official AWS product name is "Amazon Bedrock" not "BedRock".

Suggested change
# Retrieval Augmented Generation (RAG) in Vespa using AWS BedRock models
This sample application demonstrates an end-to-end Retrieval Augmented
Generation application in Vespa, leveraging [AWS BedRock](https://aws.amazon.com/bedrock/) hosted models.
# Retrieval Augmented Generation (RAG) in Vespa using AWS Bedrock models
This sample application demonstrates an end-to-end Retrieval Augmented
Generation application in Vespa, leveraging [AWS Bedrock](https://aws.amazon.com/bedrock/) hosted models.

Copilot uses AI. Check for mistakes.

```xml
<secrets>
<bedrock-api-key vault=">my-vault-name>" name="<my-secret-name>"/>
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing opening angle bracket in the vault attribute. The value should be vault="<my-vault-name>" instead of vault=">my-vault-name>" to match the pattern used for <my-secret-name>.

Suggested change
<bedrock-api-key vault=">my-vault-name>" name="<my-secret-name>"/>
<bedrock-api-key vault="<my-vault-name>" name="<my-secret-name>"/>

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +26
indexing: input text | embed e5_small | attribute | index
attribute {
distance-metric: angular
}
index {
hnsw {
max-links-per-node: 32
neighbors-to-explore-at-insert: 100
}
}
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation in the embedding field definition. The field content uses excessive indentation (12 spaces) instead of the standard 2 or 4 spaces used elsewhere in the schema.

Suggested change
indexing: input text | embed e5_small | attribute | index
attribute {
distance-metric: angular
}
index {
hnsw {
max-links-per-node: 32
neighbors-to-explore-at-insert: 100
}
}
indexing: input text | embed e5_small | attribute | index
attribute {
distance-metric: angular
}
index {
hnsw {
max-links-per-node: 32
neighbors-to-explore-at-insert: 100
}
}

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +41
inputs {
query(e) tensor<bfloat16>(x[384])
}
first-phase {
expression: 2 * closeness(field, embedding) + bm25(text) / 11
}
match-features: bm25(text) closeness(field, embedding)
}
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation in the rank-profile definition. Lines use 8 spaces for indentation instead of the standard 2 or 4 spaces used in the document field definitions.

Suggested change
inputs {
query(e) tensor<bfloat16>(x[384])
}
first-phase {
expression: 2 * closeness(field, embedding) + bm25(text) / 11
}
match-features: bm25(text) closeness(field, embedding)
}
inputs {
query(e) tensor<bfloat16>(x[384])
}
first-phase {
expression: 2 * closeness(field, embedding) + bm25(text) / 11
}
match-features: bm25(text) closeness(field, embedding)
}

Copilot uses AI. Check for mistakes.

<!-- Setup the client to Bedrock -->
<component id="openai" class="ai.vespa.llm.clients.OpenAI">
<config name = "ai.vespa.llm.clients.llm-client">
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space in the config name attribute. Should be name="ai.vespa.llm.clients.llm-client" instead of name = "ai.vespa.llm.clients.llm-client" to follow standard XML formatting conventions.

Suggested change
<config name = "ai.vespa.llm.clients.llm-client">
<config name="ai.vespa.llm.clients.llm-client">

Copilot uses AI. Check for mistakes.

### Set-up an AWS Bedrock API Key

Create an [AWS BedRock API key](https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html).
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect capitalization: "BedRock" should be "Bedrock" (lowercase 'r'). The official AWS product name is "Amazon Bedrock" not "BedRock".

Copilot uses AI. Check for mistakes.
@zoharsan zoharsan closed this Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants