Reading the RAG Paper from a Backend Perspective
메뉴

AI Backend

Reading the RAG Paper from a Backend Perspective

A backend reading of retrieval and generation as separate service responsibilities.

Reading the RAG Paper from a Backend Perspective hero image

How will the service structure change if you combine search and creation?

In this article, we read the RAG original paper “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks” from the perspective of a back-end developer.

When people first encounter RAG, they usually understand it as “searching for vectors and putting them into LLM.” It's not wrong, but it's not enough to create an actual service. RAG is not a simple function, but an architecture that changes the storage location of knowledge.

The model not only uses the knowledge it has in internal parameters, but also searches an external document repository and reflects it in the answer. From a back-end perspective, the problem is “how to store, retrieve, and connect to evidence the knowledge that LLM does not know.”

Analysis base date: 2026-05-12 Practice reference environment: PostgreSQL, pgvector, embedding model, LLM API Main reference materials: RAG Paper, pgvector Docs, OpenAI Evals Docs

Key takeaways

  • RAG is an approach that combines parametric memory and non-parametric memory.
  • From a backend perspective, RAG is a combination of a document repository, searcher, generator, and evaluator.
  • The core of RAG is not “I searched,” but “I reliably provide well-founded answers.”
  • Search quality and generation quality should be assessed separately.
  • Citation, authority, recency, and re-indexing are key issues in RAG operation.

1. Why you should watch RAG

LLMs have a lot of knowledge, but they don't know everything up to date. Your organization's internal documents, latest policies, product manuals, failure reports, and codebase documents may not be in your model's training data.

RAG is a representative structure for solving this problem.

# This is an example.user questionsto Search related documentsto Configure the searched documents into contextto LLM generates context-based answersto Reply with source

2. Critical awareness of the paper

The RAG paper believes that large pre-trained models store factual knowledge in parameters, but have limitations in accurately accessing, updating, or providing sources of knowledge.

If we change it to a backend perspective, it looks like this.

# This is an example.With only knowledge inside the model,- It is difficult to reflect the latest documents.- It is difficult to provide sources.- It is difficult to reflect knowledge by organization.- Difficult to track wrong answers.

So we need an external knowledge repository.

3. Parametric Memory and Non-parametric Memory

conceptthesis perspectivebackend perspective
Parametric MemoryKnowledge stored in model parametersGeneral knowledge that LLM itself knows
Non-parametric MemorySearchable External KnowledgeDocument DB, vector index, search engine
retrieverSearch related documentsembedding search, hybrid search
GeneratorGenerate AnswerLLM API or own model

In practice, non-parametric memory is very important. This is because if the document changes, the index can be updated rather than retraining the model.

4. retriever and Generator

RAG is a combination of a searcher and a generator.

# This is an example.retriever:Find document chunks related to your question. Generator:An answer is generated based on the retrieved chunk.

It is not enough to like just one of the two. If the searcher retrieves the wrong document, the answer may be wrong no matter how good the generator is. Conversely, even if you import a good document, if the generator ignores the evidence, the quality deteriorates.

5. Interpreting with backend architecture

If we draw the RAG service as a backend structure, it looks like this:

# This is an example.Document Source→ Ingestion Worker→ Chunking→ Embedding→ Vector Store→ Retrieval API→ Prompt Builder→ LLM→ Response Validator→ Citation Renderer→ Eval Logger

The important operational points in this structure are:

layeroperational questions
IngestionHow to detect document changes?
ChunkingWhat chunk size matches your search quality?
EmbeddingWill you reindex when the model changes?
Vector StoreHow to apply metadata filters and permissions?
Prompt BuilderHow many search results will you include?
LLMHow do we prevent unfounded answers?
EvalHow to separate retrieval failures from creation failures?

6. Failure types of RAG

failure typeexplanationreact
Retrieval missCouldn't find any related documentationquery rewrite, hybrid search
Retrieval noiseMixed-up unrelated documentsreranking, metadata filter
Context overflowToo many documentstoken budget, compression
Citation hallucinationCreate a source that doesn't existCitation is selected only from chunk_id
Permission leakUnauthorized document detectedServer-side ACL filter
Stale indexReply with an old documentreindex trigger, versioning

The most dangerous thing about RAG is when the answer is plausible but the evidence is wrong.

7. Evaluate search quality and answer quality

RAG evaluation should be divided into two steps.

evaluationquestion
Retrieval QualityDid the correct answer document appear in the search results?
Answer QualityDid you answer correctly based on the searched evidence?

Example metrics:

# This is an example.retrieval_precision@kretrieval_recall@kanswer_correctnesscitation_accuracygroundedness

Directions for improvement can only be seen by separating whether search or creation failed.

8. Practical application checklist

# This is an example.[ ] Do you save the document source and version?[ ] Is chunk_id connected to citation?[ ] Is there a plan for re-indexing when the embedding model changes?[ ] Is metadata filter applied to vector search?[ ] Are user rights enforced during the retrieval step?[ ] Are search quality and answer quality evaluated separately?[ ] Can the stale index be detected?[ ] Are RAG failure cases accumulated as an eval dataset?

9. Q&A

Q1. Does RAG replace fine-tuning?

This isn't always the case. If providing up-to-date external knowledge, internal organization documentation, and sources is important, RAG is beneficial. Fine-tuning may be more appropriate for learning a specific style or task pattern.

This may be sufficient initially. However, if the keyword contains many important documents, numbers, codes, or proper nouns, a hybrid search may be necessary.

Q3. How do I increase RAG quality?

We need to improve search queries, chunking, embedding, metadata filter, reranking, prompt, and eval together. If you only change one thing, it's easy to miss the cause.

10. References and uncertainty

References

uncertainty

  • The structure of the RAG paper and the current production RAG implementation may differ.
  • The optimal combination of chunking, embedding, and reranking varies from dataset to dataset.

Backend application example: Replacing RAG paper terminology with service components

The explanation directly addressed by the paper is the distinction between parametric memory and non-parametric memory.

This is the explanation in the paper. Moving to a backend service requires separation of roles. The model generates the answer, the document store and retriever pick the evidence, and the API layer is responsible for permissions and traces.

thesis terminologyservice componentoperational questions
retrieverSearch API, vector indexWhich document should I choose as a candidate?
generatorLLM Call HierarchyIs the answer based only on search results?
non-parametric memoryDocument DB and embedding storeAre versions and permissions managed?
marginalizationCombining multiple candidate groundsHow to deal with conflicting evidence

A failure case is to understand RAG only as a “chatbot with vector search”. The explanation in the paper is that it combines search and generation to place the knowledge source outside the model.

The service interpretation of this article is that the source must be left as document version, chunk id, authority, and citation. That way, if the answer is wrong, you can not only correct the prompt, but also determine which of the search candidates, chunk policy, reranker, and evaluation data is the problem.

This distinction is also necessary in operational retrospectives. The structure mentioned in the paper does not directly determine a specific DB schema. Schema, permissions, trace, and eval dataset are implementation interpretations for which the service team is responsible. So, rather than mixing thesis facts and product design decisions in the same paragraph, you should write the rationale and application separately.

댓글

GitHub 계정으로 로그인하면 댓글을 남길 수 있습니다. 댓글은 GitHub Discussions를 통해 운영됩니다.

TOP