# Q&A chatbot using timeseries data (Need efficient approach)

**URL:** <https://discuss.huggingface.co/t/q-a-chatbot-using-timeseries-data-need-efficient-approach/166761>\
**Category:** Beginners\
**Created:** [August 14, 2025, 2:59am UTC](https://discuss.huggingface.co/t/q-a-chatbot-using-timeseries-data-need-efficient-approach/166761 "2025-08-14T02:59:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HVD23](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@HVD23](https://discuss.huggingface.co/u/HVD23)\
**Post date:** [August 14, 2025, 2:59am UTC](https://discuss.huggingface.co/t/q-a-chatbot-using-timeseries-data-need-efficient-approach/166761/1 "2025-08-14T02:59:03Z")

</div>

Hi All,

I need your suggestions. I want to build a QnA chatbot. I have structured time-series data in a PostgreSQL database, including minute, hourly, daily, ML results, Recommendations and Anomalies data.

I want to understand the best way to implement QnA chatbot. Do I need to use :

RAG approach to convert all this data to vectors? or APIs to aggregate the data and pass it directly to an LLM? or is there any efficient approach?

Thank you for the help!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [August 14, 2025, 10:40am UTC](https://discuss.huggingface.co/t/q-a-chatbot-using-timeseries-data-need-efficient-approach/166761/2 "2025-08-14T10:40:00Z")

</div>

If an [approach combining RAG and SQL](https://medium.com/google-cloud/how-to-implement-hybrid-search-for-rag-with-bigquery-c7278e630b52) is possible, that would be desirable.

If structured data already exists, especially data containing numbers, it would be a waste to simply vectorize all of it. The embedding used for RAG retrieval is basically designed for text. It is not good at accurately handling numbers that have been vectorized as-is.

- [Build a Question/Answering system over SQL data](https://python.langchain.com/docs/tutorials/sql_qa/)
- [pgvector](https://github.com/pgvector/pgvector)

---

<div class="post-metadata">

**Author:** ![Pimpcat-AU](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pimpcat-au/32/48989_2.png) [@Pimpcat-AU](https://discuss.huggingface.co/u/Pimpcat-AU)\
**Post date:** [August 14, 2025, 8:03pm UTC](https://discuss.huggingface.co/t/q-a-chatbot-using-timeseries-data-need-efficient-approach/166761/3 "2025-08-14T20:03:43Z")

</div>

![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/f/2/f25d780acbd19dd421d853614d5d791c4b1bde28.jpeg)

This Q and A dataset that I created might serve as an example. I utilized 3 tags “question:”, “context:” and “answer:”. Along with an anchor point tag “|”. This way it avoids creating noise in the data and provides a pattern the bot can recognize.

I can setup a link with the training script, vocab and dataset if you’d like. Could save you a lot of time.
