Background/Objectives: We assessed the effectiveness and safety of vitamin K antagonists (VKAs) versus direct oral anticoagulants (DOACs) in patients with atrial fibrillation (AF) using artificial intelligence techniques. Methods: This is a retrospective study in 15 Spanish hospitals (2014-2020), including adult AF patients with no history of anticoagulation, thrombosis events, rheumatic mitral valvular heart disease, mitral valve stenosis, or pregnancy. We employed EHRead® technology based on natural language processing (NLP) and machine learning (ML), along with SNOMED-CT terminology, to extract clinical data from electronic health records (EHRs). Using propensity score matching (PSM), the effectiveness, safety, and hospital mortality of VKAs versus DOACs were analyzed through Kaplan-Meier curves and Cox regression. Results: Out of 138,773,332 EHRs from 4.6 million individuals evaluated, 44,292 patients were included, 79.6% on VKAs and 20.4% on DOACs. Most patients were elderly [VKA 78 (70, 84) and DOAC 75 (66, 83) years], with numerous comorbidities (75.5% and 70.2% hypertension, 47.2% and 39.9% diabetes, and 40.3% and 34.8% heart failure, respectively). Additionally, 60.4% of VKA and 48.7% of DOAC users had a CHA2DS2-VASc Score ≥4. After PSM, 8929 patients per subgroup were selected. DOAC users showed a lower risk of thrombotic events [HR 0.81 (95% CI 0.70-0.94)], minor bleeding [HR 0.89 (95% CI 0.83-0.96)], and mortality [HR 0.80 (95% CI 0.69-0.92)]. Conclusions: Applying NLP and ML, we generated valuable real-world evidence on anticoagulated AF patients in Spain. Even in complex populations, DOACs have demonstrated a better safety and effectiveness profile than VKAs.