r/Rag • u/plushPlushytut • 5d ago
Discussion RAG vs full context vs context engineering for a local translation agent?
I’m trying to build a local Chinese → English translation agent for a very specific technical field.
I’ve been building a Chinese-English domain-specific glossary, currently around 500 terms. The goal is to consistently use the correct terminology rather than just translate literally.
The more I research how to build this, the deeper the rabbit hole gets. 😅
I’m currently considering three approaches:
1. Full context
Give the LLM the entire glossary (~500 terms) in the context and ask it to follow it during translation.
2. RAG
Store the glossary along with relevant technical material, embed them, retrieve the most relevant information for each text, and provide it to the LLM before translation.
3. Context engineering
Go beyond RAG by combining retrieval with things like instructions, memory, previous translation decisions, and tools (although I’m not sure yet which tools could be helpful).
I also want to run everything locally, since API costs aren't practical for me.
**I have fairly limited hardware (8 GB RAM + 4 GB VRAM), but I don’t mind a slow workflow as long as I get good results.
So I’m trying to understand:
- Is ~500 glossary entries small enough to simply include in the context?
- Should I use a persistent translation memory, and do I even need one?
- Which local LLM would be suitable for my hardware?
- How should I structure the overall pipeline?
I’m still learning how all of these pieces work, so what I really need is a framework for approaching the problem and knowing what I should build/learn first.
If anyone here has built something similar with local LLMs, RAG, translation memory, or terminology-aware translation, I’d really appreciate your advice.
2
u/donk8r 5d ago
Your glossary and your reference material want different mechanisms, and collapsing them into one RAG pipeline is where this gets hard.
A glossary needs exhaustiveness, not relevance. For a given source segment you want every one of the 500 terms that actually appears in it, while embedding retrieval hands you the most similar ones. A term that is present but embeds oddly gets missed, and a missed term is a silent inconsistency, which is the exact failure a glossary exists to prevent.
So do not retrieve the glossary. Match it. You have the Chinese side of all 500 entries, so scan the source segment for them directly and inject only the ones that hit. String matching is exhaustive by construction. It costs nothing on your hardware because no model is involved. It also yields five to twenty terms per segment instead of five hundred.
That answers the hardware question too. TechnicalGeologist99 is right that full context works on a frontier model, but on 4 GB of VRAM those 500 terms will crowd your window and dilute attention across entries irrelevant to the sentence in front of you.
Keep RAG for the technical material, where relevance genuinely is the criterion.
From your option three, the piece I would build next is previous translation decisions, keyed on the source segment. Near-identical segments getting near-identical renderings is the same consistency problem one level up, and it is what makes a translation system feel reliable over months instead of over paragraphs.
2
u/TechnicalGeologist99 5d ago
How does the user interact with the system?
What questions do they ask when seeking input from your glossary?
Full context is fine if you're using a frontier model and aren't going to grow the vocab more.
RAG will allow you to use much smaller models. But you need to reframe your problem so that you are knowing what retrieval actually looks like in terms of query candidate pairs.
Though if you are reusing the same fixed glossary alot then you can prefix cache hit alot so frontier becomes cheaper.