- Newest
- Most votes
- Most comments
The error you're encountering suggests there's an issue with the endpoint URL you're using. For Amazon Bedrock Knowledge Base operations like RetrieveAndGenerate, you need to use the Bedrock Agent Runtime client, not the Bedrock Runtime client.
The correct endpoint format for the RetrieveAndGenerate API should be:
https://bedrock-agent-runtime.us-east-2.amazonaws.com/retrieveAndGenerate
Notice the difference: you should use bedrock-agent-runtime instead of bedrockruntime in the URL. This is because Knowledge Base operations are part of the Bedrock Agent Runtime service.
When making the POST request in Postman, ensure you:
- Use the correct endpoint with
bedrock-agent-runtime - Include proper AWS authentication headers (SigV4 signing)
- Set the Content-Type header to application/json
- Include the required JSON payload with your input text, knowledge base ID, and model ARN
The error "getaddrinfo ENOTFOUND" indicates that the DNS resolution failed because the hostname you provided doesn't exist, which confirms you were using an incorrect endpoint URL.
Sources
RetrieveAndGenerate - Amazon Bedrock
Community | Add Generative AI to a JavaScript Web App ingle page app.
Knowledge bases for Amazon Bedrock - AWS Prescriptive Guidance
Relevant content
asked 3 years ago
