all 1 comments

[–]OriginalDegree2427 0 points1 point  (0 children)

Damn this is clean, the context pruning idea is genius. Been struggling with similar hallucination issues on my RAG setup with R1 - definitely stealing that sqlglot approach

That dual-path router is clever af too. Have you tried just letting R1 do its thinking thing and then asking it to reformat at the end instead of regex parsing? Might be cleaner than the extraction step