Blog

How RAG Architecture Changed: From PDF Chatbots to Context Engineering

Piotr Piotrowski
Piotr Piotrowski
AI Lead & Agile Delivery Lead
Monika Stando
Monika Stando
Marketing Campaigns Team Leader
Table of Contents

RAG (Retrieval-Augmented Generation) is an AI architecture approach that connects a language model to external knowledge sources so it can generate answers grounded in specific documents or organizational data.

The most important shift in RAG over the past two years was not technical. It was a change in how engineers think about the problem itself. After the first wave of GenAI experiments, teams learned that PDF files plus a vector database plus a language model is not a universal recipe for organizational knowledge. It is the simplest variant of a much broader challenge: how to deliver the right context, from the right source, at the right moment, with the right quality controls. This article traces that shift and explains what a mature engineering approach to RAG looks like today.

Key Takeaways:

  • The most important shift in RAG was a change in how engineers think about when and why to use retrieval.
  • The real problem in most failing RAG implementations is retrieval quality, not the language model.
  • Modern RAG is one component inside a broader context engineering architecture, not a standalone solution.
  • Enterprise RAG requires access controls at every level, citation traceability, and evaluation metrics before it works reliably at scale.

Why Do So Many Teams Think RAG Is Just a Vector Database?

Many leaders hear RAG and picture the same thing. A vector database, a folder of PDF documents, and a chatbot on top. And that is an outdated architectural model.

The simplification happened fast and for understandable reasons. In 2023 and 2024, RAG was the fastest way to build a demo that impressed stakeholders. The pipeline was short. Load documents, generate embeddings, store them in a vector database, retrieve the closest matches, attach them to the prompt, and ask the model. It worked well enough to show. Many teams never moved past it.

The Evolution of RAG: From PDFs to Context Engineering

This article traces how RAG evolved from that prototype pattern into something more precise, more layered, and more useful. Understanding that evolution helps determine whether the AI system you build holds up in production or collapses under the weight of real organizational data.

Why Was RAG Created and What Problem Did It Actually Solve?

The original RAG research appeared in 2020. The problem it addressed was specific.

Language models store knowledge inside their parameters, in the weights learned during training. That knowledge is fixed at the time of training. It does not update. It does not know what happened last quarter. It does not know what is in your company’s internal documentation. And when the model generates an answer, there is no way to trace which part of its training produced that answer.

Three concrete problems followed from this.

  1. Knowledge cutoff. A model trained last year does not know your current pricing, your latest regulatory requirements, or the outcome of last month’s project retrospective.
  2. Private data. A large language model has never seen your SharePoint, your Confluence instance, your project management history, or your bid library. That knowledge is invisible to it.
  3. Source attribution. When a model answers from its internal memory, there is no citation. Users cannot verify the answer. Compliance teams cannot audit it.

The RAG solution was direct. Instead of retraining the model to absorb new knowledge, you give it the relevant knowledge at query time. The model receives external documents as context and generates its answer from them. Retraining is expensive. Retrieval is cheap.

This core insight remains valid today. What changed is what retrieval means in practice.

How Did RAG Become the PDF Chatbot?

In 2023 and 2024, RAG became synonymous with a specific pipeline.

documents → chunks → embeddings → vector database
query → embedding → top k similar chunks → prompt → answer

The pattern spread fast. It was easy to build with available tooling. It produced demos that looked compelling. You could load a hundred documents, ask questions, and the model answered from them. That felt like a breakthrough to stakeholders who had never seen it before.

The pipeline worked well as a marketing artifact because it made the power of language models tangible. Instead of a model answering from abstract training data, it answered from your documents. Vector database vendors recognized this and positioned their products around it. “Connect your documents to a language model” became a product category. Consultants packaged it. Platforms automated it. And many teams built this system and called it their AI knowledge base. Many of those systems underperformed or were abandoned within twelve months. The architecture was not fundamentally wrong. It was sized for a proof of concept, not for an organization that depends on correct answers.

The first response to that failure was usually more of the same. Bigger models. Larger context windows. More documents ingested. More chunks indexed. That brute force approach still produced an impressive demo. It did not produce systems that were reliable, auditable, or grounded in real organizational workflows.

Where Does the Naive RAG Model Break Down?

The naive pipeline breaks in predictable ways. Most organizations encounter several of these before rebuilding.

Lost in the Middle

Research on large language model attention showed that models do not process long contexts uniformly. Information at the start and the end of a context window tends to be used more than information buried in the middle.

Packing 200 pages of documentation into a prompt does not guarantee the model will find the relevant passage. More context is not better context. 

Chunking That Destroys Structure

The naive pipeline splits documents into chunks of fixed size. A book chapter cleanly splits. An HR policy with nested exceptions, conditional clauses, and references to other sections does not.

A vector search finds the most semantically similar chunk. It does not find the most contextually complete chunk. Ask a system about the notice period in a B2B contract. The retriever may return “the notice period is six days” without returning the heading above it that specifies this clause applies only to permanent employees. The model answers confidently. The answer is wrong.

This problem drove the development of Structured Chunking, Parent-to-Child Retrieval, Contextual Retrieval, and Reranking. Anthropic published research showing that Contextual Retrieval, which enriches each chunk with surrounding document context before indexing, can reduce failed retrievals by a measurable margin.

Retrieval That Returns the Wrong Chunks

Returning the most similar k chunks gives no guarantee those chunks are sufficient to answer the question. The k value is a tuning knob, not a solution. Too small and you miss critical context. Too large and you flood the prompt with noise.

No Permissions

In a demo, you ask a document. In a company with a larger IT ecosystem, you ask for a document that belongs to a team, a clearance level, or a confidential project. The naive pipeline has no concept of access control. Every user sees everything the index contains. That is not acceptable in any real organization.

No Evaluation

A vector database has no built-in mechanism to determine whether the answer it helped generate was correct. RAG systems without evaluation fail silently. They produce confident wrong answers. No one knows until someone catches a mistake manually.

Stale Indexes

Documents change. Procedures get updated. Policies are revised. An index built from last quarter’s documents answers questions about this quarter with outdated information. If the indexing pipeline is not continuous and incremental, the knowledge base ages. Users stop trusting it. They return to searching manually.

What Does RAG Look Like in a Production System Today?

The naive pipeline was a retrieval pattern. A production system is a context engineering architecture.

Context engineering is the practice of deciding what information a language model receives, from which source, by which method, and in what order, for a given query. RAG is one mechanism inside that practice.

Agentic Retrieval

In classic RAG, the model was passive. The retriever gathered context. The model answered.

In an agentic setup, the model actively orchestrates its own context gathering.

model analyzes the query
    │
    ├── semantic search
    ├── keyword search
    ├── reads full document
    ├── queries API
    ├── queries SQL
    ├── checks permissions
    ├── asks for clarification
    └── only then responds

Research from Amazon Science showed that agents using simple keyword search tools can achieve over 90 percent of the performance of traditional RAG without a persistent vector database. Vector databases are not obsolete. They are no longer the default answer to every retrieval problem.

Reasoning models accelerate this further. Models that can plan, evaluate intermediate results, select tools, and iterate toward an answer work best when given a clearly defined toolkit and signals about which tool to use when. A vector search is one tool in that kit. Building the entire system around it misses the architectural opportunity those models create.

The Architecture of RAG within a GenAI system

The diagram below maps where RAG sits inside a production GenAI system.

genai-system/
├── user-intent-understanding/
├── context-engineering/
│   ├── rag/
│   │   ├── vector-search/
│   │   ├── hybrid-search/
│   │   ├── reranking/
│   │   ├── graph-rag/
│   │   ├── hierarchical-rag/
│   │   └── contextual-retrieval/
│   │
│   ├── tool-based-context/
│   │   ├── SQL/
│   │   ├── APIs/
│   │   ├── search/
│   │   ├── file-readers/
│   │   └── code-repo-tools/
│   │
│   ├── memory/
│   ├── summaries/
│   ├── access-control/
│   └── context-compression/
│
├── model-orchestration/
├── evaluation/
├── observability/
├── governance/
└── user-experience/

RAG sits next to SQL, APIs, search, and code analysis tools as peers inside context engineering. Context engineering itself sits next to evaluation, governance, and observability as layers inside the full system. Building a production AI system means engineering all of these layers, not just the retrieval component.

Enterprise Governance of the Production-ready RAG System

A production RAG system requires more than a vector store and a retrieval loop.

enterprise-rag/
├── document-level-permissions/
├── chunk-level-permissions/
├── source-level-permissions/
├── audit-log/
├── citation-traceability/
├── data-retention/
├── data-residency/
├── prompt-injection-defense/
└── retrieval-poisoning-defense/

The last two items deserve attention. Prompt injection through retrieved documents and retrieval poisoning through manipulated knowledge bases are real attack vectors in production systems. A vector database that accepts external content without validation is an attack surface, not just a storage layer.

RAGAS (a RAG evaluation framework) defines metrics including faithfulness, answer relevancy, context precision, and context recall. These measure both the quality of the model’s answer and the quality of what the retriever returned. Failing to evaluate means failing silently.

When Does RAG Make Sense?

RAG works when the answer lives in documents, when retrieval needs to be repeatable, and when the system needs to show where the answer came from.

  • Internal knowledge base. Procedures, policies, and internal guides that employees ask questions about regularly. A good RAG system here handles permissions, citations, and incremental indexing. It should not be naive RAG. It needs structured chunking, metadata, access control, and evaluation.
  • Bid preparation and lessons learned. Drawing from past project offers, estimates, and retrospectives to support new bids. The knowledge is distributed across documents and is strongly contextual. Human review before any output is used externally is appropriate.
  • Compliance and regulatory documents. Long documents where questions require synthesis across multiple sections. Graph RAG or hierarchical retrieval handles these better than flat vector search.
  • Customer support. Large, frequently updated documentation. RAG answers “what does this error code mean?” while a direct API call answers “what is the status of this specific ticket?”
  • Analyst and consultant support. Internal playbooks, discovery templates, project checklists, and workshop outputs. If your organization collects lessons learned from projects, a RAG system over that corpus can assist every subsequent project team.

In all of these cases, the knowledge lives in text, it changes over time, and the system needs to show where the answer came from.

When Should Teams Choose Something Other Than RAG?

The more important skill is knowing when not to use RAG.

Query or problem type

Best mechanism

Knowledge in documents, procedures, or policies

RAG

Knowledge across many documents with complex relationships

GraphRAG or hierarchical RAG

Current status in a transactional system

API or system of record

Numerical data, aggregations, or reports

SQL or BI layer

Action to execute

Tool use, workflow, or agent with authorization

Source code and code dependencies

Grep, AST, LSP, or agentic code search

Style, format, or classification task

Prompt engineering or fine-tuning

Small, one-time document analysis

Long context upload, without full RAG pipeline

Document base with poor data quality

Data governance first, RAG second

High-risk decision requiring accountability

AI assist with mandatory human approval

A relational database exists for a specific reason. An API is the correct path to live system state. A knowledge graph models relationships better than flat retrieval. Full-text search still outperforms embeddings in many keyword-heavy domains.

An LLM should not replace all of these. It should be composed deliberately with them.

This is what separates AI engineering from AI experimentation. Experimentation reaches for the most exciting tool. Engineering asks what the use case actually requires. An engineer does not choose a tool because it is popular. An engineer understands the properties of the problem, the constraints of the technology, and the consequences of each architectural decision.

When a team starts routing all query types through a single vector database, the architecture has already missed the point.

What Should Change About How We Think About RAG?

RAG is not the final answer to organizational knowledge in AI systems. It is one important pattern in a larger system.

It solves a specific problem well: grounding model answers in external, changing, textual or semi-structured knowledge that you cannot or do not want to encode into model weights. When that is the job, RAG is the right choice. When it is not, using RAG anyway is an expensive workaround for a problem that a simpler, more reliable technology already handles better.

RAG, SQL, API calls, knowledge graphs, workflow automation, classic search, and traditional application logic are not competing options. Mature teams compose them deliberately, assigning each mechanism to the job it does best.

The question that should guide that composition is not “should we implement RAG?”

The right question is: what context mechanism does this specific process actually need?

The teams that ask that question will build AI systems that hold up in production. The teams that skip it will keep rebuilding the same demo.

Piotr Piotrowski
Piotr Piotrowski
AI Lead & Agile Delivery Lead
  • follow the expert:
Monika Stando
Monika Stando
Marketing Campaigns Team Leader
  • follow the expert:

FAQ

What is the difference between naive RAG and advanced RAG?

Naive RAG splits documents into chunks of fixed size, embeds them, stores them in a vector database, and retrieves the closest matches for each query. Advanced RAG adds structured chunking, contextual enrichment of chunks before indexing, reranking of retrieved results, and evaluation of retrieval quality over time. The core difference is that advanced RAG treats retrieval as an engineering problem requiring continuous improvement, not a one-time setup.

What is context engineering and how does it relate to RAG?

Context engineering is the practice of deciding what information a language model receives, from which source, by which method, and in what order, for a given query. RAG is one mechanism inside context engineering, specifically the mechanism that retrieves relevant content from document stores. A complete context engineering architecture also includes routing, tool use, memory management, summaries, and evaluation.

What governance features does a production RAG system need?

A production RAG system needs access controls at the document and chunk level, an audit log of all retrieval events, citation traceability for every answer, and a defined evaluation process using metrics like faithfulness and context precision. It also needs defenses against prompt injection through retrieved content and retrieval poisoning through manipulated source documents.

When should a team use SQL instead of RAG?

Use SQL when the question requires exact numbers, aggregations, filters, or joins. Questions about revenue, headcount, average margins, or SLA breaches need precise computation. A vector search cannot count or compute. RAG is appropriate for interpretive questions over documents, not analytical questions over structured data.

Is RAG still relevant in 2026 with large context window models?

Yes, but for different reasons than in 2023. Large context windows do not guarantee that models will use all the information in them equally. RAG is now less about fitting knowledge into a window and more about selecting the right knowledge to place there. Precision matters more than volume.

Testimonials

What our partners say about us

Hicron Software proved to be a trusted partner with unmatched technical expertise, delivering a scalable and user-friendly web application that was pivotal to our successful U.S. market expansion.

Mikko Hyvärinen
Director of Software Portfolio at iLOQ

Hicron’s contributions have been vital in making our product ready for commercialization. Their commitment to excellence, innovative solutions, and flexible approach were key factors in our successful collaboration.
I wholeheartedly recommend Hicron to any organization seeking a strategic long-term partnership, reliable and skilled partner for their technological needs.

tantum sana logo transparent
Günther Kalka
Managing Director, tantum sana GmbH

After carefully evaluating suppliers, we decided to try a new approach and start working with a near-shore software house. Cooperation with Hicron Software House was something different, and it turned out to be a great success that brought added value to our company.

With HICRON’s creative ideas and fresh perspective, we reached a new level of our core platform and achieved our business goals.

Many thanks for what you did so far; we are looking forward to more in future!

hdi logo
Jan-Henrik Schulze
Head of Industrial Lines Development at HDI Group

Hicron is a partner who has provided excellent software development services. Their talented software engineers have a strong focus on collaboration and quality. They have helped us in achieving our goals across our cloud platforms at a good pace, without compromising on the quality of our services. Our partnership is professional and solution-focused!

NBS logo
Phil Scott
Director of Software Delivery at NBS

The IT system supporting the work of retail outlets is the foundation of our business. The ability to optimize and adapt it to the needs of all entities in the PSA Group is of strategic importance and we consider it a step into the future. This project is a huge challenge: not only for us in terms of organization, but also for our partners – including Hicron – in terms of adapting the system to the needs and business models of PSA. Cooperation with Hicron consultants, taking into account their competences in the field of programming and processes specific to the automotive sector, gave us many reasons to be satisfied.

 

PSA Group - Wikipedia
Peter Windhöfel
IT Director At PSA Group Germany

Get in touch

Say Hi!cron

This site uses cookies. By continuing to use this website, you agree to our Privacy Policy.

OK, I agree