SAKR: Enhancing Retrieval-Augmented Generation via Streaming Algorithm and K-Means Clustering

Authors: Haoyu Kang, Yuzhou Zhu, Yukun Zhong, Ke Wang, and Ping Zhong
Conference: ICIC 2025 Posters, Ningbo, China, July 26-29, 2025
Pages: 821-832
Keywords: Retrieval-augmented generation, Natural Language Processing, Streaming algorithm.

Abstract

Retrieval-augmented generation RAG has achieved significant success in information retrieval to assist large language models LLMs in answering questions from unseen documents by building an external knowledge base. However, it faces significant challenges, including high memory consumption due to the extensive database and the inability to update the index database in real-time when handling large data streams. To reduce the memory required for building the database and maintain accuracy simultaneously, we proposed a novel approach that integrates a streaming algorithm with k-means clustering into RAG. Our approach applies a streaming algorithm to dynamic index updates and reduces memory consumption. Additionally, the k-means clustering algorithm that groups similar documents is applied to reduce query time. We conducted comparative experiments on RAG with streaming algorithm and k-means clustering SAKR , and the results indicated that SAKR outperforms traditional RAG in both accuracy and memory efficiency, particularly for large-scale streaming data, with an average accuracy of 0.640 and 10 memory cost.
📄 View Full Paper (PDF) 📋 Show Citation