The query routing in zerikai_memory decides between using Ollama or DeepSeek based on a 4-step priority chain. The priorities are as follows: 1. Explicit use_cloud override. 2. CLOUD_ESCALATION_KEYWORDS keyword match. 3. CLOUD_ESCALATION_WORD_COUNT length threshold. 4. DEFAULT_MEMORY_MODE fallback (recommended). This decision-making process aims to balance privacy, speed, and API costs while providing maximum context nuance for the user. For more detailed information on modes, configurations, and usage, you can refer to the README.md file in the project repository. Sources: main.py:986, README.md:320, main.py:1495, main.py:1311, README.md:105