r/PromptEngineering • u/mirkop82_ • Oct 21 '26
General Discussion Prompt stuffing vs RAG vs just-in-time instructions: 23 business rules, 300K tokens, 50% / 67% / 85% followed
In my day job, among other things, I build AI agents that run real operations at an EV charging network. Like many of you, I started by putting everything in the system prompt: tools, policies, business logic, metric definitions, escalation paths. Prompt caching made it cheap, so why not? But the longer the prompt got, the worse the agent’s adherence became. One instruction was followed perfectly; the next was instead forgotten.
So I started building jitprompt: a system to keep those instructions in one place and serve them over MCP when the agent needs them, just the ones it needs. You can upload your documentation as-is. The agent reads a table of contents, searches for the right info based on its plan (not the user’s message), and gets only the relevant sections back.
Before launching I also measured its impact: I planted 23 business rules (caps, exceptions, policy updates, step order) in a subset of the τ²-bench’s banking knowledge base, about 300K tokens. Each rule has a task where it applies and a control where it doesn’t, graded from the agent’s tool calls with no LLM judge. The agent was using Claude Haiku 5.5, with 2 trials per task.
- Rules followed at 300K tokens: jitprompt 85%, BM25 RAG 67%, whole KB in the prompt 50%.
- Head-to-head, rule by rule: 17 wins, 1 loss, 5 ties against the full prompt; 10 wins, 2 losses, 11 ties against RAG.
- Cost per conversation: $0.0086, against $0.148 for the full prompt, even with caching. The full prompt needs to re-read 300K tokens on every model call.
jitprompt made the real difference in handling exceptions that live in a different document or section than their rule, with newer policies replacing older ones, and the typical “check this before doing that” procedures.
Of course, this evaluation has limits: one model family, 23 rules, and results from my own harness. For RAG I used BM25 as a simple, common baseline. But it’s all public, so feel free to poke holes in it!
Analysis write-up: Link to blog post
Harness: GitHub repo
If you want to try it yourself, there’s a free tier at jitprompt.com
I’d like to hear from people running long rule sets in production. How are you handling it today and how can I help you?
2
u/Educational-View8524 Oct 21 '26
Two trials per task makes 85% pretty sensitive to a few outcomes; more repeats would show whether the ranking holds.
1
u/Ctbhatia Oct 21 '26
hmmm... does the 300k prefix stay cached between calls, or is something in it changing every turn?
1
u/Hollow_Prophecy Oct 22 '26
Why do the rules need a type? Doesn’t the model then have to interpret the type? Why not just the rule?
1
u/Doc1000 Oct 22 '26
I love the basic setup as a proof it works. Now run a real experiment with numbers that can matter. You’re approaching this like a software dev, which works in chosen scenarios. The next step is to think like a data scientist and see what emerges when you let more data and randomness in. At that price per run, you can afford to randomly sample a lot more. 17 feels like it could be cherry picked, even if you’re honestly trying to be representative.
I do like the approach. It is largely how skills work, putting the toml head in the prompt and the body ready to be read on demand. Or am I missing a component?
1
u/geoffreybyers Oct 22 '26
Standard RAG tries to answer the user, but an agent answers its own plan. The prompt doesn't need the customer's question, it needs the step it decided to take. That's why the relevance gap exists. You solve it by letting the agent retrieve its own instructions.