# Elasticsearch RAG - AI Playground - fix needed

**URL:** <https://discuss.elastic.co/t/elasticsearch-rag-ai-playground-fix-needed/384671>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [January 21, 2026, 12:18pm UTC](https://discuss.elastic.co/t/elasticsearch-rag-ai-playground-fix-needed/384671 "2026-01-21T12:18:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Musab\_Dogan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/musab_dogan/32/70691_2.png) [@Musab\_Dogan](https://discuss.elastic.co/u/Musab_Dogan)\
**Post date:** [January 21, 2026, 12:18pm UTC](https://discuss.elastic.co/t/elasticsearch-rag-ai-playground-fix-needed/384671/1 "2026-01-21T12:18:46Z")

</div>

Hello guys,

Thanks for sharing this amazing Elasticsearch RAG playground. It’s well prepared and easy to follow the instructions. There is a small bug in the last step, `Export code => Install code dependencies` part. The instruction says:

Run the following command in the terminal:

```bash
pip install elasticsearch
pip install openai

```

Everything is good so far, but

- the out-of-box installed k8s elasticsearch node on version 8.14.1
- pip install elasticsearch - it install dependencies for elasticsearch v9 as default

As a result it causes incompatibility error between the elasticsearch client and elasticsearch version, like the following.

```auto
root@host-1:~# python main.py
Traceback (most recent call last):
  File "/root/main.py", line 106, in <module>
    elasticsearch_results = get_elasticsearch_results(question)
  File "/root/main.py", line 71, in get_elasticsearch_results
    result = es_client.search(index="distributed-systems", body=es_query)
  File "/usr/local/lib/python3.9/dist-packages/elasticsearch/_sync/client/utils.py", line 421, in wrapped
    return api(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/elasticsearch/_sync/client/ __init__.py", line 4809, in search
    return self.perform_request( # type: ignore[return-value]
  File "/usr/local/lib/python3.9/dist-packages/elasticsearch/_sync/client/_base.py", line 271, in perform_request
    response = self._perform_request(
  File "/usr/local/lib/python3.9/dist-packages/elasticsearch/_sync/client/_base.py", line 351, in _perform_request
    raise HTTP_EXCEPTIONS.get(meta.status, ApiError)(
elasticsearch.BadRequestError: BadRequestError(400, 'media_type_header_exception', 'Invalid media-type value on headers [Accept, Content-Type]', Accept version must be either version 8 or 7, but found 9. Accept=application/vnd.elasticsearch+json; compatible-with=9)

```

As a workaround, I installed the elasticsearch client version 8 with the following command `pip install "elasticsearch>=8,<9"` and it worked.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/f/cfb5526c597391b0d215425bf223ebfe4d631151.jpeg)

> **[Elasticsearch AI Playground: Experiment, ingest, and prototype](https://www.elastic.co/demo-gallery/ai-playground)**
>
> Refine semantic text queries, export code, and prototype conversational search experiences. You can use AI Playground for query development and sophisticated RAG interactions — complete with pre-fille...
