BXUP Track progress & test yourself — free
Cloud & Solutions Architecture · Playbook · Core · ~4 min read
CLOUD & SOLUTIONS ARCHITECTURE · PLAYBOOK · CORE

Architecture Knowledge Base — RAG over ADRs & Designs

"Why did we pick Aurora?" should be answerable by the decision log, not by whoever remembers 2024. This playbook stands up retrieval over your ADRs, HLDs, and review findings — with two non-negotiable behaviors: every answer cites its source documents, and questions the corpus cannot answer get a refusal, not an improvisation.

Tier: Core · Hands-on time: ~35 minutes

An architecture practice that writes ADRs (pb-14), mines the missing ones (pb-15), and keeps docs fresh (pb-17) has built a corpus worth querying — and making internal data AI-accessible is where documentation stops being write-only. The design constraint that makes an architecture KB trustworthy is asymmetric: a wrong answer about "our standard for queues" propagates into new designs with the authority of the decision log behind it. Hence the two hard behaviors — citations always, refusal on unknown — and an eval habit that checks both before anyone else gets the URL. This is also the track's first hands-on RAG build: the same decisions you make here at toy scale (chunking, filtering, grounding) are the M5 design material at production scale.

When to use

  • The same "why did we…" and "what is our standard for…" questions recur faster than veterans can answer them.
  • Onboarding architects need self-serve access to decision history with provenance.
  • Your ARB wants pre-reads that cite prior decisions (pb-20) and manual retrieval is the bottleneck.

Skip AI when the corpus is under ~30 documents — a good index page and folder discipline answer faster than a pipeline you must maintain.

Prerequisites

  • The corpus, curatedADR directory, HLDs, review findings; current versions only, superseded ADRs included but tagged as such in metadata (their status is part of the answer).
  • An LLM API + pgvectorPostgres with pgvector (free tiers exist: Neon/Supabase-class) keeps this a ₹0-capable build; any embedding model with consistent usage works.
  • A structured-output-capable model for the answer layer.
  • Ten golden questionsfive the corpus answers (you know the right citations), five it cannot (the refusal set). Write these before building; they are the acceptance test.

The workflow

  1. Chunk along document structure, not byte counts. ADRs are the easy case: one ADR (or one major section) per chunk, with metadata carried alongside — {doc_id, title, status, date, type}. Status matters most: an answer quoting a superseded ADR as current policy is this system's characteristic lie, and metadata is how you prevent it.

  2. Embed and load. Standard pipeline: embed each chunk, insert into a pgvector table with the metadata columns, index it. Keep the loader script in the repo next to the corpus — the KB re-indexes on every merged ADR PR, or it rots into pb-17's problem.

  3. Build the answer layer with grounding rules in the system prompt.

    You answer architecture questions for Orbit's engineering org, using
    ONLY the retrieved excerpts provided with each question.
    
    Rules:
    - Every claim in your answer must cite its source as [doc_id §section].
    - If the excerpts do not contain the answer, reply exactly:
      "Not in the architecture KB. Closest related documents: [list]."
      Do not answer from general knowledge, even when you are confident.
    - If the best source has status=superseded, say so and cite both the
      superseded ADR and its replacement.
    - If retrieved documents conflict, present both positions with
      citations — do not adjudicate.
    - Never state service limits, quotas, or prices as current facts —
      quote what the document said and its date.
    

    Retrieval fetches top-k chunks (start k=5), filtered by status where the question implies current policy.

  4. Run the golden set before anyone else touches it. Five answerable questions: does each answer cite the documents you predicted? Five unanswerable ones: does each get the refusal string, not a fluent improvisation? A KB that fails the refusal set is not "mostly working" — the failure mode is invisible to users precisely because the wrong answers are fluent. Fix (filtering, k, prompt) and re-run until clean.

  5. Pilot with skeptics, capture misses. Give three senior engineers a week and one instruction: try to break it, log every wrong or refused-but-answerable response. Each miss is a diagnosis — retrieval miss (chunking/embedding issue), grounding miss (prompt issue), or corpus gap (the answer genuinely is not written down — which routes to pb-14/pb-15, and is a finding about your documentation, not your pipeline).

  6. Ship with provenance visible and a feedback path. Whatever the surface (Slack bot, web page), citations render as links to the source documents, every answer carries a "wrong? report it" affordance, and the golden set re-runs on every corpus re-index. The KB earns trust by being auditable per-answer, and keeps it by being tested per-release.

Verify before you trust it

  • Citations resolve and support. Sample answers weekly: open each cited document and confirm it actually supports the claim attributed to it. Citation-shaped decoration over improvised answers is the failure that survives casual inspection.
  • The refusal set stays green. Re-run the unanswerable five on every index or prompt change. Grounding regressions arrive silently with model updates and prompt "improvements."
  • Superseded status surfaces. Ask a question whose best chunk is a superseded ADR; the answer must lead with the supersession. If it does not, your metadata filter or prompt has a gap that is teaching users old policy.
  • Conflicts are presented, not resolved. Seed a question you know the corpus disagrees with itself about (pb-16 findings are a source). The KB reporting one side as truth is the KB inventing consensus.

Restricted-environment variant

The corpus is the organization's decision history — internal-confidential at minimum, MSA-governed when it contains client engagement designs. Keep every component inside the boundary: pgvector runs anywhere Postgres does (client subscription, on-prem), embeddings and the answer model come from the approved tenancy (Bedrock/Azure OpenAI in the client's or firm's subscription), or fully local via Ollama for both embedding and generation — the architecture is identical, only endpoints change. For services firms: never co-mingle corpora across clients in one index; one engagement, one KB, in that client's boundary. The golden-set discipline is free and travels everywhere.

Key Takeaway:

Citations and refusal-on-unknown are not features of the KB — they are the KB. An architecture knowledge base that improvises answers is a rumor mill with embeddings.

This is the free reading view. Open BXUP to track your progress, run the hands-on labs, and prove it with original, exam-pattern assessments.
© Anvi Innovate · BXUP — Be Exponentially Upskilled · BXUP is an independent learning platform, not affiliated with or endorsed by AWS, Microsoft, Google, NVIDIA, IBM, Salesforce, Databricks, Oracle or Anthropic. All trademarks belong to their respective owners. · bxup.in