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
| concept | thesis perspective | backend perspective |
|---|---|---|
| Parametric Memory | Knowledge stored in model parameters | General knowledge that LLM itself knows |
| Non-parametric Memory | Searchable External Knowledge | Document DB, vector index, search engine |
| retriever | Search related documents | embedding search, hybrid search |
| Generator | Generate Answer | LLM 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:
| layer | operational questions |
|---|---|
| Ingestion | How to detect document changes? |
| Chunking | What chunk size matches your search quality? |
| Embedding | Will you reindex when the model changes? |
| Vector Store | How to apply metadata filters and permissions? |
| Prompt Builder | How many search results will you include? |
| LLM | How do we prevent unfounded answers? |
| Eval | How to separate retrieval failures from creation failures? |
6. Failure types of RAG
| failure type | explanation | react |
|---|---|---|
| Retrieval miss | Couldn't find any related documentation | query rewrite, hybrid search |
| Retrieval noise | Mixed-up unrelated documents | reranking, metadata filter |
| Context overflow | Too many documents | token budget, compression |
| Citation hallucination | Create a source that doesn't exist | Citation is selected only from chunk_id |
| Permission leak | Unauthorized document detected | Server-side ACL filter |
| Stale index | Reply with an old document | reindex 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.
| evaluation | question |
|---|---|
| Retrieval Quality | Did the correct answer document appear in the search results? |
| Answer Quality | Did 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.
Q2. Is it enough to just use vector search?
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
- RAG Paper:https://arxiv.org/abs/2005.11401
- pgvector:https://github.com/pgvector/pgvector
- OpenAI Evals:https://platform.openai.com/docs/guides/evals
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 terminology | service component | operational questions |
|---|---|---|
| retriever | Search API, vector index | Which document should I choose as a candidate? |
| generator | LLM Call Hierarchy | Is the answer based only on search results? |
| non-parametric memory | Document DB and embedding store | Are versions and permissions managed? |
| marginalization | Combining multiple candidate grounds | How 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를 통해 운영됩니다.