---
title: "Why I Ditched RAG Pipelines for 1M Token Context Windows"
subtitle: "Moj AI Journey: Three Architectures, One Solution: Building AI for Legal Documents"
url: "https://talirezun.com/library/why-i-ditched-rag-pipelines"
markdown: "https://talirezun.com/library/why-i-ditched-rag-pipelines.md"
type: "Essay"
brand: "From Lab to Life"
published: "2026-01-21"
updated: "2026-10-19T09:31:17.178Z"
authors: ["Tali Režun"]
topics: ["Legal AI"]
---

# Why I Ditched RAG Pipelines for 1M Token Context Windows

*Moj AI Journey: Three Architectures, One Solution: Building AI for Legal Documents*

- URL: https://talirezun.com/library/why-i-ditched-rag-pipelines
- Type: Essay
- Brand: From Lab to Life
- Published: 2026-01-21
- Updated: 2026-10-19
- Author: Tali Režun
- Topics: Legal AI

## Summary

An 18-month build of a legal-document AI for Slovenian building legislation (Moj AI).

## Overview

An 18-month build of a legal-document AI for Slovenian building legislation (Moj AI). Traditional RAG with Docling and LangChain capped out at 80% accuracy and 20% hallucination. The breakthrough was a Gemini 2.5 Flash 1M-token context window plus a metadata-based "Librarian" that injects whole documents, with a Lightning Mode (5–30 s) and a Frontier Mode (analysis plus web search). App: mojai.xyz.

## Editions

Where to read the full work (the canonical edition first):

- [Medium](https://medium.com/@talirezun/why-i-ditched-rag-pipelines-for-1m-token-context-windows-d5a2982f7cce) (canonical)

## Related

- [Law = Code: Can AI Finally Democratise the World's Most Exclusive Algorithm?](https://talirezun.com/library/law-equals-code.md)
- [Law = Code; Research Paper](https://talirezun.com/library/law-equals-code-paper.md)
- [The Agent Memory Problem — And Why Your Second Brain Might Be the Answer](https://talirezun.com/library/agent-memory-problem.md)

---

HTML page: https://talirezun.com/library/why-i-ditched-rag-pipelines · The whole Library: https://talirezun.com/library.md
