Rag-Architect: Optimizing Retrieval for High-Performance Agents