Uber introduced a RAG legal agent that runs inside Microsoft Word, combining large‑language‑model retrieval with deterministic policy rules and a store of prior lawyer feedback. For engineers, the result is a measurable 20% reduction in contract review latency and a reported 91% accuracy on AI‑generated decisions, illustrating a concrete path to speed up document‑heavy processes.
Architecture Overview
The system stitches three core services together. LangGraph orchestrates the workflow, invoking a retrieval step against an OpenSearch index that holds legal precedents and past redlining comments. Retrieved snippets are cached in Redis to keep latency low for repeated queries. After the LLM produces a draft edit, deterministic policy rules—explicit, rule‑based checks—are applied before the suggestion reaches the user.
Implementation Considerations
Embedding the agent in Microsoft Word requires a plug‑in that can call the RAG pipeline on demand. Engineers must ensure that the OpenSearch schema captures the legal ontology needed for effective retrieval, and that Redis is sized to hold the most frequently accessed passages. The deterministic rule layer provides a predictable guardrail, reducing the need for post‑hoc validation of LLM output.
Operational & Security Implications
Running a live RAG pipeline introduces new observability points: OpenSearch cluster health, Redis cache hit‑rates, and LangGraph step latency all affect end‑user experience. Practitioners should instrument metrics for each component and establish alerts for degradation. Because the agent processes confidential contract language, data residency and access controls for the OpenSearch index and Redis store become operational concerns, even though the source does not call out specific security mechanisms.
Related CloudNinjas coverage: AI engineering.
What This Means For Practitioners
Teams building document‑centric AI tools should evaluate a hybrid approach that couples retrieval‑augmented generation with rule‑based validation. Selecting scalable back‑ends like OpenSearch and Redis can keep response times low, while a deterministic rule engine simplifies compliance testing. Monitoring the end‑to‑end pipeline and enforcing data‑handling policies are essential next steps as the pattern matures.



