Proof-of-concept retrieval looks strong on curated files. These are the structural failures—and the latency fixes—that appear on production Microsoft 365 corpora.
Fixed 512-token windows, cosine similarity, and a generic system prompt can produce an impressive afternoon demo. Accuracy collapses when the same defaults index thousands of live SharePoint documents, PDF manuals, and nested repositories.
Token windows cut tables, conditionals, and safety steps in half. Use layout-aware parsing so section headers and full table cells stay intact.
Without effective date, version, and audience tags, a 2024 policy chunk ranks beside the 2026 replacement. Inject metadata into chunk headers at index time.
Embeddings miss exact identifiers such as ERR_CONN_RESET. Fuse dense search with PostgreSQL tsvector using Reciprocal Rank Fusion.
Anecdotal prompt edits silently break other queries. Run LLM-judge suites for faithfulness and citation recall in CI before merge.
Production latency is usually a retrieval problem, not a model problem. Hybrid search over an unfiltered corpus, oversized top-k, and synchronous embedding of every query add seconds users will not wait for.
query
→ ACL + recency filter
→ dense k=20 + sparse k=20
→ RRF merge
→ optional rerank k=10
→ evidence threshold
→ generate or abstain
Audit retrieval performance, chunking, and governance boundaries with a senior engineer.
Request a RAG Architecture Review