Library

Volume 6 · Signature GenAI Projects

Notebook
Sign in

Section 12

Signature Project 1 — Enterprise RAG-Based Knowledge Assistant

4,732 words · about 22 min

12.1 Context & Business Problem

I led the architecture and delivery of an internal knowledge assistant for a large enterprise client whose employees — roughly 14,000 across support, sales engineering, legal, and operations — were losing significant time searching across a fragmented document estate: a Confluence-like wiki, a SharePoint document library, a ticketing system (historical resolved tickets), and a set of PDF policy manuals maintained by legal and compliance.

Before this project, the primary “search” experience was SharePoint’s native search plus a Slack culture of “does anyone know where the doc for X is” pinging subject matter experts. The support organization additionally ran a tier-1/tier-2 escalation model where a large fraction of tier-1 tickets were actually just “I couldn’t find the answer in the docs” — support leadership estimated this was inflating average ticket handle time and headcount needs.

There had been one prior attempt, about 18 months earlier, to solve this with a classic enterprise search product (Elastic-based keyword/BM25 search with some manual synonym tuning). It improved recall marginally but did nothing for employees asking natural-language questions (“what’s our reimbursement policy if I book a flight through a personal card”) and did nothing to synthesize an answer across multiple documents. That project was quietly deprioritized. This history mattered a lot in my design: I had to make the case for why a RAG-based approach would succeed where keyword search had stalled, and I had to build credibility by targeting a narrow, measurable pilot rather than promising a company-wide silver bullet on day one.

The trigger for restarting the initiative was a combination of (a) rising support ticket volume as the company scaled headcount, and (b) a mandate from a new VP of Operations to reduce tier-1 ticket load by a stated percentage within two quarters, which gave the project an executive sponsor and a budget.

12.2 Requirements & Constraints

Functional requirements

  • Natural-language Q&A over a corpus that eventually grew to ~62,000 documents (wiki pages, PDFs, Word docs, and ~40,000 historical resolved support tickets treated as a distinct, lower-trust source).
  • Answers must cite sources (document title + link + section) — no unattributed answers were acceptable to legal/compliance stakeholders.
  • Per-user, per-department access control: an answer must never surface content the asking user wouldn’t otherwise be entitled to see (e.g., legal-only compliance docs, HR docs about compensation bands, department-restricted playbooks).
  • Multi-turn conversation with follow-up question support.
  • Feedback capture (thumbs up/down + optional free text) on every answer.
  • Deployment surface: a web app plus a Slack/Teams bot embedded in the two channels employees already used.

Non-functional requirements

  • Latency SLA: p95 under 3 seconds for the full round trip (query → retrieval → generation → rendered answer with citations). This was a hard product requirement — user research during the pilot showed abandonment climbing sharply past ~4 seconds.
  • Scale: pilot at 800 daily active users in two departments, target of 4,000+ DAU within two quarters post-GA, peak concurrency around 250 simultaneous requests.
  • Data residency: all data had to stay within the client’s existing cloud region (US-based enterprise agreement); no document content could be sent to a model provider’s endpoint that wasn’t covered under a zero-data-retention enterprise agreement.
  • Compliance: HR and legal content required document-level ACL enforcement, not just “is this collection public”; SOC2-type audit logging of every query, every retrieved chunk, and every answer for 12 months.
  • Freshness: the wiki and ticket system changed constantly — several hundred document edits per day across the corpus. Stale answers citing superseded policy were treated as a severity-1 quality issue by legal.
  • Team: I had a team of 6 (2 backend/platform engineers, 1 ML engineer focused on retrieval/eval, 1 data engineer for the ingestion pipeline, 1 frontend engineer, plus me as architect/tech lead), delivered over roughly 5 months to pilot GA, then another 3 months hardening to full GA.
  • Budget: a monthly LLM/infra cost ceiling was set by finance before we started, which directly shaped several architecture decisions below (notably around retrieval depth and model tiering).

12.3 Architecture

                                   ┌─────────────────────────────────────────────┐
                                   │              SOURCE SYSTEMS                  │
                                   │  Wiki (Confluence-like) | SharePoint | Ticket │
                                   │  system (resolved tickets) | Policy PDFs      │
                                   └───────────────────┬───────────────────────────┘
                                                        │  webhooks + nightly full crawl
                                                        ▼
                        ┌───────────────────────────────────────────────────────────┐
                        │                  INGESTION PIPELINE (batch + streaming)     │
                        │  ┌───────────┐  ┌──────────────┐  ┌────────────────────┐   │
                        │  │ Connector  │→ │ Parser/Cleaner│→ │ ACL Extractor       │   │
                        │  │ (per source)│  │ (Unstructured │  │ (source permissions │   │
                        │  │            │  │  + custom PDF │  │  → normalized ACL   │   │
                        │  │            │  │  table parser)│  │  graph)             │   │
                        │  └───────────┘  └──────────────┘  └────────────────────┘   │
                        │            │                                                │
                        │            ▼                                                │
                        │  ┌────────────────────────┐   ┌────────────────────────┐   │
                        │  │ Chunker (semantic +      │→ │ Embedding Service       │   │
                        │  │ structure-aware, 400 tok │   │ (batched, versioned     │   │
                        │  │ target / 80 tok overlap) │   │ embedding model)        │   │
                        │  └────────────────────────┘   └───────────┬────────────┘   │
                        │                                            │                │
                        └────────────────────────────────────────────┼────────────────┘
                                                                      ▼
                        ┌──────────────────────────────────────────────────────────┐
                        │                     RETRIEVAL LAYER                        │
                        │  ┌─────────────────┐    ┌────────────────────────────┐    │
                        │  │ Vector Store      │    │ Metadata / ACL Index        │    │
                        │  │ (dense, HNSW,     │    │ (Postgres — doc_id, dept,   │    │
                        │  │ per-tenant shard) │    │ acl_group[], last_updated)  │    │
                        │  └─────────────────┘    └────────────────────────────┘    │
                        │              ▲  hybrid: dense (top-40) + BM25 (top-40)     │
                        │              │  → reciprocal rank fusion → rerank (top-8)  │
                        └──────────────┼──────────────────────────────────────────────┘
                                       │
                                       ▼
       ┌──────────────┐     ┌─────────────────────┐     ┌──────────────────────────┐
       │ User (web /   │────▶│ API Gateway / Query  │────▶│ Query Understanding       │
       │ Slack / Teams)│     │ Orchestrator          │     │ (query rewrite,           │
       └──────────────┘     │ (auth, rate limit,    │     │ conversation-context      │
              ▲              │  session, ACL token)  │     │ fold-in, intent routing)  │
              │              └──────────┬────────────┘     └───────────┬──────────────┘
              │                         │                              │
              │                         ▼                              ▼
              │              ┌─────────────────────────────────────────────┐
              │              │   RETRIEVAL LAYER (ACL-filtered query above)  │
              │              └───────────────────┬───────────────────────────┘
              │                                   ▼
              │              ┌─────────────────────────────────────────────┐
              │              │   RERANKER (cross-encoder, top-40 → top-8)    │
              │              └───────────────────┬───────────────────────────┘
              │                                   ▼
              │              ┌─────────────────────────────────────────────┐
              │              │   GENERATION (LLM, grounded prompt + cited    │
              │              │   chunks, "answer only from context" +        │
              │              │   citation format enforced)                    │
              │              └───────────────────┬───────────────────────────┘
              │                                   ▼
              │              ┌─────────────────────────────────────────────┐
              │              │   POST-PROCESS: citation validator,           │
              │              │   confidence/abstain check, PII scrub          │
              │              └───────────────────┬───────────────────────────┘
              └───────────────────────────────────┘
                                                        │
                                                        ▼
                                     ┌───────────────────────────────┐
                                     │  Logging / Eval / Feedback      │
                                     │  store (every query, retrieved  │
                                     │  chunks, answer, thumbs, cost)  │
                                     └───────────────────────────────┘

Walkthrough and why each piece was chosen:

  • Per-source connectors + nightly full crawl + webhook deltas: Source systems (wiki, SharePoint, ticketing) each exposed different change-notification quality. The wiki and ticketing system had reliable webhooks; SharePoint’s change feed was flaky in practice, so we layered a nightly full differential crawl (hash-compare on content) as a safety net. I considered relying on webhooks alone, but a spike in November where SharePoint silently dropped webhook deliveries for ~6 hours convinced me redundancy was worth the extra compute cost.

  • Structure-aware chunking (400 tokens target, 80 token overlap) over naive fixed-size chunking: I chose a chunker that first respects document structure — headings, tables, list boundaries — and only falls back to fixed-size splitting within a section that’s too large. Pure fixed-size chunking (e.g., “every 512 tokens”) was tested in early prototyping and produced noticeably worse retrieval precision on our golden eval set (roughly 9 points lower on retrieval nDCG@8) because it routinely split a policy’s condition from its exception clause across two chunks. 400 tokens was chosen empirically: 256 was too short to answer “which employees qualify and what’s excluded” in one chunk; 800 diluted embedding relevance and blew our context budget once we needed 8 chunks per query. Tables (common in policy PDFs — reimbursement limits, approval matrices) were parsed with a dedicated table extractor and kept intact as a single chunk with the table serialized to markdown, never split mid-table.

  • Hybrid retrieval (dense + BM25 via reciprocal rank fusion) instead of dense-only: Pure dense retrieval underperformed on exact-match queries — ticket numbers, product SKUs, specific policy codes like “PTO-4.2” — because embeddings blur exact tokens. BM25 alone missed paraphrased natural-language questions. Fusing top-40 from each with reciprocal rank fusion before reranking gave us the best of both without a large latency hit, since both retrievals run in parallel.

  • Cross-encoder reranker (top-40 → top-8): The initial design sent the top-8 from fusion directly to the LLM. In eval, this missed relevant chunks that ranked 9–15 in the fused list often enough to matter (about 12% of golden questions had their single most relevant chunk outside the top-8 pre-rerank). Adding a lightweight cross-encoder reranker over the fused top-40 fixed most of this, at a latency cost of roughly 150–200ms, which we had budget for within the 3-second SLA.

  • Separate metadata/ACL index in Postgres, not baked into vector metadata alone: I deliberately kept authoritative ACL state in a relational store rather than only as payload fields on vector index entries. Vector databases at the time made bulk ACL updates (e.g., a department reorg changing which group owns a folder) awkward — you’d have to touch every vector’s metadata. Keeping ACL as a normalized, independently-updatable table let us propagate a permission change to all affected chunks in one transaction and apply it as a pre-filter (a WHERE acl_group IN (:user_groups) semantic) before the vector search even runs, rather than filtering post-retrieval.

  • Query orchestrator with explicit query rewrite step: Multi-turn conversations (“what about for contractors?” as a follow-up to a full-time-employee PTO question) needed conversation context folded into the retrieval query itself, not just passed as chat history to the generator. We added a small, fast rewrite step (cheap model call) that condenses conversation history plus the new question into a single self-contained retrieval query. Skipping this step was our original design and it retrieved badly on any follow-up question — the vector search saw only “what about for contractors?” with no anchor to “PTO.”

  • Grounded generation prompt with hard “answer only from context” instruction, tiered model routing: We used a stronger model for synthesis on ambiguous/legal-adjacent queries and a smaller, faster/cheaper model for high-confidence single-document lookups, decided by a lightweight classifier on retrieval confidence scores. This was purely a cost and latency decision under the finance-mandated budget ceiling.

  • Post-process citation validator: Before an answer is returned, we run a deterministic check that every claim-bearing sentence maps back to at least one retrieved chunk (via a lightweight entailment check), and reject/regenerate or force an abstain if not. This was added after the incident described below.

12.4 Key Technical Decisions & Trade-offs

  1. Hybrid retrieval vs. pure dense retrieval. Dense-only was simpler to operate (one index, one query path) and was our v0. We moved to hybrid dense+BM25 because exact-match failures (ticket IDs, policy codes, SKUs) were a recurring complaint in the pilot’s first three weeks. Trade-off: more infra (a BM25 index alongside the vector index) and roughly 40ms added latency, which we accepted because it was well within SLA headroom.

  2. Managed vector database vs. self-hosted. We evaluated self-hosting an open-source vector index (would have given us more control over sharding strategy and no per-query pricing) against a managed vector database service. We chose managed because the team didn’t have spare SRE capacity to operate a stateful, latency-sensitive service at this scale within the timeline, and the managed option’s per-tenant namespace feature mapped cleanly onto our department-level data isolation needs. Trade-off: less control over low-level index tuning and a recurring line-item cost, accepted in exchange for faster time-to-pilot and less operational burden on a 6-person team.

  3. Reranking with a cross-encoder vs. relying on embedding similarity alone. Reranking added latency and an extra model hop. We chose to include it because our eval set showed a measurable retrieval quality gap without it, and we had SLA headroom (measured p95 retrieval+rerank was ~600ms, leaving comfortable room under the 3s ceiling for generation). Had our SLA been 1.5 seconds instead of 3, I would have cut this step and compensated with a larger top-k sent directly to generation, accepting more noise in exchange for speed.

  4. Chunk-level ACL pre-filtering vs. document-level ACL with post-hoc answer filtering. An easier initial approach would have been “generate the answer, then check if the user is allowed to see the cited docs, and redact if not.” I rejected this because it means a restricted chunk still gets sent to the LLM and could leak into an answer’s phrasing even if the citation is stripped — the model might paraphrase confidential content without literally quoting it, which is a compliance failure we couldn’t accept for HR/legal content. We paid the cost of a more complex ingestion-time ACL propagation pipeline in exchange for a hard guarantee that restricted content never enters the LLM’s context window for an unauthorized user.

  5. Treating resolved support tickets as a distinct, lower-trust source rather than merging them into the primary corpus. Tickets are noisy, sometimes contain incorrect troubleshooting steps that “worked” for one case but weren’t the sanctioned fix, and are written informally. Rather than exclude them (they contained real value — often the fastest answer to “how do I fix X error”) or blend them at equal trust with official docs (risking citing an ad hoc workaround as policy), we tagged ticket-sourced chunks with a source_trust: secondary flag. The generation prompt was instructed to prefer official-doc chunks when there was a conflict, and the UI visually distinguished “from a resolved support ticket” citations from “from official documentation” citations. This was a deliberate trust-transparency trade-off over a simpler unified corpus.

  6. Synchronous vs. asynchronous ingestion for freshness-critical content. For most of the corpus, nightly batch re-embedding was sufficient. For the compliance/legal document set specifically, given how severity-1 a stale-policy citation was treated, we built a near-real-time path: an edit webhook on that specific space triggered re-chunk and re-embed within minutes rather than waiting for the nightly batch. We didn’t extend this real-time path to the entire corpus because the cost/complexity wasn’t justified for lower-stakes content like general wiki pages — a same-day staleness window was acceptable there.

  7. Model tiering (cheap model for high-confidence lookups, stronger model for ambiguous/multi-document synthesis) vs. one model for everything. A single strong model for every query was simpler to reason about and eval, but was going to blow the monthly cost ceiling at projected DAU. Tiering added complexity (a routing classifier, two prompt templates to maintain, two eval slices) but cut blended per-query cost significantly while keeping quality on the harder query segment unchanged, which is what the budget required.

12.5 Implementation Challenges & How They Were Solved

  1. PDF table extraction was silently garbling reimbursement limit tables. Root cause: our first-pass PDF parser flattened tables into linear text in reading order (left-to-right, top-to-bottom per line), which scrambled multi-column approval-limit tables into nonsensical sentences like “Manager $500 Director $2000 VP” with no clear row/column association. This produced confidently wrong dollar figures in early testing. Fix: switched to a table-detection-aware parser that identifies table bounding boxes and serializes each table to markdown preserving row/column structure, then verified with a manual audit of the ~120 tables in the compliance PDF set before re-indexing.

  2. Retrieval latency spiked under concurrent load during the pilot’s second week. At launch, p95 latency was comfortably under 2 seconds. When the pilot expanded from 200 to 800 users, p95 climbed past 4.5 seconds during peak hours (10–11am). Root cause: the vector search and BM25 search were being called sequentially rather than in parallel in the orchestrator (a leftover from early prototyping that hadn’t been revisited), and the reranker was running as a single-threaded batch rather than using available GPU batching headroom. Fix: parallelized the dense/BM25 calls (saved ~180ms), batched reranker calls more efficiently (saved ~220ms), and added connection pooling to the vector DB client which had been opening a new connection per request. Combined, this brought p95 back to ~2.1 seconds with 800 concurrent users, and we validated headroom to 2,000+ via load testing before full GA.

  3. A “confidently wrong answer” incident: stale policy citation after a mid-cycle policy change. About six weeks into the pilot, an employee asked about the company’s remote work equipment stipend and received a confident, well-cited answer stating a $1,500 annual limit — correct as of three weeks prior, but the policy had been revised down to $1,000 the previous week. Root cause investigation found two compounding issues: (a) the wiki page had been edited, but the edit was made inside a nested child page that our webhook subscription wasn’t scoped to (we’d subscribed at the parent page level, and the platform’s webhook events didn’t bubble child-page edits up as expected), so the stale chunk never got re-embedded; and (b) even setting aside the staleness, there was no “last verified” signal shown to the user, so the wrong figure was presented with the same confident tone as anything else. Fix was three-pronged: (1) changed the webhook subscription to cover the entire page tree recursively and added the nightly full crawl as a backstop specifically to catch this class of gap, (2) added a “last updated” timestamp to every citation shown in the UI so users could sanity-check freshness themselves, and (3) added an automated staleness monitor that flags any chunk whose source page was edited more than 24 hours ago without a corresponding re-embed, alerting the on-call engineer. We also ran a corpus-wide audit after the incident and found 340 other chunks (about 0.5% of the corpus) with the same silent staleness gap, all remediated within a week.

  4. Users asking questions the corpus genuinely couldn’t answer were getting plausible-sounding hallucinated answers instead of an honest “I don’t know.” Early on, when retrieval returned only weakly relevant chunks (e.g., a question about a benefit that didn’t exist at the company), the model would still synthesize something plausible-sounding from tangentially related content rather than declining. Root cause: our prompt told the model to “use the provided context to answer” but didn’t give it explicit permission or instruction to abstain, and we had no retrieval-confidence gating before generation. Fix: added a retrieval-confidence threshold (based on top reranked chunk score) below which the system returns a structured “I don’t have enough information on this — here’s the closest related content I found, or you can open a ticket” response instead of attempting synthesis, plus an explicit abstain instruction and worked examples in the prompt. This reduced our measured hallucination rate on the golden eval set substantially (detailed in Results) and became one of our core eval gates.

12.6 Production Operations

  • Evaluation and golden dataset: We built a golden set of 450 question/answer/citation triples, hand-curated with subject matter experts across the four main content domains (HR policy, IT support, legal/compliance, product docs), each with the expected correct source document(s) and a human-written reference answer. We ran this set nightly against the production pipeline and tracked three metrics: retrieval recall@8 (did the right chunk get retrieved), citation precision (are all cited sources actually relevant and correct), and answer correctness (LLM-as-judge scoring against the reference answer, with a sample manually spot-checked weekly by a human reviewer to keep the judge calibrated). We treated any week-over-week drop of more than 3 points on any of these three as a release-blocking regression requiring investigation before further rollout.
  • Online quality signal: thumbs up/down plus free-text feedback was logged on every answer, routed to a weekly review triage where the ML engineer and I reviewed all thumbs-down responses, tagged root cause (retrieval miss, generation error, stale content, ACL issue, out-of-scope question), and fed recurring patterns back into either the golden set or the retrieval/prompt tuning backlog.
  • Monitoring: standard latency/error-rate/throughput dashboards per pipeline stage (retrieval, rerank, generation), plus domain-specific dashboards: daily hallucination-flag rate (from the citation validator), abstain rate (too high suggests retrieval regression, too low suggests the confidence gate is too permissive), and per-department query volume to catch adoption stalls early.
  • Cost management: per-query cost was logged and rolled up daily against the finance-set monthly ceiling; the model-tiering router’s split (percentage of queries routed to the cheaper vs. stronger model) was a primary lever we tuned when costs trended high, along with tuning the reranker’s top-k and the number of chunks sent to generation.
  • On-call model: the platform engineers rotated a weekly on-call covering infra/latency incidents; I personally stayed the escalation point for quality incidents (hallucination reports, ACL leak reports) given how severity-1 those were treated by legal, with a documented runbook for “suspected ACL leak” that included immediate query-path disablement for the affected content class while we investigated.
  • Regression detection: beyond the nightly golden-set run, we versioned every component that could affect answer quality (embedding model version, chunking config, prompt template, reranker model) and ran an A/B shadow comparison against the golden set before promoting any change to production, never deploying quality-affecting changes based on unit tests alone.

12.7 Results & Metrics

  • Grew from a 200-user pilot in two departments to 4,600 monthly active users (roughly 3,300 weekly active) across nine departments within two quarters of GA.
  • Support tier-1 ticket volume attributable to “couldn’t find documented answer” categories dropped by approximately 34% in the two departments with heaviest adoption, against the sponsor’s original reduction target, which was a significant factor in securing budget for company-wide rollout.
  • Median time-to-answer for the target query categories dropped from an estimated 8–12 minutes (searching + Slack-asking a colleague) to under 30 seconds including read time.
  • p95 end-to-end latency held at approximately 2.3 seconds in steady state post-optimization, within the 3-second SLA.
  • Golden-set answer correctness (LLM-judge, human-spot-checked) improved from 71% at pilot launch to 89% after the abstain-gating and reranking work described above; hallucination-flagged rate on the golden set dropped from roughly 14% to under 3%.
  • Thumbs-up rate on production answers stabilized around 82% after the first two months of tuning, up from roughly 58% in week one of the pilot.
  • Zero confirmed ACL-leak incidents in the following nine months of operation post-launch (the incident described above was a staleness issue, not an access-control leak).

12.8 What I’d Do Differently

  • I’d invest in the staleness-detection monitor from day one instead of adding it reactively after the stipend incident. In hindsight, “how do you know a source changed without your index knowing” is such an obvious failure mode for any RAG system over a living corpus that it should have been part of the initial design, not a post-incident fix. I underestimated how unreliable webhook coverage would be across heterogeneous source systems.
  • I’d push harder, earlier, for a smaller and more representative golden eval set built jointly with subject matter experts before writing a single line of retrieval code, rather than building the golden set in parallel with the pipeline. We ended up retrofitting some early architecture decisions (like chunk size) once real eval numbers came in that we could have tuned faster with eval-first development.
  • I’d design the ticket-sourced “secondary trust” content handling into the core architecture from the start rather than bolting it on mid-project once we saw the wiki-versus-ticket conflict problem in practice. It worked out, but it caused a mid-project reindex of the entire ticket corpus that could have been avoided with better upfront source-quality analysis.

12.9 Anticipated Follow-Up Questions

  1. “Why didn’t you just use out-of-the-box enterprise search instead of building RAG?” Enterprise search (what we had before) is fundamentally retrieval without synthesis — it returns a ranked list of documents and leaves the user to read and reconcile them. Our core business problem was that users were asking natural-language questions that often required synthesizing across two or three documents (e.g., “am I eligible for X and what’s the approval process”), and prior keyword search had already been tried and had plateaued. RAG let us give a direct, cited answer instead of a results list, which is what actually moved the ticket-deflection metric. That said, we kept a “view retrieved sources” fallback UI specifically so users could still do the old-style browse-and-read if they didn’t trust the synthesized answer — we didn’t fully retire the search paradigm, we layered synthesis on top of it.

  2. “How did you handle a document being updated after it was already indexed and cited in an answer?” Two layers: proactive freshness (webhook-triggered re-embedding on edit, with a nightly full-crawl backstop, as described above) and citation transparency (every citation shows a “last verified/updated” timestamp so a user can judge staleness themselves even in the rare window before re-indexing completes). We also don’t cache generated answers long-term — each query is answered fresh against the current index rather than serving a previously generated answer, so once an update propagates, the very next identical question gets the corrected answer.

  3. “What was your chunking strategy and why?” Structure-aware chunking targeting ~400 tokens with 80-token overlap, respecting document boundaries (headings, list items, tables kept intact). We arrived at 400 tokens empirically by testing 256/400/800 against our golden retrieval set and found 400 balanced precision (didn’t dilute the embedding with unrelated content) against completeness (didn’t split a condition from its exception). Tables were special-cased entirely — never split, serialized to markdown to preserve structure.

  4. “How do you know your RAG system isn’t quietly getting worse over time?” The nightly golden-set regression run against three metrics (retrieval recall, citation precision, answer correctness) is the primary guardrail — any meaningful week-over-week drop blocks further rollout of whatever changed. Beyond that, the weekly thumbs-down triage catches quality issues the static golden set might miss because real user questions drift over time in ways a fixed 450-question set won’t fully capture, so we periodically refreshed the golden set itself with newly reported edge cases.

  5. “How did you prevent a user from seeing content they’re not authorized for?” ACL enforcement happens as a pre-filter at retrieval time, not as post-hoc redaction — restricted chunks are excluded from the candidate set the vector/BM25 search returns for a given user’s group memberships, so they never enter the LLM’s context window in the first place. ACL state lives in a normalized Postgres table separate from the vector index specifically so a permission change (e.g., a reorg) propagates via one transaction rather than requiring a reindex.

  6. “What would you do if the LLM provider had an outage — did you have a fallback?” We had a secondary model provider configured behind the same orchestration interface, with automatic failover triggered by error-rate/latency thresholds on the primary. It wasn’t exercised at scale during my tenure on the project beyond brief provider incidents, but it was tested in game-day exercises. Retrieval and the vector store were the harder single point of failure to mitigate given the operational cost of running a second live index, and that remained an accepted risk given the client’s uptime requirements weren’t five-nines for this particular tool.

  7. “How did you decide what to build versus buy (e.g., vector DB, reranker, orchestration)?” Generally: buy/managed for stateful infrastructure where operating it ourselves wouldn’t have differentiated the product (vector DB, base LLM), build for anything that encoded our specific business logic or trust model (ACL propagation, chunking strategy, the citation validator, model routing/tiering). The team-size and timeline constraints (6 people, 5 months to pilot) made this a fairly easy call in most cases — undifferentiated heavy lifting went to managed services.

  8. “What was the single hardest technical problem?” Genuinely the staleness/freshness problem — RAG tutorials make indexing sound like a one-time batch job, but a living enterprise corpus with hundreds of daily edits across heterogeneous source systems with inconsistent change-notification reliability turned “keep the index current” into an ongoing distributed-systems problem, and it’s the one that caused our highest-severity production incident.

  9. “How did you handle conflicting information across sources (e.g., an old wiki page and a newer official policy PDF disagreeing)?” We tagged content by source trust tier and recency, instructed the generation prompt to prefer higher-trust, more-recent sources when chunks conflicted, and surfaced multiple citations transparently rather than silently picking one when the model’s confidence in the conflict resolution was low — in ambiguous cases the answer would explicitly say “I found conflicting information: X per document A (updated date) versus Y per document B (updated date).”

  10. “Why cross-encoder reranking instead of just retrieving more chunks and letting the LLM sort it out?” We tested exactly that (larger top-k, no reranker) early on. It increased generation latency and cost roughly linearly with context size, and — more importantly — larger irrelevant context increased the model’s tendency to weave in tangential material, hurting citation precision on the golden set. Reranking gave us a small, high-precision context window at a fraction of the latency cost of a much larger raw top-k, which was the better trade given our tight SLA and cost ceiling.