Building the Future of Legal AI: A Deep Dive into RAG Technology