RAG Architecture
RAG Architecture
Section titled “RAG Architecture”This guide shows an end-to-end workflow for improving rag_architecture health in production RAG systems.
Workflow
Section titled “Workflow”- Run a RAG-focused audit.
- Triage findings by risk domain and centrality impact.
- Apply targeted remediation.
- Enforce policy gates in CI.
- Prevent regressions with baseline checks.
1) Run a RAG Audit
Section titled “1) Run a RAG Audit”# Focused RAG metricarxo analyze --path . --metric rag_architecture --format json# RAG preset (rag_architecture + llm_integration)arxo analyze --path . --preset rag --format jsonFor engine-aligned weighting, run rag_architecture with centrality enabled in config:
metrics: - id: centrality - id: rag_architecture2) Triage Findings
Section titled “2) Triage Findings”Prioritize in this order:
retrieval_scope_filter_gap,prompt_injection_guard_gap,retrieved_content_sanitization_gap,retrieval_trust_boundary_gaptenant_isolation_risk,embedding_poisoning_guard_gap,claim_support_gapretrieval_latency_risk,index_freshness_risk,cache_layer_gap,ingestion_resilience_gap,retrieval_thresholding_gap,contextual_retrieval_gapcontext_budget_gap,reranking_gap,query_planning_gap,retrieval_adaptation_gap,retrieval_topology_maturity_gapeval_harness_gap,eval_metric_coverage_gap,grounding_citation_gap,citation_precision_gap,citation_coverage_gap,answerability_gate_gap
Then inspect composite movement:
rag_architecture.retrieval_readinessrag_architecture.safety_readinessrag_architecture.evaluation_readinessrag_architecture.overall_health
3) Apply Fixes by Track
Section titled “3) Apply Fixes by Track”- Safety track: scoped retrieval filters, prompt-injection protections, sanitization, and trust boundaries.
- Freshness/reliability track: source versioning, reindex triggers, embedding version pinning, resilient ingestion.
- Quality track: reranking, contextual retrieval, thresholding, claim support, citation precision/coverage.
- Performance track: budgeted context assembly, bounded retrieval fanout, timeout/circuit-breaker controls.
Use the Remediation Playbook for fix-by-metric guidance.
4) Enforce in CI
Section titled “4) Enforce in CI”Use profiles from Policy and CI Gates.
arxo analyze --path . --preset rag --config arxo.yml --fail-fastRecommended rollout:
- Start with pragmatic warning thresholds.
- Fix recurring high-severity findings in central modules.
- Promote strict gates to
errorafter stability.
5) Baseline and Monorepo Rollout
Section titled “5) Baseline and Monorepo Rollout”- Enable baseline no-regression checks against
origin/main. - Start with one critical service/workspace.
- Expand to additional workspaces once score trends stabilize.