I implemented self routing based on self reflection for RAG and Long context methods in Agentic way

I Made This 🤖

I created a Self routing architecture for RAG and Long context agent based on Self reflection

I read a research paper where they introduces the concept of self reflection to achieve self routing. and I just implemented the same thing using agentic frameworks. I used Gemini, Vertex AI (for managed RAG service)and google ADK.

Basically how it works is it retrieves the chunks from rag and then an evaluator agent , evaluates if the retrieved chunks are good enough or not if not then it routes to long context model . same happens when the info is not present in the RAG vector db. Basically evaluation before generation and not evaluation after generation , saving a lot of compute tax

I even wrote an article on this let me know if you guys wanna read it and see the code on my GitHub I will attach all the relevant links in the comment

Posted Apr 1, 2026, 5:53 AM UTC

25
Loading comments…