- Newest
- Most votes
- Most comments
The error you're encountering is related to how the metadata JSON is being parsed by the command line. When you use single quotes around your JSON metadata, the shell might still interpret certain characters within it, causing the JSON structure to break.
To fix this issue, you need to properly escape the quotes in your metadata JSON. Here are a couple of approaches you can try:
- Use double quotes around the entire JSON and escape the inner double quotes:
s3vectors-embed put --vector-bucket-name "test-vector-bucket" --index-name "titan-vector-index" --model-id "amazon.titan-embed-text-v2:0" --text "\test.jsonl" --metadata "{\"category\": \"test\", \"source\": \"huggingface\", \"tasks\": \"sentence similarity\", \"languages\": \"english\", \"modalities\": \"text\"}"
- Or save your metadata to a JSON file and reference it:
s3vectors-embed put --vector-bucket-name "test-vector-bucket" --index-name "titan-vector-index" --model-id "amazon.titan-embed-text-v2:0" --text "\test.jsonl" --metadata-file metadata.json
Remember that metadata in S3 Vectors can include various types like string, number, boolean, and lists. By default, all metadata is filterable unless explicitly specified as non-filterable, which allows you to filter your query results based on specific attributes.
Also, make sure your vector index is created with the correct dimension for the Titan embedding model you're using (amazon.titan-embed-text-v2:0). This model supports dimensions of 1024, 512, or 256, with 1024 being the standard choice for optimal performance.
Sources
S3 Vector, Bedrock embedding Error | AWS re:Post
Working with S3 Vectors and vector buckets - Amazon Simple Storage Service
Vectors - Amazon Simple Storage Service
Hello,
After some tests, I noticed that the initial syntax works in Windows PowerShell, but not in Windows Command Prompt (cmd).
s3vectors-embed put --vector-bucket-name "test-vector-bucket" --index-name "titan-vector-index-2" --model-id "amazon.titan-embed-text-v2:0" --text-value "Hello Mr. Andersen !" --metadata '{"category": "test", "source": "huggingface", "tasks": "sentence similarity", "languages": "english", "modalities": "text"}'
answered a year ago
Relevant content
asked a year ago

Thank you for the answer,
It worked like at point 1, and there is no such option
--metadata-filelike at point 2