This paper introduces WriteBack-RAG, a novel framework that treats the knowledge base in retrieval-augmented generation (RAG) systems as a trainable component, rather than a static one. It addresses the issue of fragmented and buried facts by using labeled examples to identify successful retrievals, isolate relevant documents, and distill them into compact, independent knowledge units. This approach aims to create a more dynamic and efficient knowledge base for RAG systems.