aws-samples / aws-samples/amazon-bedrock-samples
knowledge base creation issue
- Dominant language
- Jupyter Notebook
- Stars
- 1.5k
- Forks
- 734
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 4
Description
[`code`](https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag-solutions/contextual-chatbot-using-knowledgebase/notebook/knowledge_base_create_ingest_documents.ipynb) given in this notebook is failing with the below error. while creating the knowledge base.
`err=ValidationException('An error occurred (ValidationException) when calling the CreateKnowledgeBase operation: The knowledge base storage configuration provided is invalid... The OpenSearch Serverless engine type associated with your vector index is invalid. Recreate your vector index with one of the following valid engine types: FAISS. Then retry your request.'), type(err)=`
**i have changed the engine type to 'faiss' then the vector index creation itself failing. May be we need to change the openserach version used in this notebook.**
`TransportError Traceback (most recent call last)
Cell In[34], line 2
1 # Create index
----> 2 response = oss_client.indices.create(index=index_name, body=json.dumps(body_json))
3 print('\nCreating index:')
4 print(response)
File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/opensearchpy/client/utils.py:179, in query_params.._wrapper.._wrapped(*args, **kwargs)
176 if v is not None:
177 params[p] = _escape(v)
--> 179 return func(*args, params=params, headers=headers, **kwargs)
File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/opensearchpy/client/indices.py:128, in IndicesClient.create(self, index, body, params, headers)
125 if index in SKIP_IN_PATH:
126 raise ValueError("Empty value passed for a required argument 'index'.")
--> 128 return self.transport.perform_request(
129 "PUT", _make_path(index), params=params, headers=headers, body=body
130 )
File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/opensearchpy/transport.py:409, in Transport.perform_request(self, method, url, headers, params, body)
407 raise e
408 else:
--> 409 raise e
411 else:
412 # connection didn't fail, confirm it's live status
413 self.connection_pool.mark_live(connection)
File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/opensearchpy/transport.py:370, in Transport.perform_request(self, method, url, headers, params, body)
367 connection = self.get_connection()
369 try:
--> 370 status, headers_response, data = connection.perform_request(
371 method,
372 url,
373 params,
374 body,
375 headers=headers,
376 ignore=ignore,
377 timeout=timeout,
378 )
380 # Lowercase all the header names for consistency in accessing them.
381 headers_response = {
382 header.lower(): value for header, value in headers_response.items()
383 }
File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/opensearchpy/connection/http_requests.py:230, in RequestsHttpConnection.perform_request(self, method, url, params, body, timeout, allow_redirects, ignore, headers)
217 if (
218 not (200 <= response.status_code < 300)
219 and response.status_code not in ignore
220 ):
221 self.log_request_fail(
222 method,
223 url,
(...)
228 raw_data,
229 )
--> 230 self._raise_error(
231 response.status_code,
232 raw_data,
233 response.headers.get("Content-Type"),
234 )
236 self.log_request_success(
237 method,
238 url,
(...)
243 duration,
244 )
246 return response.status_code, response.headers, raw_data
File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/opensearchpy/connection/base.py:301, in Connection._raise_error(self, status_code, raw_data, content_type)
298 except (ValueError, TypeError) as err:
299 logger.warning("Undecodable raw error response from server: %s", err)
--> 301 raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
302 status_code, error_message, additional_info
303 )
TransportError: TransportError(500, 'exception', 'Internal error occurred while processing request')`
Contributor guide
Research direction
Start with notebook/knowledge_base_create_ingest_documents.ipynb, especially cell 34 where oss_client.indices.create fails. Reproduce the vector-index creation and CreateKnowledgeBase steps using the notebook's current OpenSearch Serverless configuration, then verify that the index uses the required FAISS engine and the knowledge base is created successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, jupyter-notebook, python
- Domain
- ai, cloud, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100