← All insights
FAQ · RAG & agents

Production RAG and AI agents FAQ

Buyer and engineering answers on production RAG, tool use, evaluation, permissions and agent safety.

Abstract

Ten questions buyers and engineers ask about retrieval-augmented generation and AI agents in production: how the two differ, why demos fail, what to measure, how to make tool use reliable, how permissions and logging should work, and when self-hosting helps. Answers are short and operational, and are set against the research on RAG failure points, evaluation frameworks and agent benchmarks.

Keywords RAG · AI agents · evaluation · tool use · permissions · LangGraph

Contents

01

Background and related work

RAG combines a generator with a retrievable index and gives more specific and factual output on knowledge-intensive tasks than a model alone[1]. In practice, an experience report across three case studies names seven failure points and concludes that validation is only feasible during operation[2]. Evaluation frameworks exist for this: RAGAs measures faithfulness, answer relevance and context relevance without reference answers[3], and ARES calibrates lightweight judge models against a small human-annotated set to give scores with confidence intervals[4]. Position matters too: models perform best when relevant information sits at the start or end of the input[5].

For agents, interleaving reasoning with actions is the basic pattern[6], but benchmarks show its limits. Models handle single-turn function calls well and struggle with memory and long-horizon tasks[7], and state-of-the-art agents completed fewer than half of τ-bench tasks and were inconsistent across trials[8]. Retrieved content is also an attack channel, since hidden instructions can steer a model and trigger tool calls[9].

02

What is the difference between RAG and an AI agent?

RAG retrieves relevant information and adds it to the model context before generation. An agent adds decision-making and tool use: it can choose actions, call APIs, search systems, update records or execute a multi-step workflow. Many production systems use both.

03

Why do RAG demos often fail in production?

Common causes include weak document parsing, stale indexes, poor chunking, missing access control, low-quality retrieval, no evaluation set and no observability. A demo can look good on hand-picked examples while failing on real user queries.

04

What should be measured in a RAG system?

Measure retrieval quality separately from answer quality. Useful signals include recall or hit rate on relevant evidence, citation correctness, groundedness, answer completeness, latency, cost and failure rate. Evaluation should use representative domain questions rather than generic prompts.

05

When should an agent use tools instead of relying on model knowledge?

Use tools when the answer depends on fresh, authoritative or private data, or when the system must take an action. Examples include searching an internal database, checking a live order, creating a ticket or retrieving a current policy document.

06

How do we make tool use reliable?

Use constrained schemas, narrow tool descriptions, deterministic validation, retries where appropriate and an evaluation set that measures tool selection and argument correctness. Tool reliability should be tested explicitly rather than inferred from general language-model benchmarks.

07

Is LangGraph required for production agents?

No. It is one orchestration option. The important design properties are explicit state, controllable transitions, retry and failure handling, observability and testability. LangGraph is useful when workflows contain branching, loops, tools and long-running state.

08

How should permissions work in an enterprise agent?

The agent should never have broader permissions than the user or workload it represents. Tool access should be scoped by identity, role, tenant and action. Retrieval should also enforce document-level permissions before content reaches the model.

09

What logs should an agent keep?

Record request identity, model and version, retrieved evidence, tool calls, tool results, important state transitions, latency and final outcome. Sensitive payloads may need redaction or controlled retention, but the system should preserve enough evidence for debugging and audit.

10

How do we prevent an agent from taking unsafe actions?

Use least-privilege tools, allow-lists, validation, transaction boundaries and approval gates for high-impact actions. The model should propose actions inside a controlled system rather than receive unrestricted access to production infrastructure.

11

When is self-hosting useful for RAG and agents?

Self-hosting is attractive when data sovereignty, privacy, predictable cost, model control or hyperscaler independence matter. It also allows the organisation to keep retrieval, model inference, logs and tool integrations inside one controlled environment.

References

  1. Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., et al. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks. Advances in Neural Information Processing Systems 33 (NeurIPS 2020). arxiv.org/abs/2005.11401
  2. Barnett, S., Kurniawan, S., Thudumu, S., Brannelly, Z., & Abdelrazek, M. (2024). Seven failure points when engineering a retrieval augmented generation system. Proceedings of the IEEE/ACM 3rd International Conference on AI Engineering – Software Engineering for AI (CAIN 2024), 194–199. doi:10.1145/3644815.3644945 arxiv.org/abs/2401.05856
  3. Es, S., James, J., Espinosa-Anke, L., & Schockaert, S. (2024). RAGAs: Automated evaluation of retrieval augmented generation. Proceedings of EACL 2024: System Demonstrations. aclanthology.org/2024.eacl-demo.16/
  4. Saad-Falcon, J., Khattab, O., Potts, C., & Zaharia, M. (2024). ARES: An automated evaluation framework for retrieval-augmented generation systems. Proceedings of NAACL 2024. aclanthology.org/2024.naacl-long.20/
  5. Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). Lost in the middle: How language models use long contexts. Transactions of the Association for Computational Linguistics, 12. aclanthology.org/2024.tacl-1.9/
  6. Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., & Cao, Y. (2023). ReAct: Synergizing reasoning and acting in language models. International Conference on Learning Representations (ICLR 2023). arxiv.org/abs/2210.03629
  7. Patil, S. G., Mao, H., Yan, F., Ji, C. C.-J., Suresh, V., Stoica, I., & Gonzalez, J. E. (2025). The Berkeley Function Calling Leaderboard (BFCL): From tool use to agentic evaluation of large language models. Proceedings of the 42nd International Conference on Machine Learning (ICML 2025), PMLR 267. proceedings.mlr.press/v267/patil25a.html
  8. Yao, S., Shinn, N., Razavi, P., & Narasimhan, K. (2024). τ-bench: A benchmark for tool-agent-user interaction in real-world domains. arXiv preprint arXiv:2406.12045. arxiv.org/abs/2406.12045
  9. Greshake, K., Abdelnabi, S., Mishra, S., Endres, C., Holz, T., & Fritz, M. (2023). Not what you've signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection. Proceedings of the 16th ACM Workshop on Artificial Intelligence and Security (AISec '23). doi:10.1145/3605764.3623985 arxiv.org/abs/2302.12173

Each reference was checked against its publisher, arXiv or official record.

How to cite

LMXAI. (2026). Production RAG and AI agents FAQ. LMXAI Insights. https://lmxai.com/insights/production-rag-ai-agents-faq.html