RAG & Code Validation: Empower AI, Prevent Hallucinations