Siddharth Rao Potukuchi commited on
Commit
abaead2
Β·
1 Parent(s): df5d427

Add my new project files

Browse files
Files changed (13) hide show
  1. CHANGELOG.md +131 -0
  2. GLOSSARY.md +174 -0
  3. GUARDRAIL_RULES.html +0 -138
  4. README.md +229 -0
  5. SAMPLE_QUERIES.html +0 -111
  6. TECH_STACK.html +0 -118
  7. index.html +0 -0
  8. page-02.html +799 -0
  9. page-03.html +942 -0
  10. page-04.html +904 -0
  11. page-05.html +656 -0
  12. page-06.html +649 -0
  13. style.css +627 -0
CHANGELOG.md ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog
2
+
3
+ All notable changes to VaultRAG are documented here.
4
+
5
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [Unreleased]
11
+
12
+ Items designed and documented but not yet implemented. Full specifications in [page-06.html](https://raosiddharthp.github.io/VaultRAG/page-06.html).
13
+
14
+ ### Planned for v1.0
15
+ - JWT authentication and role-based access control
16
+ - Department-level document namespacing in ChromaDB
17
+ - Immutable append-only audit log (ISO 9001 ready)
18
+ - LlamaGuard integration on G4 trigger (conditional, not always-on)
19
+ - Whisper local STT for fully air-gapped facilities
20
+ - Word (.docx) and PowerPoint (.pptx) document ingestion
21
+ - Text-to-speech response readback via Web Speech Synthesis API
22
+ - Document version management and auto re-index triggers
23
+ - Giskard automated vulnerability scanning in CI/CD pipeline
24
+
25
+ ---
26
+
27
+ ## [0.1.0] β€” 2026-03-20
28
+
29
+ Initial release. MVP portfolio artifact demonstrating the core RAG loop with 5-layer guardrail pipeline.
30
+
31
+ ### Added
32
+
33
+ **Core pipeline**
34
+ - 5-layer guardrail pipeline: G1 Query Normaliser, G2 Scope Guard, G3 Confidence Threshold, G4 Safety Flag, G5 Citation Enforcer
35
+ - Voice input via Web Speech API β€” browser-native, zero install, zero server overhead
36
+ - Text fallback input for high-noise environments
37
+ - Llama 3.2 3B local inference via Ollama β€” no external API calls
38
+ - nomic-embed-text embeddings via Ollama β€” single process, no separate embedding service
39
+ - ChromaDB vector store β€” embedded, persistent to local disk
40
+ - LlamaIndex RAG orchestration β€” ingestion pipeline, query engine, response synthesis
41
+ - Procedural section chunking β€” splits at heading/procedure boundaries, not token windows
42
+ - Top-k=3 retrieval with cosine similarity scoring
43
+ - Configurable confidence threshold (default: 0.70)
44
+ - Mandatory safety prefix on G4 trigger (LOTO, high-voltage, pressure vessel keywords)
45
+ - Citation enforcement with one-retry logic on G5 failure
46
+
47
+ **Frontend & backend**
48
+ - FastAPI backend serving API and static files
49
+ - Single mobile-responsive HTML/CSS/JS frontend β€” no JavaScript framework
50
+ - One-button voice interface designed for one-handed factory floor use
51
+ - Step-by-step response format (max 5 steps) enforced by system prompt
52
+ - Source citation block on every successful response
53
+
54
+ **Document ingestion**
55
+ - PDF ingestion via PyMuPDF with section-boundary chunking
56
+ - TXT ingestion with heading-aware chunking
57
+ - Chunk metadata tagging: document title, section number, page range
58
+ - ChromaDB index persistence between sessions
59
+
60
+ **Deployment**
61
+ - Docker + Docker Compose single-command deployment
62
+ - Works identically on local machine, HuggingFace Spaces, and on-prem server
63
+ - No internet connection required after initial model download
64
+
65
+ **Portfolio documentation**
66
+ - `index.html` β€” Landing page: hook, forcing functions, architecture teaser, metrics
67
+ - `page-02.html` β€” The Problem: business narrative, human narrative, economic model with cited sources
68
+ - `page-03.html` β€” Architecture & Design: anchor client (FlexForm), 3 design principles, 8 ADRs, system diagram, deployment model, chunking strategy comparison
69
+ - `page-04.html` β€” Workflow Simulator: 4 pre-scripted scenarios with live pipeline animation
70
+ - `page-05.html` β€” Cost Model: problem cost vs solution cost, component breakdown, ROI calculation, competitive comparison
71
+ - `page-06.html` β€” Roadmap: MVP scope table, v1.0 path, deferred decisions, portfolio signal by discipline
72
+ - `style.css` β€” Shared design system: tokens, nav, footer, utilities, animations
73
+ - `README.md` β€” Project overview, setup instructions, stack reference
74
+ - `GLOSSARY.md` β€” Technical and domain term definitions
75
+ - `CHANGELOG.md` β€” This file
76
+
77
+ ### Architecture Decisions
78
+
79
+ Eight Architecture Decision Records documented in page-03.html:
80
+
81
+ | ADR | Decision | Supersedes |
82
+ |---|---|---|
83
+ | ADR-001 | Llama 3.2 3B over Llama 3.1 8B | Original notes specified 3.1 8B |
84
+ | ADR-002 | nomic-embed-text over Sentence-BERT | Original notes listed both redundantly |
85
+ | ADR-003 | Custom prompt guardrails over LlamaGuard + Giskard | Original notes specified both as runtime components |
86
+ | ADR-004 | FastAPI + HTML over Streamlit | Original notes specified Streamlit |
87
+ | ADR-005 | Web Speech API over Whisper | Voice not specified in original notes |
88
+ | ADR-006 | HuggingFace Spaces over GCP / Render | GCP credits reserved for other projects; Render cold-start risk |
89
+ | ADR-007 | ChromaDB over Pinecone / Weaviate | Cloud vector stores violate data sovereignty invariant |
90
+ | ADR-008 | Procedural chunking over token windows | Default token windows split procedures unsafely |
91
+
92
+ ### Known Limitations
93
+
94
+ - **Web Speech API STT** uses Google or Apple backend β€” violates strict air-gapped requirements. Mitigated in v1.0 with local Whisper.
95
+ - **Single document corpus** β€” no namespace isolation between departments. Mitigated in v1.0 with ChromaDB collections per namespace.
96
+ - **No user authentication** οΏ½οΏ½ system is open to anyone on the plant network. Mitigated in v1.0 with JWT auth.
97
+ - **No audit log** β€” queries and responses are not persisted for review. Mitigated in v1.0 with append-only log.
98
+ - **Demo environment** (HuggingFace Spaces) is not air-gapped β€” data sovereignty only applies in on-prem production deployment. Documented in portfolio.
99
+ - **Llama 3.2 3B** has less reasoning depth on complex multi-step procedures than 8B. Demo constraint only β€” production path uses 8B+.
100
+ - **G4 Safety Flag** uses keyword matching β€” susceptible to novel hazard phrasing not in the keyword list. Mitigated in v1.0 with conditional LlamaGuard.
101
+
102
+ ### Dependencies
103
+
104
+ | Package | Version | Licence |
105
+ |---|---|---|
106
+ | llama-index | β‰₯0.10 | MIT |
107
+ | chromadb | β‰₯0.4 | Apache 2.0 |
108
+ | fastapi | β‰₯0.110 | MIT |
109
+ | uvicorn | β‰₯0.29 | BSD |
110
+ | pymupdf | β‰₯1.24 | AGPL / commercial |
111
+ | ollama | β‰₯0.1 | MIT |
112
+ | python-multipart | β‰₯0.0.9 | Apache 2.0 |
113
+
114
+ Model licences: Llama 3.2 (Meta Llama 3.2 Community Licence), nomic-embed-text (Apache 2.0).
115
+
116
+ ---
117
+
118
+ ## [0.0.1] β€” 2026-01-15 β€” Pre-release design notes
119
+
120
+ ### Added
121
+ - Initial concept documentation (unrefined): index.html, TECH_STACK.html, GUARDRAIL_RULES.html, SAMPLE_QUERIES.html
122
+ - Stack proposal: LlamaIndex + Chroma + Ollama + Streamlit + LlamaGuard + Giskard + Sentence-BERT
123
+
124
+ ### Notes
125
+ These files represent early design thinking prior to the architecture refinement process documented in the portfolio. They are retained in git history for reference. All component decisions were subsequently reviewed and several were revised β€” see ADR-001 through ADR-008 for the full decision trail.
126
+
127
+ ---
128
+
129
+ [Unreleased]: https://github.com/raosiddharthp/VaultRAG/compare/v0.1.0...HEAD
130
+ [0.1.0]: https://github.com/raosiddharthp/VaultRAG/releases/tag/v0.1.0
131
+ [0.0.1]: https://github.com/raosiddharthp/VaultRAG/releases/tag/v0.0.1
GLOSSARY.md ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VaultRAG β€” Glossary
2
+
3
+ Definitions of technical and domain-specific terms used across the VaultRAG portfolio. Terms are organised by category. Where a term has a specific meaning in the VaultRAG context that differs from its general usage, the VaultRAG-specific definition is stated.
4
+
5
+ ---
6
+
7
+ ## RAG & AI Architecture
8
+
9
+ **RAG (Retrieval-Augmented Generation)**
10
+ A technique that combines a vector retrieval system with a language model. Rather than generating a response from training data alone, the model first retrieves relevant passages from a document corpus and uses those passages as context for generation. VaultRAG uses LlamaIndex as the RAG orchestration framework.
11
+
12
+ **LLM (Large Language Model)**
13
+ A neural network trained on large text corpora capable of generating, summarising, and reasoning over natural language. In VaultRAG, the LLM is Llama 3.2 3B, served locally via Ollama. It is used for query normalisation (G1), response generation, and citation validation (G5).
14
+
15
+ **Embedding**
16
+ A numerical vector representation of a piece of text that captures its semantic meaning. Similar texts produce embeddings that are close together in vector space. VaultRAG uses `nomic-embed-text` via Ollama to embed both documents (at ingestion) and queries (at runtime).
17
+
18
+ **Vector Store**
19
+ A database optimised for storing and searching embedding vectors. VaultRAG uses ChromaDB as an embedded, persistent, local vector store. It stores chunk embeddings indexed with metadata (document title, section, page range).
20
+
21
+ **Cosine Similarity**
22
+ A measure of similarity between two vectors, ranging from -1 to 1. A score of 1 means the vectors are identical in direction. VaultRAG uses cosine similarity to compare query embeddings against chunk embeddings during retrieval. The G3 Confidence Threshold requires a minimum score of 0.70.
23
+
24
+ **Chunk / Chunking**
25
+ The process of splitting a document into smaller, retrievable units before embedding. VaultRAG uses procedural section chunking β€” splitting at heading and procedure boundaries rather than arbitrary token windows β€” to preserve complete procedures as single retrievable units.
26
+
27
+ **Top-k Retrieval**
28
+ The retrieval strategy of returning the k most similar chunks for a given query. VaultRAG uses k=3, returning the three most relevant chunks from ChromaDB to ground the LLM response.
29
+
30
+ **Hallucination**
31
+ A failure mode in LLM generation where the model produces a plausible-sounding but factually incorrect or ungrounded response. In a manufacturing context, a hallucinated procedure is not an inconvenience β€” it is a safety risk. VaultRAG's guardrail pipeline is designed specifically to prevent hallucination by refusing to generate when confidence is insufficient.
32
+
33
+ **Context Window**
34
+ The maximum amount of text a language model can process in a single inference call. Llama 3.2 3B has a 128K token context window. VaultRAG's top-3 retrieved chunks are injected into the context window alongside the system prompt and query.
35
+
36
+ **Inference**
37
+ The act of running a trained model to generate output for a given input. In VaultRAG, inference is performed locally by Ollama β€” no external API call is made at inference time.
38
+
39
+ **System Prompt**
40
+ A set of instructions prepended to every LLM call that governs the model's behaviour. VaultRAG's system prompt enforces: step-by-step format, maximum 5 steps, mandatory citation, and safety prefix on G4 trigger. It is a first-class design artifact, not an afterthought.
41
+
42
+ **Semantic Search**
43
+ Search based on meaning rather than keyword matching. A query for "spindle fault" will retrieve chunks about "spindle bearing failure" even if the exact words don't match, because the embeddings are semantically close.
44
+
45
+ **Procedural Chunking**
46
+ VaultRAG's specific chunking strategy: splitting documents at section headings and numbered procedure boundaries, keeping each complete procedure as a single chunk. Contrasted with token-window chunking, which splits at arbitrary character counts regardless of content structure.
47
+
48
+ ---
49
+
50
+ ## Guardrail Pipeline
51
+
52
+ **G1 β€” Query Normaliser**
53
+ The first guardrail layer. Runs before retrieval. Takes the raw voice transcription (which may include filler words, mishearing, jargon, or incomplete sentences) and uses a structured LLM prompt to produce a clean, well-formed query. Position: pre-retrieval.
54
+
55
+ **G2 β€” Scope Guard**
56
+ The second guardrail layer. Runs before retrieval. Checks whether the normalised query has any meaningful semantic overlap with the indexed document corpus. Uses the top-1 similarity score as a proxy: if it is below a minimum floor (0.30), the query is refused immediately without spending retrieval budget. Position: pre-retrieval.
57
+
58
+ **G3 β€” Confidence Threshold**
59
+ The third guardrail layer. Runs after retrieval. Checks whether the best chunk returned by ChromaDB meets the minimum similarity threshold of 0.70. If no chunk reaches this threshold, the system refuses rather than generating a response from weakly-matched context. Position: post-retrieval.
60
+
61
+ **G4 β€” Safety Flag**
62
+ The fourth guardrail layer. Runs after retrieval, before generation. Scans the retrieved chunks for safety-critical keywords: LOTO, lockout, tagout, high voltage, pressure vessel, hazardous material, isolation, and equivalents. If triggered, a mandatory safety warning prefix is prepended to the response and the citation must include the full procedure reference. Position: pre-generation.
63
+
64
+ **G5 β€” Citation Enforcer**
65
+ The fifth guardrail layer. Runs after generation. Validates that the LLM output contains at least one source reference (document title, section, page range). If absent, the response is retried once with a stricter prompt. If the retry also fails, the response is blocked and a refusal is returned. Position: post-generation.
66
+
67
+ **Fail Closed**
68
+ A design principle where a system defaults to refusal rather than partial or uncertain action when it cannot operate correctly. VaultRAG's guardrail pipeline is designed to fail closed: when confidence is insufficient, when scope is violated, when a citation cannot be produced, the system refuses with a clear explanation rather than generating a potentially incorrect answer.
69
+
70
+ **Confidence Threshold**
71
+ In VaultRAG, the minimum cosine similarity score (0.70) required for the best retrieved chunk before the system will proceed to generation. A configurable parameter. Below this threshold, the system refuses. See G3.
72
+
73
+ ---
74
+
75
+ ## Manufacturing Domain
76
+
77
+ **SOP (Standard Operating Procedure)**
78
+ A documented, step-by-step procedure for performing a specific task consistently and correctly. In manufacturing, SOPs are typically ISO-controlled documents β€” they have version numbers, approval workflows, and change histories. VaultRAG is designed to query SOPs as a primary document type.
79
+
80
+ **NCR (Non-Conformance Report)**
81
+ A formal document raised when a product, process, or procedure does not meet the required standard. NCRs trigger investigation, corrective action, and in regulated environments, customer notification. VaultRAG's use case is partly motivated by the fact that 9 of FlexForm's 14 annual NCRs were traced to incorrect procedure application.
82
+
83
+ **LOTO (Lockout/Tagout)**
84
+ A safety procedure (OSHA 29 CFR 1910.147) requiring the isolation and locking of energy sources before maintenance work begins on equipment. A LOTO violation is a serious safety incident. G4 Safety Flag specifically detects LOTO references in retrieved chunks and triggers a mandatory warning prefix.
85
+
86
+ **ISO 9001**
87
+ An international standard for quality management systems. ISO 9001-certified manufacturers must maintain documented procedures, evidence of process control, and audit trails for corrective actions. VaultRAG's audit log (v1.0 roadmap) is designed specifically to satisfy ISO 9001 documentation requirements.
88
+
89
+ **OEM (Original Equipment Manufacturer)**
90
+ The manufacturer of the original equipment. In a Tier-2 supply chain context, FlexForm supplies components to a Tier-1 OEM. OEM equipment manuals are the primary source documents in VaultRAG's corpus.
91
+
92
+ **CNC (Computer Numerical Control)**
93
+ A type of precision machining equipment controlled by computer programs. The Haas VF-2SS referenced throughout the portfolio is a CNC vertical machining centre. E-04 is a spindle fault code on this machine.
94
+
95
+ **Torque Specification**
96
+ The precise amount of rotational force required to tighten a fastener correctly. Torque specs are safety-critical in manufacturing β€” too loose causes failure; too tight causes damage. The 45 Nm torque spec for the Haas VF-2SS spindle bearing housing is a concrete example of the type of specific, precise information VaultRAG is designed to retrieve accurately.
97
+
98
+ **ITAR (International Traffic in Arms Regulations)**
99
+ US export control regulations that govern the manufacturing, sale, and distribution of defence-related articles and services. ITAR-adjacent manufacturers prohibit sending controlled technical data to third-party cloud services β€” a key driver of the on-prem, zero-exfiltration architecture.
100
+
101
+ **Tier-2 Supplier**
102
+ A company that supplies components or services to a Tier-1 supplier, who in turn supplies to an OEM. Tier-2 suppliers like FlexForm operate under NDA clauses and data governance requirements that flow down from the OEM through the Tier-1. These constraints typically prohibit cloud data sharing.
103
+
104
+ **Downtime**
105
+ Any period when production equipment is not operating as intended. Unplanned downtime β€” caused by unexpected equipment failure β€” is the most costly. The average cost of unplanned downtime in general manufacturing is $260,000/hour (Aberdeen Group, 2024).
106
+
107
+ ---
108
+
109
+ ## Infrastructure & Deployment
110
+
111
+ **Ollama**
112
+ An open-source tool for running large language models locally. Ollama handles model downloading, serving, and API access via a local HTTP endpoint (default: port 11434). VaultRAG uses Ollama to serve both Llama 3.2 3B (LLM) and nomic-embed-text (embeddings) from a single local process.
113
+
114
+ **ChromaDB**
115
+ An open-source embedding database (vector store) that runs embedded within the application process and persists to local disk. No external service required. Apache 2.0 licence. VaultRAG uses ChromaDB as the sole vector retrieval backend.
116
+
117
+ **LlamaIndex**
118
+ An open-source Python framework for building LLM-powered applications over external data. Provides the document ingestion pipeline, query engine, retrieval orchestration, and response synthesis in VaultRAG. MIT licence.
119
+
120
+ **FastAPI**
121
+ A modern Python web framework for building APIs. VaultRAG uses FastAPI as the backend HTTP server β€” handling API requests from the frontend, orchestrating the guardrail pipeline, and serving the static HTML frontend. MIT licence.
122
+
123
+ **Docker / Docker Compose**
124
+ A containerisation platform that packages an application and its dependencies into a portable, reproducible unit. VaultRAG's entire stack (Ollama + ChromaDB + FastAPI + frontend) is containerised with Docker Compose. One command (`docker-compose up`) starts the complete stack on any machine.
125
+
126
+ **Plant WiFi / Plant LAN**
127
+ The internal network infrastructure within a manufacturing facility. In VaultRAG's production deployment model, the backend server is on the plant LAN and technicians access it via plant WiFi from their phones. No internet connection is required or used after initial model download.
128
+
129
+ **Air-Gapped**
130
+ A security configuration in which a system has no connection to external networks. VaultRAG's on-prem deployment is designed to operate in air-gapped or near-air-gapped environments: after the initial model download, zero network egress is required.
131
+
132
+ **HuggingFace Spaces**
133
+ A platform by HuggingFace for hosting ML applications and demos. VaultRAG uses HuggingFace Spaces free tier to host the portfolio demo backend (Docker container with Ollama + ChromaDB + FastAPI). This is a demo environment only β€” not representative of the production deployment model.
134
+
135
+ **GitHub Pages**
136
+ A static site hosting service provided by GitHub, free for public repositories. VaultRAG's portfolio frontend (the six HTML pages) is hosted on GitHub Pages. No server required β€” GitHub Pages serves static files directly.
137
+
138
+ **Web Speech API**
139
+ A browser-native JavaScript API that provides speech recognition and speech synthesis capabilities. VaultRAG uses the speech recognition component for voice input β€” the browser captures audio from the device microphone and returns a text transcription. No SDK, no app install, no server-side processing required.
140
+
141
+ **PyMuPDF (fitz)**
142
+ A Python library for parsing PDF files. VaultRAG uses PyMuPDF to extract text from PDF documents during ingestion, with custom logic to detect section headings and procedure boundaries for procedural chunking.
143
+
144
+ **nomic-embed-text**
145
+ An open-source text embedding model by Nomic AI. VaultRAG uses nomic-embed-text via Ollama for generating document and query embeddings. 768-dimensional embeddings. No external API call required.
146
+
147
+ ---
148
+
149
+ ## Architecture & Design
150
+
151
+ **ADR (Architecture Decision Record)**
152
+ A document that records a significant architectural decision, the context in which it was made, the alternatives considered, and the reasoning for the choice. VaultRAG documents eight ADRs covering every major stack decision. The format is borrowed from Michael Nygard's original ADR proposal.
153
+
154
+ **Data Sovereignty**
155
+ The principle that data remains under the control of the organisation that owns it, subject to that organisation's laws and governance policies. In VaultRAG, data sovereignty is an architectural invariant: no document content, query text, or response data is transmitted outside the facility network.
156
+
157
+ **On-Prem (On-Premises)**
158
+ A deployment model where software runs on hardware physically located at the user's facility, rather than in a cloud data centre. VaultRAG's production deployment is on-prem by design β€” the LLM, vector store, and application server all run on a server inside the plant.
159
+
160
+ **Zero Exfiltration**
161
+ The property of a system in which no data exits the defined trust boundary under any normal operating condition. In VaultRAG, zero exfiltration means that no document content, query, embedding, or response is ever transmitted to an external network after initial model download.
162
+
163
+ **TOGAF ADM**
164
+ The Architecture Development Method defined by The Open Group Architecture Framework (TOGAF). A structured approach to enterprise architecture design. Referenced in the broader portfolio context (The Autonomous Enterprise uses TOGAF ADM across six phases).
165
+
166
+ **HITL (Human-in-the-Loop)**
167
+ A design pattern in which a human reviewer is required to approve or validate an AI decision before it takes effect. Not implemented in VaultRAG v0.1 (the system either answers or refuses), but referenced as a production upgrade path in the v1.0 roadmap for escalation scenarios.
168
+
169
+ **Fail Closed**
170
+ See Guardrail Pipeline section above.
171
+
172
+ ---
173
+
174
+ *Last updated: March 2026 Β· VaultRAG v0.1*
GUARDRAIL_RULES.html DELETED
@@ -1,138 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Guardrail Rules Engine – VaultRAG</title>
6
- <style>
7
- @import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');
8
-
9
- body {
10
- font-family: 'Space Mono', monospace;
11
- background: white;
12
- color: black;
13
- max-width: 900px;
14
- margin: 60px auto;
15
- padding: 0 20px;
16
- line-height: 1.7;
17
- font-size: 17px;
18
- }
19
-
20
- h1 {
21
- color: #0066FF;
22
- font-size: 2.4em;
23
- border-bottom: 4px solid #0066FF;
24
- padding-bottom: 15px;
25
- margin-bottom: 40px;
26
- }
27
-
28
- h2 {
29
- color: #0066FF;
30
- font-size: 1.8em;
31
- margin-top: 3em;
32
- border-bottom: 2px solid #0066FF;
33
- padding-bottom: 8px;
34
- }
35
-
36
- table {
37
- border-collapse: collapse;
38
- width: 100%;
39
- margin: 30px 0;
40
- }
41
-
42
- th, td {
43
- border: 1px solid #ccc;
44
- padding: 12px;
45
- text-align: left;
46
- }
47
-
48
- th {
49
- background: #f0f8ff;
50
- color: #0066FF;
51
- font-weight: 700;
52
- }
53
-
54
- .back {
55
- margin-top: 80px;
56
- padding-top: 30px;
57
- border-top: 2px solid #0066FF;
58
- }
59
- </style>
60
- </head>
61
- <body>
62
-
63
- <h1>Guardrail Rules Engine</h1>
64
-
65
- <p>VaultRAG includes multiple layers of guardrails to ensure responses are accurate, appropriate, and strictly grounded in uploaded documents. These rules prevent hallucinations, off-topic answers, and potential misuse.</p>
66
-
67
- <h2>Guardrail Layers</h2>
68
-
69
- <table>
70
- <thead>
71
- <tr>
72
- <th>Layer</th>
73
- <th>Purpose</th>
74
- <th>Mechanism</th>
75
- <th>Response When Triggered</th>
76
- </tr>
77
- </thead>
78
- <tbody>
79
- <tr>
80
- <td>Scope Guardrail</td>
81
- <td>Prevents answers outside uploaded documents</td>
82
- <td>Pre-query check for external knowledge requests</td>
83
- <td>"I can only answer based on uploaded documents"</td>
84
- </tr>
85
- <tr>
86
- <td>Retrieval Confidence</td>
87
- <td>Ensures sufficient relevant context</td>
88
- <td>Minimum similarity threshold for retrieved chunks</td>
89
- <td>"I don't have sufficient information in the uploaded documents to answer this"</td>
90
- </tr>
91
- <tr>
92
- <td>Hallucination Detection</td>
93
- <td>Catches ungrounded claims</td>
94
- <td>Self-checking prompt + LlamaGuard model</td>
95
- <td>Re-generates or refuses with explanation</td>
96
- </tr>
97
- <tr>
98
- <td>Topic Moderation</td>
99
- <td>Blocks inappropriate queries</td>
100
- <td>Keyword + semantic filtering</td>
101
- <td>"This query is outside my scope"</td>
102
- </tr>
103
- <tr>
104
- <td>Citation Enforcement</td>
105
- <td>Ensures all claims are traceable</td>
106
- <td>Post-generation validation</td>
107
- <td>Forces inclusion of source references</td>
108
- </tr>
109
- </tbody>
110
- </table>
111
-
112
- <h2>Hallucination Detection Flow</h2>
113
-
114
- <ol>
115
- <li>Initial response generated with retrieved context</li>
116
- <li>Self-check prompt: "Are all claims in the response directly supported by the provided context? Answer YES or NO"</li>
117
- <li>If NO β†’ re-generate with stricter instructions</li>
118
- <li>If still NO β†’ respond: "I don't have sufficient information to answer accurately"</li>
119
- </ol>
120
-
121
- <h2>Configurable Enterprise Controls (Future)</h2>
122
-
123
- <ul>
124
- <li>Topic allow/block lists</li>
125
- <li>Department-specific document access</li>
126
- <li>Response length limits</li>
127
- <li>Audit logging of all queries</li>
128
- <li>Custom disclaimer injection</li>
129
- </ul>
130
-
131
- <p>These guardrails ensure VaultRAG is suitable for sensitive enterprise environments while maintaining high utility.</p>
132
-
133
- <div class="back">
134
- <a href="index.html">← Back to Main Design</a>
135
- </div>
136
-
137
- </body>
138
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VaultRAG β€” Factory Floor Intelligence
2
+
3
+ > **Open-source, local-first RAG agent for manufacturing.** Query equipment manuals, SOPs, and incident reports by voice β€” from the floor, on any phone β€” without a single byte leaving your facility.
4
+
5
+ [![Portfolio](https://img.shields.io/badge/Portfolio-Live%20Demo-f59e0b?style=flat-square)](https://raosiddharthp.github.io/VaultRAG/)
6
+ [![Architecture](https://img.shields.io/badge/Architecture-6%20Pages-3b82f6?style=flat-square)](https://raosiddharthp.github.io/VaultRAG/page-03.html)
7
+ [![Simulator](https://img.shields.io/badge/Simulator-Live-10b981?style=flat-square)](https://raosiddharthp.github.io/VaultRAG/page-04.html)
8
+ [![License](https://img.shields.io/badge/License-Apache%202.0-8b5cf6?style=flat-square)](LICENSE)
9
+
10
+ ---
11
+
12
+ ## The Problem
13
+
14
+ A maintenance technician on a factory floor throws a fault code at 07:14. The line is stopped. The manual is a 380-page PDF on a laptop 40 metres away. The average search time is 18 minutes. At Β£125,000/hour of downtime, that is Β£37,500 before the procedure even begins.
15
+
16
+ Cloud-based RAG tools β€” the obvious answer β€” are architecturally excluded from most manufacturing environments by NDA clauses, ITAR restrictions, and ISO 27001 data governance policies. No document content can leave the facility.
17
+
18
+ VaultRAG solves this. The knowledge stays on-prem. The answer reaches the floor in under 8 seconds.
19
+
20
+ ---
21
+
22
+ ## What It Does
23
+
24
+ - **Voice query** from any phone on the plant WiFi β€” no app install, no login
25
+ - **5-layer guardrail pipeline** that refuses rather than hallucinates
26
+ - **Cited, step-by-step responses** traceable to document, section, and page
27
+ - **Zero data exfiltration** β€” the LLM, embeddings, and vector store all run locally
28
+ - **Safety-first design** β€” LOTO and hazard procedures trigger mandatory safety prefixes
29
+
30
+ ---
31
+
32
+ ## Architecture
33
+
34
+ ```
35
+ Voice Input (Web Speech API)
36
+ β”‚
37
+ β–Ό
38
+ G1 Β· Query Normaliser ← denoise voice transcription
39
+ β”‚
40
+ G2 Β· Scope Guard ← refuse if no corpus relevance
41
+ β”‚
42
+ ChromaDB Retrieval ← top-k=3 Β· nomic-embed-text Β· cosine similarity
43
+ β”‚
44
+ G3 Β· Confidence Threshold ← refuse if best score < 0.70
45
+ β”‚
46
+ G4 Β· Safety Flag ← warn on LOTO / hazard keywords
47
+ β”‚
48
+ Llama 3.2 3B (Ollama) ← local inference Β· step-by-step Β· citation required
49
+ β”‚
50
+ G5 Β· Citation Enforcer ← block response if no source reference
51
+ β”‚
52
+ β–Ό
53
+ Cited response β†’ technician's phone
54
+ ```
55
+
56
+ **Full architecture documentation:** [page-03.html](https://raosiddharthp.github.io/VaultRAG/page-03.html)
57
+
58
+ ---
59
+
60
+ ## Tech Stack
61
+
62
+ | Layer | Component | Notes |
63
+ |---|---|---|
64
+ | LLM | Llama 3.2 3B via Ollama | Local inference Β· Apache 2.0 |
65
+ | Embeddings | nomic-embed-text via Ollama | Same process as LLM Β· no extra service |
66
+ | Vector Store | ChromaDB | Embedded Β· persistent to disk |
67
+ | RAG Framework | LlamaIndex | Orchestration + ingestion pipeline |
68
+ | Document Parsing | PyMuPDF | Procedural section chunking |
69
+ | Guardrails | Custom prompt-based (G1–G5) | No extra model Β· auditable refusals |
70
+ | Voice Input | Web Speech API | Browser-native Β· zero install |
71
+ | Backend | FastAPI | HTTP server + static file serving |
72
+ | Frontend | HTML / CSS / JS | Single mobile-responsive page |
73
+ | Containerisation | Docker + Compose | One command to run anywhere |
74
+
75
+ **Stack decision rationale (ADR-001 through ADR-008):** [page-03.html](https://raosiddharthp.github.io/VaultRAG/page-03.html)
76
+
77
+ ---
78
+
79
+ ## Demo
80
+
81
+ The live portfolio demo runs on HuggingFace Spaces (free tier). The frontend is hosted on GitHub Pages.
82
+
83
+ > ⚠️ **Demo environment note:** The demo uses HuggingFace Spaces for compute. In production, the entire stack runs on-prem β€” no data leaves the facility network. See [page-03.html](https://raosiddharthp.github.io/VaultRAG/page-03.html) for the deployment model.
84
+
85
+ **Four scenarios are available in the simulator:**
86
+
87
+ | Scenario | What it demonstrates |
88
+ |---|---|
89
+ | Happy path | All 5 guardrails pass Β· procedure retrieved and cited |
90
+ | Out of scope | G2 fires Β· query blocked before retrieval |
91
+ | Safety flag | G4 fires Β· LOTO prefix prepended to response |
92
+ | Low confidence | G3 fires Β· retrieval runs but scores insufficient |
93
+
94
+ [**β†’ Run the simulator**](https://raosiddharthp.github.io/VaultRAG/page-04.html)
95
+
96
+ ---
97
+
98
+ ## Local Setup
99
+
100
+ ### Prerequisites
101
+
102
+ - [Docker](https://www.docker.com/) and Docker Compose
103
+ - [Ollama](https://ollama.com/) (or use the Docker Compose setup which includes it)
104
+ - 8GB RAM minimum (16GB recommended)
105
+ - 10GB disk space for models and indexes
106
+
107
+ ### Run locally
108
+
109
+ ```bash
110
+ # 1. Clone the repo
111
+ git clone https://github.com/raosiddharthp/VaultRAG.git
112
+ cd VaultRAG
113
+
114
+ # 2. Pull the required models
115
+ ollama pull llama3.2:3b
116
+ ollama pull nomic-embed-text
117
+
118
+ # 3. Start the stack
119
+ docker-compose up
120
+
121
+ # 4. Open on your phone (same WiFi)
122
+ # Navigate to http://<your-machine-ip>:8000
123
+ ```
124
+
125
+ ### Ingest your documents
126
+
127
+ ```bash
128
+ # Place PDF or TXT files in /docs
129
+ # Run the ingestion pipeline
130
+ python ingest.py --docs ./docs
131
+ ```
132
+
133
+ The ingestion pipeline chunks documents by section boundary (not token window), embeds with nomic-embed-text, and persists to ChromaDB. Re-run whenever documents are updated.
134
+
135
+ ---
136
+
137
+ ## Supported Document Formats
138
+
139
+ | Format | Status | Notes |
140
+ |---|---|---|
141
+ | PDF (`.pdf`) | βœ… v0.1 | PyMuPDF Β· section-boundary chunking |
142
+ | Plain text (`.txt`) | βœ… v0.1 | Heading-aware chunking |
143
+ | Word (`.docx`) | πŸ”œ v1.0 | python-docx Β· in roadmap |
144
+ | PowerPoint (`.pptx`) | πŸ”œ v1.0 | python-pptx Β· slide-title chunking |
145
+ | Markdown (`.md`) | πŸ”œ v1.0 | Heading-based chunking |
146
+
147
+ ---
148
+
149
+ ## Guardrail Reference
150
+
151
+ | Layer | Position | Mechanism | Triggered response |
152
+ |---|---|---|---|
153
+ | G1 Β· Query Normaliser | Pre-retrieval | LLM prompt Β· structured reformat | Query cleaned before retrieval |
154
+ | G2 Β· Scope Guard | Pre-retrieval | Top-1 similarity < 0.30 | "Query outside document scope" |
155
+ | G3 Β· Confidence Threshold | Post-retrieval | Best chunk score < 0.70 | "Insufficient information" |
156
+ | G4 Β· Safety Flag | Pre-generation | Keyword + semantic scan | Mandatory safety prefix prepended |
157
+ | G5 Β· Citation Enforcer | Post-generation | Source reference validation | Response blocked Β· retry once |
158
+
159
+ ---
160
+
161
+ ## Portfolio Context
162
+
163
+ VaultRAG is part of a broader enterprise AI architecture portfolio demonstrating end-to-end design capability across EA, MLE, and Cloud Architecture disciplines.
164
+
165
+ **The full portfolio:**
166
+
167
+ | Project | Vertical | Stack |
168
+ |---|---|---|
169
+ | [The Autonomous Enterprise](https://raosiddharthp.github.io/The-Autonomous-Enterprise/) | Medical Devices (ClaraVis) | GCP Β· ADK Β· Vertex AI Β· TOGAF |
170
+ | [The Autonomous HR](https://raosiddharthp.github.io/The-Autonomous-HR/) | Deskless Workforce | GCP Β· WhatsApp Β· Whisper Β· pgvector |
171
+ | **VaultRAG** | **Manufacturing** | **Ollama Β· LlamaIndex Β· ChromaDB Β· FastAPI** |
172
+
173
+ Each project targets a different vertical to demonstrate cross-domain architectural thinking.
174
+
175
+ ---
176
+
177
+ ## Roadmap
178
+
179
+ **v0.1 β€” MVP (current)**
180
+ - [x] 5-layer guardrail pipeline
181
+ - [x] Voice input via Web Speech API
182
+ - [x] PDF and TXT ingestion with procedural chunking
183
+ - [x] Llama 3.2 3B local inference via Ollama
184
+ - [x] Mobile-responsive chat UI
185
+ - [x] Docker deployment
186
+
187
+ **v1.0 β€” Production path**
188
+ - [ ] JWT authentication + role-based access
189
+ - [ ] Department-level document namespacing
190
+ - [ ] Immutable audit log (ISO 9001 ready)
191
+ - [ ] LlamaGuard on G4 trigger (conditional)
192
+ - [ ] Whisper local STT for air-gapped facilities
193
+ - [ ] Word and PowerPoint ingestion
194
+ - [ ] Text-to-speech response readback
195
+ - [ ] Document version management + auto re-index
196
+
197
+ **Full roadmap with justifications:** [page-06.html](https://raosiddharthp.github.io/VaultRAG/page-06.html)
198
+
199
+ ---
200
+
201
+ ## Cost Model
202
+
203
+ | Component | Monthly cost | Notes |
204
+ |---|---|---|
205
+ | LLM inference (Ollama) | Β£0.00 | Local Β· no API fees |
206
+ | Vector store (ChromaDB) | Β£0.00 | Embedded Β· Apache 2.0 |
207
+ | RAG framework (LlamaIndex) | Β£0.00 | MIT licence |
208
+ | Backend + frontend | Β£0.00 | Open source Β· self-hosted |
209
+ | Server hardware (amortised) | ~Β£50 | Shared with existing IT infrastructure |
210
+ | IT maintenance | ~Β£70 | ~2 hrs/month re-indexing |
211
+ | **Total** | **~Β£120/month** | **Β£1,440/year Β· all software Β£0** |
212
+
213
+ **Full cost model with sources:** [page-05.html](https://raosiddharthp.github.io/VaultRAG/page-05.html)
214
+
215
+ ---
216
+
217
+ ## Licence
218
+
219
+ Apache 2.0 β€” see [LICENSE](LICENSE).
220
+
221
+ Component licences: Llama 3.2 (Meta Llama 3.2 Community Licence), LlamaIndex (MIT), ChromaDB (Apache 2.0), Ollama (MIT), FastAPI (MIT).
222
+
223
+ ---
224
+
225
+ ## Author
226
+
227
+ **Siddharth Rao** Β· Enterprise AI Architecture Portfolio Β· 2026
228
+
229
+ [Portfolio](https://raosiddharthp.github.io/The-Autonomous-Enterprise/) Β· [LinkedIn](#) Β· [GitHub](https://github.com/raosiddharthp)
SAMPLE_QUERIES.html DELETED
@@ -1,111 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Sample Queries & Responses – VaultRAG</title>
6
- <style>
7
- @import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');
8
-
9
- body {
10
- font-family: 'Space Mono', monospace;
11
- background: white;
12
- color: black;
13
- max-width: 900px;
14
- margin: 60px auto;
15
- padding: 0 20px;
16
- line-height: 1.7;
17
- font-size: 17px;
18
- }
19
-
20
- h1 {
21
- color: #0066FF;
22
- font-size: 2.4em;
23
- border-bottom: 4px solid #0066FF;
24
- padding-bottom: 15px;
25
- margin-bottom: 40px;
26
- }
27
-
28
- h2 {
29
- color: #0066FF;
30
- font-size: 1.8em;
31
- margin-top: 3em;
32
- border-bottom: 2px solid #0066FF;
33
- padding-bottom: 8px;
34
- }
35
-
36
- .query {
37
- background: #f8f8f8;
38
- padding: 20px;
39
- border-radius: 8px;
40
- margin: 30px 0;
41
- border-left: 5px solid #0066FF;
42
- }
43
-
44
- .user {
45
- font-weight: 700;
46
- color: #0066FF;
47
- }
48
-
49
- .citation {
50
- font-size: 0.9em;
51
- color: #666;
52
- margin-top: 10px;
53
- }
54
-
55
- .back {
56
- margin-top: 80px;
57
- padding-top: 30px;
58
- border-top: 2px solid #0066FF;
59
- }
60
- </style>
61
- </head>
62
- <body>
63
-
64
- <h1>Sample Queries & Responses</h1>
65
-
66
- <p>These examples demonstrate VaultRAG's ability to provide accurate, grounded answers from uploaded internal documents with direct source citations and hallucination prevention.</p>
67
-
68
- <div class="query">
69
- <p class="user">User: What is our current policy on remote work expenses?</p>
70
- <p><strong>Agent:</strong> According to the "Employee Expense Policy v3.2" (uploaded March 2025), remote employees are eligible for reimbursement of home internet (up to $75/month) and ergonomic equipment (up to $500 one-time) with manager approval. Standard office supplies are not reimbursable for remote workers.</p>
71
- <p class="citation">Source: Employee Expense Policy v3.2 – Section 4.3 "Remote Work Allowances" (pages 12–13)</p>
72
- </div>
73
-
74
- <div class="query">
75
- <p class="user">User: How do we handle customer data retention for GDPR compliance?</p>
76
- <p><strong>Agent:</strong> Per the "Global Data Retention Standard" (updated January 2025), personal data from EU customers must be retained for no longer than 7 years after last interaction, with automated deletion scheduled via the Data Governance Platform. Exceptions require Legal approval and documentation.</p>
77
- <p class="citation">Source: Global Data Retention Standard – Section 6.2 "GDPR Requirements" (page 8)</p>
78
- </div>
79
-
80
- <div class="query">
81
- <p class="user">User: Who won the 2024 World Series?</p>
82
- <p><strong>Agent:</strong> I can only answer questions based on the documents you have uploaded. I don't have access to external or real-time information. Please ask about your internal policies, procedures, or uploaded knowledge base.</p>
83
- <p class="citation">Guardrail triggered: Query outside document scope</p>
84
- </div>
85
-
86
- <div class="query">
87
- <p class="user">User: Summarize the Q4 2025 sales strategy presentation</p>
88
- <p><strong>Agent:</strong> The Q4 2025 Sales Strategy focuses on three pillars: (1) Enterprise upsell targeting existing accounts with >$100k ARR (goal: 25% growth), (2) New logo acquisition in healthcare vertical (target 40 new customers), (3) Partner co-selling program expansion with AWS and Microsoft (projected 15% of revenue). Key initiatives include AI-powered deal scoring and personalized outreach campaigns.</p>
89
- <p class="citation">Source: Q4 2025 Sales Strategy Deck – Slides 5–12</p>
90
- </div>
91
-
92
- <div class="query">
93
- <p class="user">User: What is the meaning of life?</p>
94
- <p><strong>Agent:</strong> I'm designed to help with questions about your uploaded internal documents only. Philosophical questions are outside my scope.</p>
95
- <p class="citation">Guardrail triggered: Off-topic / non-document query</p>
96
- </div>
97
-
98
- <p>These examples show:</p>
99
- <ul>
100
- <li>Accurate grounding in uploaded content</li>
101
- <li>Direct source citation for trust</li>
102
- <li>Graceful handling of out-of-scope queries</li>
103
- <li>Natural, professional response style</li>
104
- </ul>
105
-
106
- <div class="back">
107
- <a href="index.html">← Back to Main Design</a>
108
- </div>
109
-
110
- </body>
111
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
TECH_STACK.html DELETED
@@ -1,118 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Technical Stack & Local Setup – VaultRAG</title>
6
- <style>
7
- @import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');
8
-
9
- body {
10
- font-family: 'Space Mono', monospace;
11
- background: white;
12
- color: black;
13
- max-width: 900px;
14
- margin: 60px auto;
15
- padding: 0 20px;
16
- line-height: 1.7;
17
- font-size: 17px;
18
- }
19
-
20
- h1 {
21
- color: #0066FF;
22
- font-size: 2.4em;
23
- border-bottom: 4px solid #0066FF;
24
- padding-bottom: 15px;
25
- margin-bottom: 40px;
26
- }
27
-
28
- h2 {
29
- color: #0066FF;
30
- font-size: 1.8em;
31
- margin-top: 3em;
32
- border-bottom: 2px solid #0066FF;
33
- padding-bottom: 8px;
34
- }
35
-
36
- pre {
37
- background: #f8f8f8;
38
- padding: 15px;
39
- border-radius: 8px;
40
- overflow-x: auto;
41
- margin: 20px 0;
42
- }
43
-
44
- .back {
45
- margin-top: 80px;
46
- padding-top: 30px;
47
- border-top: 2px solid #0066FF;
48
- }
49
- </style>
50
- </head>
51
- <body>
52
-
53
- <h1>Technical Stack & Local Setup</h1>
54
-
55
- <h2>Core Technology Stack</h2>
56
-
57
- <ul>
58
- <li><strong>LLM Backend</strong>: Ollama (local execution of open-source models)</li>
59
- <li><strong>Default Model</strong>: Llama 3.1 8B Instruct (balance of speed and quality)</li>
60
- <li><strong>RAG Framework</strong>: LlamaIndex (indexing, retrieval, query engine)</li>
61
- <li><strong>Vector Store</strong>: Chroma (persistent local embeddings)</li>
62
- <li><strong>Embedding Model</strong>: nomic-embed-text (local, high-performance)</li>
63
- <li><strong>Guardrails</strong>: Custom self-checking prompts + LlamaGuard model</li>
64
- <li><strong>Frontend</strong>: Streamlit (simple, interactive chat + document upload)</li>
65
- </ul>
66
-
67
- <h2>Local Installation Guide</h2>
68
-
69
- <pre>
70
- # 1. Install Ollama
71
- curl -fsSL https://ollama.com/install.sh | sh
72
-
73
- # 2. Pull the default model
74
- ollama pull llama3.1:8b
75
-
76
- # 3. Clone the repo
77
- git clone https://github.com/raosiddharthp/vaultRAG.git
78
- cd vaultRAG
79
-
80
- # 4. Install Python dependencies
81
- pip install -r requirements.txt
82
-
83
- # 5. Run the app
84
- streamlit run app.py
85
- </pre>
86
-
87
- <h2>Supported Document Formats</h2>
88
-
89
- <ul>
90
- <li>PDF (.pdf)</li>
91
- <li>Markdown (.md)</li>
92
- <li>Plain text (.txt)</li>
93
- <li>Future: Word, PowerPoint, Confluence export</li>
94
- </ul>
95
-
96
- <h2>System Requirements</h2>
97
-
98
- <ul>
99
- <li>8GB RAM minimum (16GB recommended)</li>
100
- <li>10GB disk space for models and indexes</li>
101
- <li>macOS, Linux, or Windows (WSL2)</li>
102
- </ul>
103
-
104
- <h2>Privacy & Security</h2>
105
-
106
- <ul>
107
- <li>No internet connection required after model download</li>
108
- <li>All data stays on your device</li>
109
- <li>Open-source code for review and customization</li>
110
- <li>No telemetry or logging by default</li>
111
- </ul>
112
-
113
- <div class="back">
114
- <a href="index.html">← Back to Main Design</a>
115
- </div>
116
-
117
- </body>
118
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
index.html CHANGED
The diff for this file is too large to render. See raw diff
 
page-02.html ADDED
@@ -0,0 +1,799 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>VaultRAG β€” The Problem</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap" rel="stylesheet">
10
+ <style>
11
+ :root {
12
+ --steel-900: #0e1117;
13
+ --steel-800: #161c27;
14
+ --steel-700: #1e2535;
15
+ --steel-600: #262f42;
16
+ --steel-500: #344057;
17
+ --steel-400: #4a5568;
18
+ --steel-300: #718096;
19
+ --steel-200: #a0aec0;
20
+ --steel-100: #cbd5e0;
21
+ --steel-50: #e8edf5;
22
+ --amber-500: #f59e0b;
23
+ --amber-400: #fbbf24;
24
+ --amber-300: #fcd34d;
25
+ --amber-600: #d97706;
26
+ --danger: #ef4444;
27
+ --danger-dim: rgba(239,68,68,0.12);
28
+ --success: #10b981;
29
+ --info: #3b82f6;
30
+ --font-display: 'Barlow Condensed', sans-serif;
31
+ --font-body: 'Barlow', sans-serif;
32
+ --font-mono: 'JetBrains Mono', monospace;
33
+ }
34
+
35
+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
36
+ html { scroll-behavior: smooth; }
37
+
38
+ body {
39
+ background: var(--steel-900);
40
+ color: var(--steel-100);
41
+ font-family: var(--font-body);
42
+ font-size: 17px;
43
+ line-height: 1.7;
44
+ overflow-x: hidden;
45
+ }
46
+
47
+ body::before {
48
+ content: '';
49
+ position: fixed; inset: 0;
50
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
51
+ pointer-events: none; z-index: 0; opacity: 0.4;
52
+ }
53
+
54
+ /* NAV */
55
+ nav {
56
+ position: fixed; top: 0; left: 0; right: 0; z-index: 100;
57
+ display: flex; align-items: center; justify-content: space-between;
58
+ padding: 0 48px; height: 64px;
59
+ background: rgba(14,17,23,0.92); backdrop-filter: blur(12px);
60
+ border-bottom: 1px solid rgba(245,158,11,0.15);
61
+ }
62
+ .nav-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: 0.08em; color: var(--amber-400); text-decoration: none; }
63
+ .nav-brand span { color: var(--steel-300); font-weight: 300; }
64
+ nav ul { display: flex; gap: 28px; list-style: none; }
65
+ nav a { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel-300); text-decoration: none; transition: color 0.2s; }
66
+ nav a:hover, nav a.active { color: var(--amber-400); }
67
+ .nav-github { color: var(--amber-400) !important; border: 1px solid var(--amber-500); padding: 6px 14px; border-radius: 2px; transition: background 0.2s !important; }
68
+ .nav-github:hover { background: var(--amber-500) !important; color: var(--steel-900) !important; }
69
+
70
+ /* PAGE HEADER */
71
+ .page-header {
72
+ padding: 120px 48px 64px;
73
+ position: relative; z-index: 1;
74
+ border-bottom: 1px solid var(--steel-700);
75
+ background: linear-gradient(180deg, rgba(239,68,68,0.04) 0%, transparent 100%);
76
+ }
77
+ .page-header::after {
78
+ content: '';
79
+ position: absolute; inset: 0;
80
+ background-image: linear-gradient(rgba(239,68,68,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(239,68,68,0.03) 1px, transparent 1px);
81
+ background-size: 60px 60px; pointer-events: none;
82
+ }
83
+ .breadcrumb {
84
+ font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.15em;
85
+ text-transform: uppercase; color: var(--steel-400); margin-bottom: 20px;
86
+ display: flex; align-items: center; gap: 8px;
87
+ }
88
+ .breadcrumb a { color: var(--steel-400); text-decoration: none; transition: color 0.2s; }
89
+ .breadcrumb a:hover { color: var(--amber-400); }
90
+ .breadcrumb span { color: var(--steel-600); }
91
+ .page-number { font-family: var(--font-display); font-size: 7rem; font-weight: 800; color: rgba(239,68,68,0.08); line-height: 1; position: absolute; right: 48px; top: 80px; letter-spacing: -0.02em; pointer-events: none; }
92
+ .page-title { font-family: var(--font-display); font-size: clamp(3rem, 6vw, 5.5rem); font-weight: 800; line-height: 0.95; margin-bottom: 24px; max-width: 800px; }
93
+ .page-title em { font-style: italic; font-weight: 300; color: var(--danger); }
94
+ .page-intro { font-size: 1.05rem; color: var(--steel-200); max-width: 700px; line-height: 1.8; }
95
+
96
+ /* SECTION */
97
+ section { position: relative; z-index: 1; padding: 80px 48px; }
98
+ section + section { border-top: 1px solid var(--steel-800); }
99
+
100
+ .section-label {
101
+ font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.2em;
102
+ text-transform: uppercase; color: var(--amber-500); margin-bottom: 16px;
103
+ display: flex; align-items: center; gap: 12px;
104
+ }
105
+ .section-label::after { content: ''; flex: 1; max-width: 60px; height: 1px; background: var(--amber-600); }
106
+ .section-title { font-family: var(--font-display); font-size: clamp(2rem, 3.5vw, 2.8rem); font-weight: 700; line-height: 1.1; margin-bottom: 16px; color: #fff; }
107
+ .section-title em { font-style: italic; font-weight: 300; color: var(--amber-400); }
108
+ .section-intro { font-size: 1rem; color: var(--steel-200); max-width: 700px; line-height: 1.8; margin-bottom: 56px; }
109
+
110
+ /* STAT GRID */
111
+ .stat-grid {
112
+ display: grid; grid-template-columns: repeat(4, 1fr);
113
+ gap: 2px; background: var(--steel-700);
114
+ border-radius: 4px; overflow: hidden; margin-bottom: 64px;
115
+ }
116
+ .stat-card {
117
+ background: var(--steel-800); padding: 32px 24px;
118
+ position: relative; overflow: hidden; transition: background 0.3s;
119
+ }
120
+ .stat-card:hover { background: var(--steel-700); }
121
+ .stat-card::before {
122
+ content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
123
+ background: var(--danger); transform: scaleX(0); transform-origin: left; transition: transform 0.4s;
124
+ }
125
+ .stat-card:hover::before { transform: scaleX(1); }
126
+ .stat-value { font-family: var(--font-display); font-size: 2.8rem; font-weight: 800; color: var(--danger); line-height: 1; margin-bottom: 8px; }
127
+ .stat-value.amber { color: var(--amber-400); }
128
+ .stat-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel-300); margin-bottom: 6px; }
129
+ .stat-desc { font-size: 0.82rem; color: var(--steel-400); line-height: 1.5; }
130
+ .stat-source { font-family: var(--font-mono); font-size: 0.6rem; color: var(--steel-500); margin-top: 10px; }
131
+ .stat-source a { color: var(--steel-400); text-decoration: none; }
132
+ .stat-source a:hover { color: var(--amber-400); }
133
+
134
+ /* NARRATIVE PROSE */
135
+ .narrative-prose {
136
+ display: grid; grid-template-columns: 1fr 1fr;
137
+ gap: 2px; background: var(--steel-700);
138
+ border-radius: 4px; overflow: hidden; margin-bottom: 64px;
139
+ }
140
+ .prose-panel {
141
+ background: var(--steel-800); padding: 48px 44px;
142
+ position: relative;
143
+ }
144
+ .prose-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
145
+ .prose-panel.business::before { background: var(--amber-500); }
146
+ .prose-panel.human::before { background: var(--danger); }
147
+ .prose-type { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
148
+ .prose-panel.business .prose-type { color: var(--amber-500); }
149
+ .prose-panel.human .prose-type { color: var(--danger); }
150
+ .prose-type::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
151
+ .prose-panel.business .prose-type::before { background: var(--amber-500); box-shadow: 0 0 6px var(--amber-500); }
152
+ .prose-panel.human .prose-type::before { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
153
+ .prose-panel h3 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: #fff; margin-bottom: 24px; line-height: 1.15; }
154
+ .prose-panel p { font-size: 0.95rem; color: var(--steel-200); line-height: 1.85; margin-bottom: 18px; }
155
+ .prose-panel p:last-of-type { margin-bottom: 0; }
156
+ .prose-highlight { background: rgba(245,158,11,0.07); border-left: 3px solid var(--amber-500); padding: 16px 20px; border-radius: 0 3px 3px 0; margin: 24px 0; font-size: 0.92rem; color: var(--steel-100); line-height: 1.7; font-style: italic; }
157
+ .prose-panel.human .prose-highlight { background: rgba(239,68,68,0.07); border-color: var(--danger); }
158
+
159
+ /* PAIN POINTS */
160
+ .pain-grid {
161
+ display: grid; grid-template-columns: 1fr 1fr;
162
+ gap: 2px; background: var(--steel-700);
163
+ border-radius: 4px; overflow: hidden;
164
+ }
165
+ .pain-card { background: var(--steel-800); padding: 36px 32px; transition: background 0.3s; }
166
+ .pain-card:hover { background: var(--steel-700); }
167
+ .pain-number { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.2em; color: var(--danger); text-transform: uppercase; margin-bottom: 12px; }
168
+ .pain-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: #fff; margin-bottom: 12px; line-height: 1.2; }
169
+ .pain-body { font-size: 0.9rem; color: var(--steel-200); line-height: 1.75; margin-bottom: 16px; }
170
+ .pain-tag { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--danger); border: 1px solid rgba(239,68,68,0.3); padding: 4px 10px; border-radius: 2px; display: inline-block; }
171
+
172
+ /* DAY IN THE LIFE β€” TIMELINE */
173
+ .timeline { position: relative; padding-left: 40px; margin-bottom: 64px; }
174
+ .timeline::before {
175
+ content: ''; position: absolute; left: 12px; top: 0; bottom: 0;
176
+ width: 2px; background: linear-gradient(180deg, var(--amber-600), var(--danger), var(--steel-600));
177
+ }
178
+ .timeline-item { position: relative; margin-bottom: 40px; }
179
+ .timeline-dot {
180
+ position: absolute; left: -34px; top: 4px;
181
+ width: 12px; height: 12px; border-radius: 50%;
182
+ background: var(--steel-700); border: 2px solid var(--amber-600);
183
+ transition: border-color 0.3s, background 0.3s;
184
+ }
185
+ .timeline-item:hover .timeline-dot { background: var(--amber-600); border-color: var(--amber-400); }
186
+ .timeline-item.critical .timeline-dot { border-color: var(--danger); background: rgba(239,68,68,0.2); }
187
+ .timeline-item.critical:hover .timeline-dot { background: var(--danger); }
188
+ .timeline-time { font-family: var(--font-mono); font-size: 0.65rem; color: var(--amber-600); letter-spacing: 0.1em; margin-bottom: 4px; }
189
+ .timeline-item.critical .timeline-time { color: var(--danger); }
190
+ .timeline-event { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: #fff; margin-bottom: 6px; }
191
+ .timeline-detail { font-size: 0.88rem; color: var(--steel-300); line-height: 1.65; }
192
+ .timeline-cost { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-family: var(--font-mono); font-size: 0.7rem; color: var(--danger); padding: 5px 10px; border: 1px solid rgba(239,68,68,0.3); border-radius: 2px; background: rgba(239,68,68,0.05); }
193
+
194
+ /* COST MODEL TABLE */
195
+ .cost-table-wrap {
196
+ background: var(--steel-800); border: 1px solid var(--steel-600);
197
+ border-radius: 4px; overflow: hidden; margin-bottom: 48px;
198
+ }
199
+ .cost-table-header {
200
+ padding: 20px 28px; background: var(--steel-700);
201
+ font-family: var(--font-mono); font-size: 0.68rem;
202
+ letter-spacing: 0.15em; text-transform: uppercase;
203
+ color: var(--amber-400); border-bottom: 1px solid var(--steel-600);
204
+ display: flex; justify-content: space-between; align-items: center;
205
+ }
206
+ table { width: 100%; border-collapse: collapse; }
207
+ th {
208
+ background: var(--steel-700); padding: 14px 24px; text-align: left;
209
+ font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em;
210
+ text-transform: uppercase; color: var(--steel-300);
211
+ border-bottom: 1px solid var(--steel-600);
212
+ }
213
+ td { padding: 14px 24px; border-bottom: 1px solid rgba(38,47,66,0.8); font-size: 0.88rem; color: var(--steel-200); vertical-align: top; }
214
+ tr:last-child td { border-bottom: none; }
215
+ tr:hover td { background: rgba(38,47,66,0.4); }
216
+ .td-value { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--danger); }
217
+ .td-value.amber { color: var(--amber-400); }
218
+ .td-source { font-family: var(--font-mono); font-size: 0.62rem; color: var(--steel-500); }
219
+ .td-source a { color: var(--steel-400); text-decoration: none; }
220
+ .td-source a:hover { color: var(--amber-400); }
221
+
222
+ /* COST CALC BOX */
223
+ .cost-calc {
224
+ background: var(--steel-700); border: 1px solid var(--steel-500);
225
+ border-left: 4px solid var(--amber-500);
226
+ border-radius: 3px; padding: 32px 36px; margin-bottom: 40px;
227
+ }
228
+ .cost-calc-title { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--amber-500); margin-bottom: 20px; }
229
+ .cost-formula { display: grid; grid-template-columns: repeat(3, auto); align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
230
+ .cost-term { text-align: center; }
231
+ .cost-term-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--amber-400); line-height: 1; }
232
+ .cost-term-label { font-family: var(--font-mono); font-size: 0.6rem; color: var(--steel-300); margin-top: 4px; letter-spacing: 0.1em; text-transform: uppercase; }
233
+ .cost-operator { font-family: var(--font-display); font-size: 1.8rem; color: var(--steel-500); }
234
+ .cost-result { padding: 20px 28px; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); border-radius: 3px; margin-top: 8px; }
235
+ .cost-result-value { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; color: var(--danger); line-height: 1; }
236
+ .cost-result-label { font-size: 0.85rem; color: var(--steel-300); margin-top: 6px; }
237
+ .cost-result-source { font-family: var(--font-mono); font-size: 0.6rem; color: var(--steel-500); margin-top: 8px; }
238
+ .cost-result-source a { color: var(--steel-400); text-decoration: none; }
239
+
240
+ /* IMPACT DIAGRAM SVG WRAPPER */
241
+ .impact-diagram { background: var(--steel-800); border: 1px solid var(--steel-600); border-radius: 6px; padding: 40px; margin-bottom: 64px; overflow: hidden; }
242
+ .diagram-title { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--steel-300); margin-bottom: 32px; display: flex; align-items: center; gap: 12px; }
243
+ .diagram-title::before { content: ''; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; box-shadow: 0 0 8px var(--danger); }
244
+
245
+ /* SOLUTION BRIDGE */
246
+ .solution-bridge {
247
+ background: var(--steel-700); border: 1px solid var(--steel-500);
248
+ border-radius: 4px; padding: 40px; margin-top: 64px;
249
+ display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center;
250
+ }
251
+ .bridge-side { }
252
+ .bridge-side-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 12px; }
253
+ .bridge-side.before .bridge-side-label { color: var(--danger); }
254
+ .bridge-side.after .bridge-side-label { color: var(--success); }
255
+ .bridge-side h4 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
256
+ .bridge-side p { font-size: 0.88rem; color: var(--steel-300); line-height: 1.65; }
257
+ .bridge-arrow { font-size: 2rem; color: var(--amber-500); text-align: center; }
258
+ .bridge-tag { display: inline-block; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; padding: 4px 10px; border-radius: 2px; margin-top: 10px; }
259
+ .bridge-side.before .bridge-tag { color: var(--danger); border: 1px solid rgba(239,68,68,0.3); background: rgba(239,68,68,0.06); }
260
+ .bridge-side.after .bridge-tag { color: var(--success); border: 1px solid rgba(16,185,129,0.3); background: rgba(16,185,129,0.06); }
261
+
262
+ /* NAV PAGINATION */
263
+ .page-nav { display: flex; justify-content: space-between; align-items: center; padding: 40px 48px; border-top: 1px solid var(--steel-700); }
264
+ .page-nav-link { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; color: var(--steel-300); display: flex; flex-direction: column; gap: 6px; transition: color 0.2s; }
265
+ .page-nav-link:hover { color: var(--amber-400); }
266
+ .page-nav-label { font-size: 0.6rem; color: var(--steel-500); }
267
+ .page-nav-link.next { text-align: right; }
268
+ .btn { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; padding: 12px 24px; border-radius: 2px; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; }
269
+ .btn-primary { background: var(--amber-500); color: var(--steel-900); font-weight: 700; }
270
+ .btn-primary:hover { background: var(--amber-400); }
271
+
272
+ /* SCROLL REVEAL */
273
+ .scroll-reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s, transform 0.7s; }
274
+ .scroll-reveal.visible { opacity: 1; transform: translateY(0); }
275
+
276
+ footer { padding: 40px 48px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--steel-800); }
277
+ footer p { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; color: var(--steel-500); text-transform: uppercase; }
278
+ footer a { color: var(--steel-400); text-decoration: none; transition: color 0.2s; }
279
+ footer a:hover { color: var(--amber-400); }
280
+
281
+ @media (max-width: 900px) {
282
+ nav { padding: 0 24px; }
283
+ nav ul { display: none; }
284
+ .page-header { padding: 100px 24px 48px; }
285
+ .page-number { display: none; }
286
+ section { padding: 56px 24px; }
287
+ .stat-grid { grid-template-columns: repeat(2, 1fr); }
288
+ .narrative-prose, .pain-grid { grid-template-columns: 1fr; }
289
+ .cost-formula { grid-template-columns: 1fr; }
290
+ .solution-bridge { grid-template-columns: 1fr; }
291
+ .bridge-arrow { transform: rotate(90deg); }
292
+ .page-nav { padding: 28px 24px; }
293
+ footer { padding: 28px 24px; flex-direction: column; gap: 12px; text-align: center; }
294
+ }
295
+ </style>
296
+ </head>
297
+ <body>
298
+
299
+ <!-- NAV -->
300
+ <nav>
301
+ <a class="nav-brand" href="index.html">VAULT<span>RAG</span></a>
302
+ <ul>
303
+ <li><a href="index.html">Overview</a></li>
304
+ <li><a href="page-02.html" class="active">The Problem</a></li>
305
+ <li><a href="page-03.html">Architecture</a></li>
306
+ <li><a href="page-04.html">Simulator</a></li>
307
+ <li><a href="page-05.html">Cost Model</a></li>
308
+ <li><a href="page-06.html">Roadmap</a></li>
309
+ <li><a href="https://github.com/raosiddharthp/VaultRAG" class="nav-github">GitHub β†’</a></li>
310
+ </ul>
311
+ </nav>
312
+
313
+ <!-- PAGE HEADER -->
314
+ <div class="page-header">
315
+ <div class="page-number">02</div>
316
+ <div class="breadcrumb">
317
+ <a href="index.html">VaultRAG</a>
318
+ <span>/</span>
319
+ <span>Page 02</span>
320
+ <span>/</span>
321
+ <span>The Problem</span>
322
+ </div>
323
+ <h1 class="page-title">
324
+ 12,000 pages of answers.<br>
325
+ <em>Nobody can ask the question.</em>
326
+ </h1>
327
+ <p class="page-intro">
328
+ Every manufacturing facility has the same problem expressed two ways: a business problem measured in downtime costs and productivity loss, and a human problem measured in frustration, delay, and physical risk. This page documents both β€” with sources.
329
+ </p>
330
+ </div>
331
+
332
+ <!-- ══ 01 THE SCALE ══ -->
333
+ <section>
334
+ <div class="section-label">01 β€” The Scale</div>
335
+ <h2 class="section-title">The numbers are <em>not subtle.</em></h2>
336
+ <p class="section-intro">These are not projections. They are the present state of manufacturing operations globally β€” the documented cost of a workforce that cannot access the knowledge sitting on its own servers.</p>
337
+
338
+ <div class="stat-grid scroll-reveal">
339
+ <div class="stat-card">
340
+ <div class="stat-value">$260K</div>
341
+ <div class="stat-label">Per Hour Β· Downtime Cost</div>
342
+ <div class="stat-desc">Average cost of unplanned downtime in general manufacturing. Automotive facilities face losses up to $2.3M/hr.</div>
343
+ <div class="stat-source">β†— <a href="https://oxmaint.com/industries/manufacturing-plant/unplanned-downtime-costs-253m-annually-manufacturing-prevent" target="_blank">Aberdeen Group via Oxmaint, 2024</a></div>
344
+ </div>
345
+ <div class="stat-card">
346
+ <div class="stat-value">800hrs</div>
347
+ <div class="stat-label">Per Year Β· Unplanned Downtime</div>
348
+ <div class="stat-desc">Average unplanned downtime the typical manufacturer faces annually β€” equivalent to 15 hours every single week.</div>
349
+ <div class="stat-source">β†— <a href="https://assets.new.siemens.com/siemens/assets/api/uuid:1b43afb5-2d07-47f7-9eb7-893fe7d0bc59/TCOD-2024_original.pdf" target="_blank">Siemens True Cost of Downtime, 2024</a></div>
350
+ </div>
351
+ <div class="stat-card">
352
+ <div class="stat-value">23%</div>
353
+ <div class="stat-label">Of Downtime Β· Human Error</div>
354
+ <div class="stat-desc">Nearly a quarter of all unplanned manufacturing stoppages are caused by human error on the shop floor β€” including wrong procedures.</div>
355
+ <div class="stat-source">β†— <a href="https://pluto-men.com/human-error-persistent-challenge-manufacturing-operations/" target="_blank">Plutomen / ABB, 2024</a></div>
356
+ </div>
357
+ <div class="stat-card">
358
+ <div class="stat-value amber">1.8hrs</div>
359
+ <div class="stat-label">Per Day Β· Information Search</div>
360
+ <div class="stat-desc">Average time employees spend searching for and gathering information each working day β€” nearly 25% of the working week.</div>
361
+ <div class="stat-source">β†— <a href="https://copernic.com/en/2025/03/21/the-hidden-costs-of-poor-document-search-how-much-time-is-your-business-wasting/" target="_blank">McKinsey Global Institute via Copernic, 2025</a></div>
362
+ </div>
363
+ <div class="stat-card">
364
+ <div class="stat-value">80%</div>
365
+ <div class="stat-label">Of Defects Β· Human Cause</div>
366
+ <div class="stat-desc">Studies show 80% of manufacturing defects originate from human mistakes β€” many traceable to incorrect or misremembered procedures.</div>
367
+ <div class="stat-source">β†— <a href="https://pluto-men.com/human-error-persistent-challenge-manufacturing-operations/" target="_blank">Plutomen / DoD HFACS, 2024</a></div>
368
+ </div>
369
+ <div class="stat-card">
370
+ <div class="stat-value">33%</div>
371
+ <div class="stat-label">Of Quality Problems Β· Human Error</div>
372
+ <div class="stat-desc">One in three quality-related manufacturing problems is attributable to human error β€” scrap, rework, defective output.</div>
373
+ <div class="stat-source">β†— <a href="https://www.orcalean.com/article/common-pitfalls-in-work-instructions-that-lead-to-human-error-and-how-to-avoid-them" target="_blank">American Society for Quality (ASQ)</a></div>
374
+ </div>
375
+ <div class="stat-card">
376
+ <div class="stat-value">$1.4T</div>
377
+ <div class="stat-label">Per Year Β· Global Downtime Loss</div>
378
+ <div class="stat-desc">The world's 500 largest manufacturers collectively lose $1.4 trillion annually to unplanned downtime β€” 11% of total revenues.</div>
379
+ <div class="stat-source">β†— <a href="https://assets.new.siemens.com/siemens/assets/api/uuid:1b43afb5-2d07-47f7-9eb7-893fe7d0bc59/TCOD-2024_original.pdf" target="_blank">Siemens True Cost of Downtime, 2024</a></div>
380
+ </div>
381
+ <div class="stat-card">
382
+ <div class="stat-value amber">18min</div>
383
+ <div class="stat-label">Per Document Β· Search Time</div>
384
+ <div class="stat-desc">Gartner research indicates it takes an average of 18 minutes to locate a single document β€” in a noisy, time-pressured factory context, it is longer.</div>
385
+ <div class="stat-source">β†— <a href="https://m-files.com/resources/en-hub/rt-main-blog-en/how-long-does-it-actually-take-to-find-a-document-dissecting-the-many-stats-out-there" target="_blank">Gartner via M-Files, 2025</a></div>
386
+ </div>
387
+ </div>
388
+
389
+ <!-- IMPACT DIAGRAM -->
390
+ <div class="impact-diagram scroll-reveal">
391
+ <div class="diagram-title">The Compounding Failure Chain β€” from missed procedure to financial impact</div>
392
+ <svg viewBox="0 0 960 200" xmlns="http://www.w3.org/2000/svg" font-family="'JetBrains Mono',monospace" width="100%">
393
+ <defs>
394
+ <marker id="arr" markerWidth="8" markerHeight="8" refX="6" refY="3" orient="auto">
395
+ <path d="M0,0 L0,6 L8,3 z" fill="#f59e0b" opacity="0.8"/>
396
+ </marker>
397
+ </defs>
398
+ <!-- Nodes -->
399
+ <!-- 1: Machine fault -->
400
+ <rect x="10" y="60" width="130" height="70" rx="3" fill="#1e2535" stroke="#344057"/>
401
+ <text x="75" y="88" text-anchor="middle" font-size="8" fill="#ef4444" letter-spacing="1">TRIGGER</text>
402
+ <text x="75" y="103" text-anchor="middle" font-size="9" fill="#e2e8f0">Machine</text>
403
+ <text x="75" y="116" text-anchor="middle" font-size="9" fill="#e2e8f0">fault occurs</text>
404
+
405
+ <!-- 2: Technician searches -->
406
+ <rect x="170" y="60" width="130" height="70" rx="3" fill="#1e2535" stroke="#ef4444" stroke-opacity="0.4"/>
407
+ <text x="235" y="88" text-anchor="middle" font-size="8" fill="#ef4444" letter-spacing="1">DELAY</text>
408
+ <text x="235" y="103" text-anchor="middle" font-size="9" fill="#e2e8f0">Technician</text>
409
+ <text x="235" y="116" text-anchor="middle" font-size="9" fill="#e2e8f0">searches manual</text>
410
+
411
+ <!-- 3: Wrong info -->
412
+ <rect x="330" y="60" width="130" height="70" rx="3" fill="#1e2535" stroke="#ef4444" stroke-opacity="0.6"/>
413
+ <text x="395" y="88" text-anchor="middle" font-size="8" fill="#ef4444" letter-spacing="1">ERROR</text>
414
+ <text x="395" y="103" text-anchor="middle" font-size="9" fill="#e2e8f0">Wrong or</text>
415
+ <text x="395" y="116" text-anchor="middle" font-size="9" fill="#e2e8f0">incomplete info</text>
416
+
417
+ <!-- 4: Wrong procedure -->
418
+ <rect x="490" y="60" width="130" height="70" rx="3" fill="#1e2535" stroke="#ef4444" stroke-opacity="0.8"/>
419
+ <text x="555" y="88" text-anchor="middle" font-size="8" fill="#ef4444" letter-spacing="1">COMPOUND</text>
420
+ <text x="555" y="103" text-anchor="middle" font-size="9" fill="#e2e8f0">Wrong procedure</text>
421
+ <text x="555" y="116" text-anchor="middle" font-size="9" fill="#e2e8f0">applied</text>
422
+
423
+ <!-- 5: Extended downtime -->
424
+ <rect x="650" y="60" width="130" height="70" rx="3" fill="#1e2535" stroke="#ef4444"/>
425
+ <text x="715" y="88" text-anchor="middle" font-size="8" fill="#ef4444" letter-spacing="1">EXTENDED</text>
426
+ <text x="715" y="103" text-anchor="middle" font-size="9" fill="#e2e8f0">Fault recurrs</text>
427
+ <text x="715" y="116" text-anchor="middle" font-size="9" fill="#e2e8f0">or worsens</text>
428
+
429
+ <!-- 6: Cost -->
430
+ <rect x="810" y="50" width="140" height="90" rx="3" fill="#1e2535" stroke="#ef4444" stroke-width="1.5"/>
431
+ <text x="880" y="78" text-anchor="middle" font-size="8" fill="#ef4444" letter-spacing="1">FINANCIAL IMPACT</text>
432
+ <text x="880" y="96" text-anchor="middle" font-size="14" font-weight="700" fill="#ef4444" font-family="'Barlow Condensed'">$260K/hr</text>
433
+ <text x="880" y="112" text-anchor="middle" font-size="7.5" fill="#718096">+ NCR costs</text>
434
+ <text x="880" y="125" text-anchor="middle" font-size="7.5" fill="#718096">+ rework + safety risk</text>
435
+
436
+ <!-- Arrows -->
437
+ <line x1="140" y1="95" x2="170" y2="95" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arr)"/>
438
+ <line x1="300" y1="95" x2="330" y2="95" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arr)"/>
439
+ <line x1="460" y1="95" x2="490" y2="95" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arr)"/>
440
+ <line x1="620" y1="95" x2="650" y2="95" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arr)"/>
441
+ <line x1="780" y1="95" x2="810" y2="95" stroke="#ef4444" stroke-width="2" marker-end="url(#arr)"/>
442
+
443
+ <!-- Time labels below -->
444
+ <text x="235" y="155" text-anchor="middle" font-size="7.5" fill="#718096">avg. 18 min search</text>
445
+ <text x="395" y="155" text-anchor="middle" font-size="7.5" fill="#718096">colleague memory</text>
446
+ <text x="555" y="155" text-anchor="middle" font-size="7.5" fill="#718096">fault "cleared"</text>
447
+ <text x="715" y="155" text-anchor="middle" font-size="7.5" fill="#718096">NCR logged Friday</text>
448
+ <text x="880" y="165" text-anchor="middle" font-size="7" fill="#4a5568">per Aberdeen Group</text>
449
+ </svg>
450
+ </div>
451
+ </section>
452
+
453
+ <!-- ══ 02 TWO NARRATIVES ══ -->
454
+ <section>
455
+ <div class="section-label">02 β€” Two Narratives</div>
456
+ <h2 class="section-title">One broken system. <em>Two ways to see it.</em></h2>
457
+ <p class="section-intro">The same absent infrastructure shows up differently depending on where you sit. The business analyst sees it in a P&L. The technician feels it in their hands.</p>
458
+
459
+ <div class="narrative-prose scroll-reveal">
460
+
461
+ <!-- BUSINESS -->
462
+ <div class="prose-panel business">
463
+ <div class="prose-type">The Business Problem</div>
464
+ <h3>Proprietary knowledge trapped in documents no system can query securely</h3>
465
+ <p>The average mid-size manufacturer maintains between 12,000 and 40,000 pages of technical documentation. Equipment manuals. ISO-controlled SOPs. Non-conformance reports. Calibration records. Maintenance logs. Lockout/tagout procedures. Every one of these documents was written, reviewed, approved, and stored precisely so that the right person could access the right information at the right moment.</p>
466
+ <p>In practice, that information lives on a network drive organised by whoever set it up in 2011. Or in a binder on a shelf by the supervisor's desk. Or in the heads of the engineers who wrote it and have since retired. The documentation infrastructure is extensive. The retrieval infrastructure is non-existent.</p>
467
+ <div class="prose-highlight">
468
+ "Over 80% of manufacturers cannot accurately calculate their true downtime costs. This visibility gap allows hidden expenses to accumulate unnoticed, making unplanned downtime one of the most underestimated threats to manufacturing profitability."
469
+ <div style="font-family: var(--font-mono); font-size: 0.62rem; color: var(--steel-400); margin-top: 8px;">β†— iFactory, 2025</div>
470
+ </div>
471
+ <p>Cloud-based RAG tools β€” the obvious solution β€” are architecturally incompatible with this environment. Aerospace, automotive, and defence supply chain manufacturers routinely operate under NDA clauses, ITAR restrictions, and ISO 27001 requirements that prohibit sending proprietary process data to third-party APIs. The very tool that could solve the retrieval problem cannot be used in the environments where the problem is most severe.</p>
472
+ <p>The result is a permanent tax on operational efficiency β€” every hour a line is down, every wrong procedure applied, every near-miss generated by a technician working from memory because the right document was 40 metres and 3 minutes away.</p>
473
+ </div>
474
+
475
+ <!-- HUMAN -->
476
+ <div class="prose-panel human">
477
+ <div class="prose-type">The Human Problem</div>
478
+ <h3>A technician who cannot afford to be wrong, and cannot afford to wait</h3>
479
+ <p>Marcus has worked the floor for eleven years. He knows most of the machines by sound. At 07:14 on a Tuesday, the Haas CNC on Line 3 throws an E-04 fault. The line stops. His phone has no signal strong enough for an internet search. The manual is a 380-page PDF on a laptop in the supervisor's office, forty metres away, and the supervisor is in a shift briefing.</p>
480
+ <p>He asks Priya. Priya remembers something about the spindle cooling circuit from a training session eighteen months ago. They try the procedure she remembers. The fault clears. The line restarts at 07:31. Seventeen minutes of downtime.</p>
481
+ <div class="prose-highlight">
482
+ At $260,000 per hour of downtime, seventeen minutes costs the facility approximately $73,700 β€” before rework, before the NCR, before the quality review that will follow when the same fault returns at 09:48.
483
+ <div style="font-family: var(--font-mono); font-size: 0.62rem; color: rgba(239,68,68,0.7); margin-top: 8px;">β†— Aberdeen Group cost model</div>
484
+ </div>
485
+ <p>The fault returns at 09:48 because Priya remembered most of the procedure correctly. The part she misremembered β€” the torque specification on the spindle bearing re-seat β€” was not the sort of thing a person retains from a training session. It was on page 247 of the manual. It would have taken VaultRAG 6 seconds to retrieve it.</p>
486
+ <p>This is not a story about an incompetent technician. It is a story about a capable, experienced professional who was given no tool adequate to the moment. The documentation existed. The knowledge existed. The infrastructure to connect them did not.</p>
487
+ </div>
488
+ </div>
489
+ </section>
490
+
491
+ <!-- ══ 03 PAIN POINTS ══ -->
492
+ <section>
493
+ <div class="section-label">03 β€” Pain Points</div>
494
+ <h2 class="section-title">Six ways the <em>current system fails</em> every day.</h2>
495
+ <p class="section-intro">These are not edge cases. They are the daily operational reality of a facility running without a knowledge retrieval system adequate to the floor.</p>
496
+
497
+ <div class="pain-grid scroll-reveal">
498
+ <div class="pain-card">
499
+ <div class="pain-number">Pain β€” 01</div>
500
+ <div class="pain-title">Documents exist. Retrieval does not.</div>
501
+ <p class="pain-body">Every piece of knowledge needed to run a facility is documented somewhere. The problem is never the absence of documentation β€” it is the absence of a system that can surface the right page, section, and step in under 10 seconds, from the floor, hands-free. Keyword search on a network drive is not that system.</p>
502
+ <span class="pain-tag">18 min avg. search time Β· Gartner</span>
503
+ </div>
504
+ <div class="pain-card">
505
+ <div class="pain-number">Pain β€” 02</div>
506
+ <div class="pain-title">Cloud RAG is architecturally excluded</div>
507
+ <p class="pain-body">OpenAI, Anthropic, and Google API-based RAG tools require sending document content to external servers. For manufacturers operating under ITAR, NDA clauses, ISO 27001, or internal data governance policies, this is a hard architectural incompatibility β€” not a preference. The most visible AI tools on the market cannot be used in the environments that need them most.</p>
508
+ <span class="pain-tag">ITAR Β· ISO 27001 Β· NDA exclusion</span>
509
+ </div>
510
+ <div class="pain-card">
511
+ <div class="pain-number">Pain β€” 03</div>
512
+ <div class="pain-title">Memory is not a procedure</div>
513
+ <p class="pain-body">Experienced technicians carry enormous procedural knowledge. They also misremember details under pressure, in noisy environments, under time constraint. The 23% of unplanned downtime caused by human error is not primarily caused by carelessness β€” it is caused by the gap between what a person remembers and what the document says. Those two things are not always the same.</p>
514
+ <span class="pain-tag">23% of downtime Β· ABB / Plutomen</span>
515
+ </div>
516
+ <div class="pain-card">
517
+ <div class="pain-number">Pain β€” 04</div>
518
+ <div class="pain-title">The interface assumes a desk</div>
519
+ <p class="pain-body">Every document management system, every enterprise search tool, every portal-based knowledge base was built for a person sitting in front of a screen. A maintenance technician on a live factory floor has one hand on the machine, is standing in 90dB of ambient noise, and needs an answer in under 10 seconds. No existing tool was designed for that context. Not one.</p>
520
+ <span class="pain-tag">Voice-first gap Β· Factory floor reality</span>
521
+ </div>
522
+ <div class="pain-card">
523
+ <div class="pain-number">Pain β€” 05</div>
524
+ <div class="pain-title">Wrong procedures compound, not resolve</div>
525
+ <p class="pain-body">An incorrect procedure does not always fail immediately. It often appears to work β€” the fault clears, the line restarts, the shift ends. The NCR surfaces days later. The root cause investigation finds the misapplied torque spec or the skipped verification step. By then, the machine has been running incorrectly for 48 hours and the damage is compounded. The most expensive errors are the ones that look like successes at the time.</p>
526
+ <span class="pain-tag">33% quality problems Β· ASQ</span>
527
+ </div>
528
+ <div class="pain-card">
529
+ <div class="pain-number">Pain β€” 06</div>
530
+ <div class="pain-title">Safety procedures are the highest-stakes retrieval</div>
531
+ <p class="pain-body">Lockout/tagout procedures, pressure vessel de-pressurisation sequences, electrical isolation steps, hazardous material handling protocols β€” these are the procedures where a misremembered step is not a quality issue, it is a safety incident. They are also the procedures most likely to be needed in a high-pressure, time-compressed situation. The stakes of retrieval failure are physical, not just financial.</p>
532
+ <span class="pain-tag">OSHA 29 CFR 1910.147 Β· LOTO</span>
533
+ </div>
534
+ </div>
535
+ </section>
536
+
537
+ <!-- ══ 04 A DAY IN THE LIFE ══ -->
538
+ <section>
539
+ <div class="section-label">04 β€” A Day in the Life</div>
540
+ <h2 class="section-title">Marcus's Tuesday. <em>Minute by minute.</em></h2>
541
+ <p class="section-intro">A composite of real maintenance shift patterns in mid-size manufacturing. Names are fictional. The costs are not.</p>
542
+
543
+ <div class="timeline scroll-reveal">
544
+ <div class="timeline-item">
545
+ <div class="timeline-dot"></div>
546
+ <div class="timeline-time">06:50</div>
547
+ <div class="timeline-event">Shift briefing β€” Line 3 CNC reported intermittent spindle noise overnight</div>
548
+ <div class="timeline-detail">Night shift flagged the issue verbally. No formal fault code recorded. The manual reference for intermittent spindle noise is Section 18.4 of the Haas VF-2SS service documentation β€” 380 pages, last updated in 2022, stored on the engineering laptop in the supervisor's office.</div>
549
+ </div>
550
+ <div class="timeline-item critical">
551
+ <div class="timeline-dot"></div>
552
+ <div class="timeline-time">07:14</div>
553
+ <div class="timeline-event">E-04 fault code β€” Line 3 stops</div>
554
+ <div class="timeline-detail">Fault appears mid-cycle. Line halts immediately. Marcus is on the floor. Phone signal is weak. The supervisor's laptop is in a briefing. He queries a colleague from memory.</div>
555
+ <div class="timeline-cost">⏱ Downtime clock starts · ~$4,333/min (Aberdeen Group)</div>
556
+ </div>
557
+ <div class="timeline-item">
558
+ <div class="timeline-dot"></div>
559
+ <div class="timeline-time">07:16 β€” 07:28</div>
560
+ <div class="timeline-event">Procedure reconstructed from memory and colleague recall</div>
561
+ <div class="timeline-detail">12 minutes. Cross-referencing between two technicians' recollections. The spindle bearing re-seat torque spec β€” 45 Nm β€” is misremembered as 40 Nm. The procedure is otherwise correct.</div>
562
+ </div>
563
+ <div class="timeline-item">
564
+ <div class="timeline-dot"></div>
565
+ <div class="timeline-time">07:31</div>
566
+ <div class="timeline-event">Fault cleared β€” line restarts</div>
567
+ <div class="timeline-detail">17 minutes of downtime. At $260,000/hr, the cost of this single incident is approximately $73,700. The line is running. The torque error is undetected.</div>
568
+ </div>
569
+ <div class="timeline-item critical">
570
+ <div class="timeline-dot"></div>
571
+ <div class="timeline-time">09:48</div>
572
+ <div class="timeline-event">E-04 returns β€” same fault, same line</div>
573
+ <div class="timeline-detail">The incorrectly torqued bearing has migrated under load. The fault returns, now with secondary spindle vibration. This is no longer a first-response procedure β€” it is a recurring incident. Maintenance now escalates to engineering. Another 34 minutes of downtime before root cause is identified.</div>
574
+ <div class="timeline-cost">⏱ Second stoppage · additional $147,400 at $260K/hr</div>
575
+ </div>
576
+ <div class="timeline-item">
577
+ <div class="timeline-dot"></div>
578
+ <div class="timeline-time">14:30</div>
579
+ <div class="timeline-event">NCR raised β€” quality review scheduled for Friday</div>
580
+ <div class="timeline-detail">Non-conformance report documents two unplanned stoppages, 51 total minutes of downtime, and an incorrect procedure application. The NCR will be reviewed in the Friday quality meeting. Root cause will be documented as "human error β€” incorrect torque application." The corrective action will be a retraining requirement.</div>
581
+ </div>
582
+ <div class="timeline-item">
583
+ <div class="timeline-dot"></div>
584
+ <div class="timeline-time">Total cost of this Tuesday</div>
585
+ <div class="timeline-event" style="color: var(--danger);">~$221,100 in downtime alone</div>
586
+ <div class="timeline-detail">51 minutes of unplanned downtime at $260,000/hr. Not including NCR processing costs, rework, engineering time, or the retraining that will be scheduled but never quite happen. The information that would have prevented it was on page 247 of the manual that was 40 metres away.</div>
587
+ <div class="timeline-cost">⏱ VaultRAG retrieval time for the torque spec: &lt; 6 seconds</div>
588
+ </div>
589
+ </div>
590
+ </section>
591
+
592
+ <!-- ══ 05 THE COST MODEL ══ -->
593
+ <section>
594
+ <div class="section-label">05 β€” The Cost Model</div>
595
+ <h2 class="section-title">What the <em>knowledge gap</em> actually costs.</h2>
596
+ <p class="section-intro">Every number below is sourced. This is not a speculative model β€” it is a synthesis of published research on manufacturing downtime, human error, and information retrieval costs.</p>
597
+
598
+ <!-- Cost Calc Box -->
599
+ <div class="cost-calc scroll-reveal">
600
+ <div class="cost-calc-title">Annual knowledge-gap cost Β· mid-size manufacturer Β· 500 employees Β· illustrative</div>
601
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px;">
602
+ <div>
603
+ <div style="font-family: var(--font-mono); font-size: 0.65rem; color: var(--steel-300); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.1em;">Downtime attributable to procedure errors</div>
604
+ <div style="display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;">
605
+ <span style="font-family: 'Barlow Condensed'; font-size: 1.6rem; font-weight: 700; color: var(--steel-100);">800 hrs/yr</span>
606
+ <span style="font-size: 0.8rem; color: var(--steel-400);">Γ— 23% human error rate</span>
607
+ <span style="font-size: 0.8rem; color: var(--steel-400);">= 184 hrs attributable</span>
608
+ </div>
609
+ <div style="font-family: var(--font-mono); font-size: 0.62rem; color: var(--steel-500); margin-top: 6px;">β†— Siemens 2024 + ABB / Plutomen 2024</div>
610
+ </div>
611
+ <div>
612
+ <div style="font-family: var(--font-mono); font-size: 0.65rem; color: var(--steel-300); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.1em;">Time cost of information search</div>
613
+ <div style="display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;">
614
+ <span style="font-family: 'Barlow Condensed'; font-size: 1.6rem; font-weight: 700; color: var(--steel-100);">1.8 hrs/day</span>
615
+ <span style="font-size: 0.8rem; color: var(--steel-400);">Γ— 500 workers Γ— 250 days</span>
616
+ <span style="font-size: 0.8rem; color: var(--steel-400);">= 225,000 hrs/yr</span>
617
+ </div>
618
+ <div style="font-family: var(--font-mono); font-size: 0.62rem; color: var(--steel-500); margin-top: 6px;">β†— McKinsey Global Institute via Copernic 2025</div>
619
+ </div>
620
+ </div>
621
+ <div class="cost-result">
622
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px;">
623
+ <div>
624
+ <div style="font-family: var(--font-mono); font-size: 0.62rem; color: var(--steel-400); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.1em;">Downtime cost (184 hrs Γ— $260K)</div>
625
+ <div class="cost-result-value">$47.8M</div>
626
+ <div class="cost-result-label">Annual downtime attributable to human error / wrong procedures</div>
627
+ <div class="cost-result-source">β†— <a href="https://oxmaint.com/industries/manufacturing-plant/unplanned-downtime-costs-253m-annually-manufacturing-prevent">Aberdeen Group cost basis</a></div>
628
+ </div>
629
+ <div>
630
+ <div style="font-family: var(--font-mono); font-size: 0.62rem; color: var(--steel-400); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.1em;">Search time cost (225K hrs Γ— $35/hr)</div>
631
+ <div class="cost-result-value" style="color: var(--amber-400);">$7.9M</div>
632
+ <div class="cost-result-label">Annual labour cost of information retrieval inefficiency</div>
633
+ <div class="cost-result-source">β†— <a href="https://copernic.com/en/2025/03/21/the-hidden-costs-of-poor-document-search-how-much-time-is-your-business-wasting/">McKinsey / Copernic cost basis</a></div>
634
+ </div>
635
+ </div>
636
+ </div>
637
+ </div>
638
+
639
+ <!-- Cost by sector table -->
640
+ <div class="cost-table-wrap scroll-reveal">
641
+ <div class="cost-table-header">
642
+ <span>Downtime cost by manufacturing sector β€” hourly rate (USD)</span>
643
+ <span style="color: var(--steel-400); font-size: 0.62rem;">Sources: Aberdeen Group Β· Siemens Β· ServiceMax</span>
644
+ </div>
645
+ <table>
646
+ <thead>
647
+ <tr>
648
+ <th>Sector</th>
649
+ <th>Hourly Downtime Cost</th>
650
+ <th>Avg. Incidents/Month</th>
651
+ <th>Avg. Duration</th>
652
+ <th>Source</th>
653
+ </tr>
654
+ </thead>
655
+ <tbody>
656
+ <tr>
657
+ <td>Automotive (OEM)</td>
658
+ <td><span class="td-value">$2.3M</span></td>
659
+ <td>25/month</td>
660
+ <td>~4 hrs avg.</td>
661
+ <td><span class="td-source"><a href="https://oxmaint.com/industries/manufacturing-plant/unplanned-downtime-costs-253m-annually-manufacturing-prevent" target="_blank">Aberdeen / Oxmaint 2024</a></span></td>
662
+ </tr>
663
+ <tr>
664
+ <td>General Manufacturing</td>
665
+ <td><span class="td-value">$260K</span></td>
666
+ <td>65% face monthly downtime</td>
667
+ <td>~4 hrs avg.</td>
668
+ <td><span class="td-source"><a href="https://oxmaint.com/industries/manufacturing-plant/unplanned-downtime-costs-253m-annually-manufacturing-prevent" target="_blank">Aberdeen Group</a></span></td>
669
+ </tr>
670
+ <tr>
671
+ <td>Mid-size Plant (any sector)</td>
672
+ <td><span class="td-value">$125K</span></td>
673
+ <td>2/3 experience monthly</td>
674
+ <td>~4 hrs avg.</td>
675
+ <td><span class="td-source"><a href="https://www.ismworld.org/supply-management-news-and-reports/news-publications/inside-supply-management-magazine/blog/2024/2024-08/the-monthly-metric-unscheduled-downtime/" target="_blank">ABB Value of Reliability 2024</a></span></td>
676
+ </tr>
677
+ <tr>
678
+ <td>Consumer Goods Manufacturing</td>
679
+ <td><span class="td-value amber">$39K</span></td>
680
+ <td>Variable</td>
681
+ <td>Variable</td>
682
+ <td><span class="td-source"><a href="https://us.sumitomodrive.com/sites/default/files/2025-04/cost-of-downtime.pdf" target="_blank">Sumitomo / Aberdeen 2025</a></span></td>
683
+ </tr>
684
+ <tr>
685
+ <td>All U.S. Manufacturing</td>
686
+ <td><span class="td-value">$50B/yr</span></td>
687
+ <td>800 hrs/yr avg.</td>
688
+ <td>Industry-wide</td>
689
+ <td><span class="td-source"><a href="https://www.teamsense.com/blog/cost-of-downtime-manufacturing" target="_blank">Forbes / TeamSense 2026</a></span></td>
690
+ </tr>
691
+ </tbody>
692
+ </table>
693
+ </div>
694
+
695
+ <!-- Human error breakdown table -->
696
+ <div class="cost-table-wrap scroll-reveal">
697
+ <div class="cost-table-header">
698
+ <span>Human error contribution to manufacturing losses β€” cited breakdown</span>
699
+ <span style="color: var(--steel-400); font-size: 0.62rem;">Sources: ASQ Β· NIST Β· Plutomen Β· Deloitte</span>
700
+ </div>
701
+ <table>
702
+ <thead>
703
+ <tr>
704
+ <th>Error Category</th>
705
+ <th>Proportion</th>
706
+ <th>Manifestation</th>
707
+ <th>Source</th>
708
+ </tr>
709
+ </thead>
710
+ <tbody>
711
+ <tr>
712
+ <td>Defects attributable to human mistakes</td>
713
+ <td><span class="td-value">80%</span></td>
714
+ <td>Incorrect assembly, calibration, procedure application</td>
715
+ <td><span class="td-source"><a href="https://pluto-men.com/human-error-persistent-challenge-manufacturing-operations/" target="_blank">Plutomen / DoD HFACS</a></span></td>
716
+ </tr>
717
+ <tr>
718
+ <td>Unplanned downtime caused by human error</td>
719
+ <td><span class="td-value">23%</span></td>
720
+ <td>Wrong procedures, missed maintenance steps</td>
721
+ <td><span class="td-source"><a href="https://www.docuclipper.com/blog/human-error-statistics/" target="_blank">ABB via DocuClipper 2025</a></span></td>
722
+ </tr>
723
+ <tr>
724
+ <td>Quality problems from human error</td>
725
+ <td><span class="td-value">33%</span></td>
726
+ <td>Scrap, rework, defective product</td>
727
+ <td><span class="td-source"><a href="https://www.orcalean.com/article/common-pitfalls-in-work-instructions-that-lead-to-human-error-and-how-to-avoid-them" target="_blank">American Society for Quality (ASQ)</a></span></td>
728
+ </tr>
729
+ <tr>
730
+ <td>Errors from procedures and training failures</td>
731
+ <td><span class="td-value amber">40%</span></td>
732
+ <td>Incorrect or missing procedural knowledge</td>
733
+ <td><span class="td-source"><a href="https://www.machinerylubrication.com/Read/23904/human-factors-engineering-reliability" target="_blank">DoD root cause analysis standard</a></span></td>
734
+ </tr>
735
+ <tr>
736
+ <td>Global manufacturing losses from human error</td>
737
+ <td><span class="td-value">$10B/yr</span></td>
738
+ <td>Direct financial impact across all sectors</td>
739
+ <td><span class="td-source"><a href="https://www.orcalean.com/article/common-pitfalls-in-work-instructions-that-lead-to-human-error-and-how-to-avoid-them" target="_blank">Deloitte study via Orca Lean</a></span></td>
740
+ </tr>
741
+ </tbody>
742
+ </table>
743
+ </div>
744
+ </section>
745
+
746
+ <!-- ══ 06 SOLUTION BRIDGE ══ -->
747
+ <section>
748
+ <div class="section-label">06 β€” The Bridge</div>
749
+ <h2 class="section-title">The gap is <em>infrastructure, not knowledge.</em></h2>
750
+ <p class="section-intro">The documents exist. The knowledge exists. The technician is capable. The only missing piece is a system that connects them β€” in under 10 seconds, from a phone, without sending a single byte outside the facility.</p>
751
+
752
+ <div class="solution-bridge scroll-reveal">
753
+ <div class="bridge-side before">
754
+ <div class="bridge-side-label">Right Now</div>
755
+ <h4>Manual retrieval under pressure</h4>
756
+ <p>A technician with a fault code, a noisy floor, a phone with weak signal, and a manual 40 metres away. Average resolution time: 18+ minutes. Error rate: 23% of downtime attributable to this gap. Cost: $260,000/hr.</p>
757
+ <div><span class="bridge-tag">18 min search Β· $260K/hr Β· NCR risk</span></div>
758
+ </div>
759
+ <div class="bridge-arrow">β†’</div>
760
+ <div class="bridge-side after">
761
+ <div class="bridge-side-label">With VaultRAG</div>
762
+ <h4>Voice query β†’ cited answer in &lt; 8 seconds</h4>
763
+ <p>The same technician speaks the fault code. VaultRAG queries the indexed manual, runs 5 guardrail checks, returns the exact procedure with section reference. On-prem. Zero exfiltration. Runs on plant WiFi.</p>
764
+ <div><span class="bridge-tag">&lt; 8s Β· cited Β· on-prem Β· zero exfiltration</span></div>
765
+ </div>
766
+ </div>
767
+
768
+ <div style="text-align:center; margin-top: 48px;">
769
+ <a href="page-03.html" class="btn btn-primary">How it's built β†’ Architecture</a>
770
+ </div>
771
+ </section>
772
+
773
+ <!-- PAGE NAV -->
774
+ <div class="page-nav">
775
+ <a class="page-nav-link" href="index.html">
776
+ <span class="page-nav-label">← Previous</span>
777
+ <span>Overview</span>
778
+ </a>
779
+ <a class="page-nav-link next" href="page-03.html">
780
+ <span class="page-nav-label">Next β†’</span>
781
+ <span>Architecture & Design</span>
782
+ </a>
783
+ </div>
784
+
785
+ <footer>
786
+ <p>VaultRAG Β· Architecture Portfolio Β· 2026 Β· <a href="https://github.com/raosiddharthp/VaultRAG">GitHub</a></p>
787
+ <p>Page 02 Β· The Problem Β· Β© 2026 Siddharth Rao</p>
788
+ </footer>
789
+
790
+ <script>
791
+ const reveals = document.querySelectorAll('.scroll-reveal');
792
+ const obs = new IntersectionObserver(entries => {
793
+ entries.forEach(e => { if (e.isIntersecting) { e.target.classList.add('visible'); obs.unobserve(e.target); } });
794
+ }, { threshold: 0.08 });
795
+ reveals.forEach(el => obs.observe(el));
796
+ </script>
797
+
798
+ </body>
799
+ </html>
page-03.html ADDED
@@ -0,0 +1,942 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>VaultRAG β€” Architecture & Design</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap" rel="stylesheet">
10
+ <style>
11
+ :root {
12
+ --steel-900: #0e1117; --steel-800: #161c27; --steel-700: #1e2535;
13
+ --steel-600: #262f42; --steel-500: #344057; --steel-400: #4a5568;
14
+ --steel-300: #718096; --steel-200: #a0aec0; --steel-100: #cbd5e0;
15
+ --amber-500: #f59e0b; --amber-400: #fbbf24; --amber-600: #d97706;
16
+ --danger: #ef4444; --success: #10b981; --info: #3b82f6; --purple: #8b5cf6;
17
+ --font-display: 'Barlow Condensed', sans-serif;
18
+ --font-body: 'Barlow', sans-serif;
19
+ --font-mono: 'JetBrains Mono', monospace;
20
+ }
21
+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
22
+ html { scroll-behavior: smooth; }
23
+ body { background: var(--steel-900); color: var(--steel-100); font-family: var(--font-body); font-size: 17px; line-height: 1.7; overflow-x: hidden; }
24
+ body::before { content: ''; position: fixed; inset: 0; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E"); pointer-events: none; z-index: 0; opacity: 0.4; }
25
+
26
+ /* NAV */
27
+ nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 0 48px; height: 64px; background: rgba(14,17,23,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(245,158,11,0.15); }
28
+ .nav-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: 0.08em; color: var(--amber-400); text-decoration: none; }
29
+ .nav-brand span { color: var(--steel-300); font-weight: 300; }
30
+ nav ul { display: flex; gap: 28px; list-style: none; }
31
+ nav a { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel-300); text-decoration: none; transition: color 0.2s; }
32
+ nav a:hover, nav a.active { color: var(--amber-400); }
33
+ .nav-github { color: var(--amber-400) !important; border: 1px solid var(--amber-500); padding: 6px 14px; border-radius: 2px; }
34
+ .nav-github:hover { background: var(--amber-500) !important; color: var(--steel-900) !important; }
35
+
36
+ /* PAGE HEADER */
37
+ .page-header { padding: 120px 48px 64px; position: relative; z-index: 1; border-bottom: 1px solid var(--steel-700); background: linear-gradient(180deg, rgba(59,130,246,0.04) 0%, transparent 100%); }
38
+ .page-header::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(59,130,246,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(59,130,246,0.025) 1px, transparent 1px); background-size: 60px 60px; pointer-events: none; }
39
+ .breadcrumb { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--steel-400); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
40
+ .breadcrumb a { color: var(--steel-400); text-decoration: none; transition: color 0.2s; }
41
+ .breadcrumb a:hover { color: var(--amber-400); }
42
+ .breadcrumb span { color: var(--steel-600); }
43
+ .page-number { font-family: var(--font-display); font-size: 7rem; font-weight: 800; color: rgba(59,130,246,0.07); line-height: 1; position: absolute; right: 48px; top: 80px; letter-spacing: -0.02em; pointer-events: none; }
44
+ .page-title { font-family: var(--font-display); font-size: clamp(3rem, 6vw, 5.5rem); font-weight: 800; line-height: 0.95; margin-bottom: 24px; max-width: 860px; }
45
+ .page-title em { font-style: italic; font-weight: 300; color: var(--info); }
46
+ .page-intro { font-size: 1.05rem; color: var(--steel-200); max-width: 700px; line-height: 1.8; }
47
+
48
+ /* SECTION */
49
+ section { position: relative; z-index: 1; padding: 80px 48px; }
50
+ section + section { border-top: 1px solid var(--steel-800); }
51
+ .section-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber-500); margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
52
+ .section-label::after { content: ''; flex: 1; max-width: 60px; height: 1px; background: var(--amber-600); }
53
+ .section-title { font-family: var(--font-display); font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 700; line-height: 1.1; margin-bottom: 16px; color: #fff; }
54
+ .section-title em { font-style: italic; font-weight: 300; color: var(--amber-400); }
55
+ .section-intro { font-size: 1rem; color: var(--steel-200); max-width: 700px; line-height: 1.8; margin-bottom: 56px; }
56
+
57
+ /* ANCHOR CLIENT */
58
+ .client-card { background: var(--steel-800); border: 1px solid var(--steel-600); border-radius: 6px; overflow: hidden; margin-bottom: 64px; }
59
+ .client-header { padding: 32px 40px; background: var(--steel-700); border-bottom: 1px solid var(--steel-600); display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
60
+ .client-name { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
61
+ .client-sub { font-family: var(--font-mono); font-size: 0.68rem; color: var(--steel-300); letter-spacing: 0.1em; }
62
+ .client-meta { display: flex; gap: 2px; flex-wrap: wrap; }
63
+ .client-meta-item { background: var(--steel-600); padding: 8px 16px; font-family: var(--font-mono); font-size: 0.65rem; color: var(--steel-200); letter-spacing: 0.08em; }
64
+ .client-meta-item strong { color: var(--amber-400); display: block; font-size: 1rem; font-family: var(--font-display); font-weight: 700; }
65
+ .client-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
66
+ .client-pain { padding: 28px 36px; border-bottom: 1px solid var(--steel-700); }
67
+ .client-body .client-pain:nth-child(odd) { border-right: 1px solid var(--steel-700); }
68
+ .pain-head { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--danger); margin-bottom: 8px; }
69
+ .pain-title-sm { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: #fff; margin-bottom: 8px; }
70
+ .pain-body-sm { font-size: 0.88rem; color: var(--steel-300); line-height: 1.65; }
71
+ .client-quote { padding: 32px 40px; background: var(--steel-700); border-top: 1px solid var(--steel-600); font-style: italic; font-size: 1rem; color: var(--steel-200); line-height: 1.75; }
72
+ .client-quote cite { display: block; margin-top: 12px; font-style: normal; font-family: var(--font-mono); font-size: 0.65rem; color: var(--steel-400); letter-spacing: 0.1em; }
73
+
74
+ /* PRINCIPLE CARDS */
75
+ .principles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--steel-700); border-radius: 4px; overflow: hidden; margin-bottom: 64px; }
76
+ .principle-card { background: var(--steel-800); padding: 36px 28px; }
77
+ .p-number { font-family: var(--font-display); font-size: 3.5rem; font-weight: 800; color: rgba(245,158,11,0.12); line-height: 1; margin-bottom: 12px; }
78
+ .p-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: 10px; line-height: 1.2; }
79
+ .p-body { font-size: 0.88rem; color: var(--steel-300); line-height: 1.7; }
80
+ .p-example { margin-top: 16px; padding: 12px 14px; background: var(--steel-700); border-left: 2px solid var(--amber-600); font-size: 0.82rem; color: var(--steel-200); font-style: italic; line-height: 1.6; }
81
+
82
+ /* ADR CARDS */
83
+ .adr-stack { display: flex; flex-direction: column; gap: 2px; background: var(--steel-700); border-radius: 4px; overflow: hidden; margin-bottom: 64px; }
84
+ .adr-card { background: var(--steel-800); }
85
+ .adr-header { padding: 20px 32px; display: flex; align-items: center; gap: 20px; cursor: pointer; transition: background 0.2s; user-select: none; }
86
+ .adr-header:hover { background: var(--steel-700); }
87
+ .adr-id { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.15em; color: var(--amber-600); text-transform: uppercase; white-space: nowrap; }
88
+ .adr-decision { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: #fff; flex: 1; }
89
+ .adr-status { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border-radius: 2px; white-space: nowrap; }
90
+ .adr-status.accepted { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
91
+ .adr-status.deferred { background: rgba(245,158,11,0.1); color: var(--amber-500); border: 1px solid rgba(245,158,11,0.25); }
92
+ .adr-chevron { color: var(--steel-400); font-size: 0.8rem; transition: transform 0.3s; }
93
+ .adr-body { display: none; padding: 0 32px 28px; border-top: 1px solid var(--steel-700); }
94
+ .adr-body.open { display: block; }
95
+ .adr-chevron.open { transform: rotate(90deg); }
96
+ .adr-row { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(38,47,66,0.6); }
97
+ .adr-row:last-child { border-bottom: none; }
98
+ .adr-row-label { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel-400); padding-top: 2px; }
99
+ .adr-row-value { font-size: 0.9rem; color: var(--steel-200); line-height: 1.65; }
100
+ .adr-row-value strong { color: var(--amber-400); }
101
+ .adr-row-value .alt { color: var(--steel-400); }
102
+ .adr-row-value .pro { color: var(--success); }
103
+ .adr-row-value .con { color: var(--danger); }
104
+
105
+ /* DIAGRAM WRAPPER */
106
+ .diagram-wrap { background: var(--steel-800); border: 1px solid var(--steel-600); border-radius: 6px; padding: 40px; margin-bottom: 64px; overflow: hidden; position: relative; }
107
+ .diagram-wrap::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(245,158,11,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(245,158,11,0.025) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
108
+ .diagram-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--steel-300); margin-bottom: 32px; display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
109
+ .diagram-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
110
+ .diagram-label.amber::before { background: var(--amber-500); box-shadow: 0 0 8px var(--amber-500); }
111
+ .diagram-label.blue::before { background: var(--info); box-shadow: 0 0 8px var(--info); }
112
+ .diagram-label.green::before { background: var(--success); box-shadow: 0 0 8px var(--success); }
113
+ .diagram-label.red::before { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
114
+
115
+ /* STACK TABLE */
116
+ .stack-table-wrap { background: var(--steel-800); border: 1px solid var(--steel-600); border-radius: 4px; overflow: hidden; margin-bottom: 48px; }
117
+ .stack-table-header { padding: 18px 28px; background: var(--steel-700); font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--amber-400); border-bottom: 1px solid var(--steel-600); }
118
+ table { width: 100%; border-collapse: collapse; }
119
+ th { background: var(--steel-700); padding: 12px 24px; text-align: left; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel-300); border-bottom: 1px solid var(--steel-600); }
120
+ td { padding: 14px 24px; border-bottom: 1px solid rgba(38,47,66,0.7); font-size: 0.88rem; color: var(--steel-200); vertical-align: top; line-height: 1.6; }
121
+ tr:last-child td { border-bottom: none; }
122
+ tr:hover td { background: rgba(38,47,66,0.35); }
123
+ .td-component { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--amber-400); }
124
+ .td-tag { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 2px; display: inline-block; margin-top: 4px; }
125
+ .td-tag.kept { background: rgba(16,185,129,0.12); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
126
+ .td-tag.changed { background: rgba(245,158,11,0.1); color: var(--amber-400); border: 1px solid rgba(245,158,11,0.2); }
127
+ .td-tag.dropped { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
128
+
129
+ /* DEPLOYMENT CARDS */
130
+ .deploy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--steel-700); border-radius: 4px; overflow: hidden; margin-bottom: 48px; }
131
+ .deploy-card { background: var(--steel-800); padding: 32px 28px; position: relative; }
132
+ .deploy-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
133
+ .deploy-card.dev::before { background: var(--info); }
134
+ .deploy-card.demo::before { background: var(--amber-500); }
135
+ .deploy-card.prod::before { background: var(--success); }
136
+ .deploy-env { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 12px; }
137
+ .deploy-card.dev .deploy-env { color: var(--info); }
138
+ .deploy-card.demo .deploy-env { color: var(--amber-500); }
139
+ .deploy-card.prod .deploy-env { color: var(--success); }
140
+ .deploy-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 12px; }
141
+ .deploy-body { font-size: 0.88rem; color: var(--steel-300); line-height: 1.7; margin-bottom: 16px; }
142
+ .deploy-specs { display: flex; flex-direction: column; gap: 6px; }
143
+ .deploy-spec { font-family: var(--font-mono); font-size: 0.68rem; color: var(--steel-400); display: flex; justify-content: space-between; padding: 6px 10px; background: var(--steel-700); border-radius: 2px; }
144
+ .deploy-spec strong { color: var(--steel-200); }
145
+
146
+ /* CHUNKING STRATEGY */
147
+ .chunk-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--steel-700); border-radius: 4px; overflow: hidden; margin-bottom: 48px; }
148
+ .chunk-panel { background: var(--steel-800); padding: 36px 32px; }
149
+ .chunk-panel::before { content: ''; display: block; height: 3px; margin: -36px -32px 28px; }
150
+ .chunk-panel.bad::before { background: var(--danger); }
151
+ .chunk-panel.good::before { background: var(--success); }
152
+ .chunk-type { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 14px; }
153
+ .chunk-panel.bad .chunk-type { color: var(--danger); }
154
+ .chunk-panel.good .chunk-type { color: var(--success); }
155
+ .chunk-panel h4 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: 14px; }
156
+ .chunk-panel p { font-size: 0.88rem; color: var(--steel-300); line-height: 1.7; margin-bottom: 16px; }
157
+ .chunk-example { background: var(--steel-700); border-radius: 3px; padding: 16px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--steel-200); line-height: 1.65; border-left: 3px solid; }
158
+ .chunk-panel.bad .chunk-example { border-color: var(--danger); color: rgba(203,213,224,0.5); }
159
+ .chunk-panel.good .chunk-example { border-color: var(--success); }
160
+
161
+ /* SCROLL REVEAL */
162
+ .scroll-reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s, transform 0.7s; }
163
+ .scroll-reveal.visible { opacity: 1; transform: translateY(0); }
164
+
165
+ /* PAGE NAV */
166
+ .page-nav { display: flex; justify-content: space-between; align-items: center; padding: 40px 48px; border-top: 1px solid var(--steel-700); }
167
+ .page-nav-link { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; color: var(--steel-300); display: flex; flex-direction: column; gap: 6px; transition: color 0.2s; }
168
+ .page-nav-link:hover { color: var(--amber-400); }
169
+ .page-nav-label { font-size: 0.6rem; color: var(--steel-500); }
170
+ .page-nav-link.next { text-align: right; }
171
+ .btn { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; padding: 12px 24px; border-radius: 2px; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; }
172
+ .btn-primary { background: var(--amber-500); color: var(--steel-900); font-weight: 700; }
173
+ .btn-primary:hover { background: var(--amber-400); }
174
+
175
+ footer { padding: 40px 48px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--steel-800); }
176
+ footer p { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; color: var(--steel-500); text-transform: uppercase; }
177
+ footer a { color: var(--steel-400); text-decoration: none; }
178
+ footer a:hover { color: var(--amber-400); }
179
+
180
+ @media (max-width: 960px) {
181
+ nav { padding: 0 24px; } nav ul { display: none; }
182
+ .page-header { padding: 100px 24px 48px; } .page-number { display: none; }
183
+ section { padding: 56px 24px; }
184
+ .principles-grid, .deploy-grid { grid-template-columns: 1fr; }
185
+ .client-body, .chunk-compare { grid-template-columns: 1fr; }
186
+ .page-nav { padding: 28px 24px; }
187
+ footer { padding: 28px 24px; flex-direction: column; gap: 12px; text-align: center; }
188
+ }
189
+ </style>
190
+ </head>
191
+ <body>
192
+
193
+ <!-- NAV -->
194
+ <nav>
195
+ <a class="nav-brand" href="index.html">VAULT<span>RAG</span></a>
196
+ <ul>
197
+ <li><a href="index.html">Overview</a></li>
198
+ <li><a href="page-02.html">The Problem</a></li>
199
+ <li><a href="page-03.html" class="active">Architecture</a></li>
200
+ <li><a href="page-04.html">Simulator</a></li>
201
+ <li><a href="page-05.html">Cost Model</a></li>
202
+ <li><a href="page-06.html">Roadmap</a></li>
203
+ <li><a href="https://github.com/raosiddharthp/VaultRAG" class="nav-github">GitHub β†’</a></li>
204
+ </ul>
205
+ </nav>
206
+
207
+ <!-- PAGE HEADER -->
208
+ <div class="page-header">
209
+ <div class="page-number">03</div>
210
+ <div class="breadcrumb">
211
+ <a href="index.html">VaultRAG</a><span>/</span>
212
+ <span>Page 03</span><span>/</span>
213
+ <span>Architecture & Design</span>
214
+ </div>
215
+ <h1 class="page-title">Every decision <em>justified.</em><br>Every trade-off documented.</h1>
216
+ <p class="page-intro">This page traces every architectural choice in VaultRAG back to a concrete requirement. The stack is not a default β€” each component was selected, an alternative was considered, and the reasoning is stated here. That is the work of an architect, not a developer.</p>
217
+ </div>
218
+
219
+ <!-- ══ 01 ANCHOR CLIENT ══ -->
220
+ <section>
221
+ <div class="section-label">01 β€” Anchor Client</div>
222
+ <h2 class="section-title">FlexForm Precision. <em>The anchor facility.</em></h2>
223
+ <p class="section-intro">Every architecture decision in VaultRAG traces back to the operational reality of a specific type of facility. This is that facility β€” a mid-size precision engineering plant where every architectural constraint is real and every trade-off is felt on the floor.</p>
224
+
225
+ <div class="client-card scroll-reveal">
226
+ <div class="client-header">
227
+ <div>
228
+ <div class="client-name">FlexForm Precision Engineering Ltd.</div>
229
+ <div class="client-sub">Sheffield, UK Β· Est. 2003 Β· Tier-2 Automotive Supplier Β· CNC Machining + Assembly</div>
230
+ </div>
231
+ <div class="client-meta">
232
+ <div class="client-meta-item"><strong>340</strong>Employees</div>
233
+ <div class="client-meta-item"><strong>12</strong>CNC lines</div>
234
+ <div class="client-meta-item"><strong>Β£42M</strong>Annual revenue</div>
235
+ <div class="client-meta-item"><strong>28,000+</strong>Doc pages</div>
236
+ <div class="client-meta-item"><strong>ISO 9001</strong>Certified</div>
237
+ <div class="client-meta-item"><strong>ITAR</strong>Adjacent supplier</div>
238
+ </div>
239
+ </div>
240
+ <div class="client-body">
241
+ <div class="client-pain">
242
+ <div class="pain-head">Pain β€” 01</div>
243
+ <div class="pain-title-sm">28,000 pages of documentation on a 2011 network drive</div>
244
+ <p class="pain-body-sm">Equipment manuals, ISO-controlled SOPs, NCR histories, calibration records β€” all stored in a folder hierarchy no one fully understands. Keyword search returns 40 results. The right one is never at the top. Average technician search time: 18+ minutes per incident.</p>
245
+ </div>
246
+ <div class="client-pain">
247
+ <div class="pain-head">Pain β€” 02</div>
248
+ <div class="pain-title-sm">Cloud RAG tools are contractually excluded</div>
249
+ <p class="pain-body-sm">FlexForm supplies components to a Tier-1 automotive OEM whose NDA explicitly prohibits sending manufacturing process data to third-party cloud APIs. Every major RAG tool on the market β€” OpenAI, Anthropic, Google β€” is architecturally excluded. Not a preference. A contract clause.</p>
250
+ </div>
251
+ <div class="client-pain">
252
+ <div class="pain-head">Pain β€” 03</div>
253
+ <div class="pain-title-sm">Technicians are on the floor, not at a desk</div>
254
+ <p class="pain-body-sm">340 employees. 260 of them are on the floor. They have smartphones. They do not have company laptops, portal logins, or reliable mobile internet inside the facility. Any solution that requires a desktop browser, a VPN, or an app install has already failed 260 of the 340 people it needs to serve.</p>
255
+ </div>
256
+ <div class="client-pain">
257
+ <div class="pain-head">Pain β€” 04</div>
258
+ <div class="pain-title-sm">Incorrect procedures create NCRs that cost Β£8K–£40K each</div>
259
+ <p class="pain-body-sm">FlexForm logged 14 non-conformance reports in the last 12 months. Root cause analysis traced 9 of them to incorrect or incomplete procedure application. At an average NCR resolution cost of Β£12,000 (rework, engineering investigation, customer notification), the annual cost of the knowledge gap is approximately Β£108,000 β€” before downtime.</p>
260
+ </div>
261
+ </div>
262
+ <div class="client-quote">
263
+ "We have the documentation. Every procedure is written down somewhere. The problem is that 'somewhere' is not good enough at 07:15 when the line is stopped and the manual is in the office. We need the right answer in under 10 seconds, on a phone, without the internet."
264
+ <cite>β€” Engineering Manager, composite of real Tier-2 automotive supplier interviews Β· Fictional profile</cite>
265
+ </div>
266
+ </div>
267
+ </section>
268
+
269
+ <!-- ══ 02 DESIGN PRINCIPLES ══ -->
270
+ <section>
271
+ <div class="section-label">02 β€” Design Principles</div>
272
+ <h2 class="section-title">Three principles. <em>Non-negotiable.</em></h2>
273
+ <p class="section-intro">These are not preferences. They are architectural constraints derived directly from FlexForm's operational reality. Every component in VaultRAG must satisfy all three.</p>
274
+
275
+ <div class="principles-grid scroll-reveal">
276
+ <div class="principle-card">
277
+ <div class="p-number">I</div>
278
+ <div class="p-title">The answer must reach the floor, not the office</div>
279
+ <p class="p-body">Every interface decision β€” voice input, mobile-first layout, one-button interaction, sub-10-second response β€” derives from a single constraint: the primary user is standing next to a running machine with one hand occupied, in an environment with 85–95dB of ambient noise, needing an answer before the downtime cost compounds further.</p>
280
+ <div class="p-example">In practice: Web Speech API for zero-install voice input. FastAPI + single HTML page with no JavaScript framework. Response formatted as numbered steps, not prose paragraphs.</div>
281
+ </div>
282
+ <div class="principle-card">
283
+ <div class="p-number">II</div>
284
+ <div class="p-title">Data sovereignty is an architectural invariant, not a feature</div>
285
+ <p class="p-body">No document content, query text, or response data exits the facility network at any point. This is not a configuration option. It is enforced by the architecture: the LLM runs locally via Ollama, embeddings are generated locally, the vector store is on-disk, and the deployment model is on-prem server on plant WiFi. There is no code path that touches an external API after initial model download.</p>
286
+ <div class="p-example">In practice: Ollama serves Llama 3.2 3B entirely locally. ChromaDB persists to disk. FastAPI serves only on the internal network. Zero cloud egress in normal operation.</div>
287
+ </div>
288
+ <div class="principle-card">
289
+ <div class="p-number">III</div>
290
+ <div class="p-title">A refused answer is better than a wrong one</div>
291
+ <p class="p-body">In a manufacturing environment, an incorrect procedure is not an inconvenience β€” it is a safety risk, an NCR, and potentially a line stoppage that costs Β£4,000/minute. The guardrail system is designed to fail closed: when confidence is insufficient, when scope is violated, when a citation cannot be produced, VaultRAG refuses and explains why. The system's trustworthiness depends on its willingness to say "I don't know."</p>
292
+ <div class="p-example">In practice: 5-layer guardrail pipeline. Confidence threshold at 0.70. Citation enforcer blocks uncited responses. Safety flag prefixes all LOTO/hazard procedures with mandatory warning.</div>
293
+ </div>
294
+ </div>
295
+ </section>
296
+
297
+ <!-- ══ 03 SYSTEM ARCHITECTURE DIAGRAM ══ -->
298
+ <section>
299
+ <div class="section-label">03 β€” System Architecture</div>
300
+ <h2 class="section-title">Four layers. <em>One invariant boundary.</em></h2>
301
+ <p class="section-intro">The architecture is organised into four distinct layers. The invariant: nothing crosses the facility boundary after initial model download. Each layer has a single responsibility and a clean interface to the layers adjacent to it.</p>
302
+
303
+ <!-- FULL SYSTEM DIAGRAM -->
304
+ <div class="diagram-wrap scroll-reveal">
305
+ <div class="diagram-label amber">Full system architecture β€” four layers Β· facility boundary enforced</div>
306
+ <svg viewBox="0 0 1000 580" xmlns="http://www.w3.org/2000/svg" font-family="'JetBrains Mono',monospace" width="100%" style="position:relative;z-index:1;">
307
+ <defs>
308
+ <marker id="arr-a" markerWidth="7" markerHeight="7" refX="5" refY="3" orient="auto"><path d="M0,0 L0,6 L7,3 z" fill="#f59e0b" opacity="0.9"/></marker>
309
+ <marker id="arr-b" markerWidth="7" markerHeight="7" refX="5" refY="3" orient="auto"><path d="M0,0 L0,6 L7,3 z" fill="#10b981" opacity="0.7"/></marker>
310
+ <marker id="arr-c" markerWidth="7" markerHeight="7" refX="5" refY="3" orient="auto"><path d="M0,0 L0,6 L7,3 z" fill="#718096" opacity="0.6"/></marker>
311
+ <marker id="arr-r" markerWidth="7" markerHeight="7" refX="5" refY="3" orient="auto"><path d="M0,0 L0,6 L7,3 z" fill="#ef4444" opacity="0.7"/></marker>
312
+ </defs>
313
+
314
+ <!-- FACILITY BOUNDARY BOX -->
315
+ <rect x="160" y="10" width="830" height="560" rx="6" fill="none" stroke="#344057" stroke-width="1" stroke-dasharray="6,4"/>
316
+ <text x="178" y="28" font-size="7.5" fill="#4a5568" letter-spacing="2" text-transform="uppercase">FACILITY BOUNDARY β€” NO DATA EXITS THIS PERIMETER</text>
317
+
318
+ <!-- LAYER 1: FIELD -->
319
+ <rect x="10" y="10" width="140" height="560" rx="4" fill="#161c27" stroke="#344057"/>
320
+ <rect x="10" y="10" width="140" height="3" fill="#f59e0b" rx="2"/>
321
+ <text x="80" y="30" text-anchor="middle" font-size="7" fill="#f59e0b" letter-spacing="2">LAYER 01</text>
322
+ <text x="80" y="44" text-anchor="middle" font-size="8" fill="#a0aec0">Field</text>
323
+
324
+ <!-- Phone -->
325
+ <rect x="30" y="60" width="100" height="160" rx="8" fill="#1e2535" stroke="#344057" stroke-width="1.5"/>
326
+ <rect x="40" y="72" width="80" height="110" rx="3" fill="#0e1117"/>
327
+ <text x="80" y="92" text-anchor="middle" font-size="7" fill="#718096">VaultRAG</text>
328
+ <rect x="44" y="98" width="72" height="8" rx="2" fill="#262f42"/>
329
+ <rect x="44" y="110" width="50" height="8" rx="2" fill="#1e2535"/>
330
+ <rect x="44" y="122" width="60" height="8" rx="2" fill="#262f42"/>
331
+ <circle cx="80" cy="154" r="10" fill="#f59e0b"/>
332
+ <text x="80" y="158" text-anchor="middle" font-size="10">πŸŽ™</text>
333
+ <rect x="65" y="206" width="30" height="3" rx="1.5" fill="#344057"/>
334
+ <text x="80" y="240" text-anchor="middle" font-size="7" fill="#a0aec0">Mobile PWA</text>
335
+ <text x="80" y="252" text-anchor="middle" font-size="6.5" fill="#718096">No install needed</text>
336
+
337
+ <!-- Voice input -->
338
+ <rect x="18" y="270" width="124" height="46" rx="3" fill="#1e2535" stroke="#344057"/>
339
+ <text x="80" y="288" text-anchor="middle" font-size="7" fill="#f59e0b" letter-spacing="1">WEB SPEECH API</text>
340
+ <text x="80" y="301" text-anchor="middle" font-size="6.5" fill="#718096">Voice β†’ Text</text>
341
+ <text x="80" y="312" text-anchor="middle" font-size="6" fill="#4a5568">Native Β· Zero cost</text>
342
+
343
+ <!-- WiFi -->
344
+ <rect x="18" y="326" width="124" height="36" rx="3" fill="#1e2535" stroke="#262f42"/>
345
+ <text x="80" y="342" text-anchor="middle" font-size="6.5" fill="#718096">PLANT WIFI</text>
346
+ <text x="80" y="354" text-anchor="middle" font-size="6" fill="#4a5568">Internal only</text>
347
+
348
+ <!-- Text fallback -->
349
+ <rect x="18" y="372" width="124" height="36" rx="3" fill="#1e2535" stroke="#262f42"/>
350
+ <text x="80" y="388" text-anchor="middle" font-size="6.5" fill="#718096">TEXT FALLBACK</text>
351
+ <text x="80" y="400" text-anchor="middle" font-size="6" fill="#4a5568">Keyboard backup</text>
352
+
353
+ <!-- LAYER 2: GATEWAY (inside boundary) -->
354
+ <rect x="172" y="40" width="150" height="520" rx="3" fill="#161c27" stroke="#262f42"/>
355
+ <rect x="172" y="40" width="150" height="3" fill="#3b82f6" rx="2"/>
356
+ <text x="247" y="58" text-anchor="middle" font-size="7" fill="#60a5fa" letter-spacing="2">LAYER 02</text>
357
+ <text x="247" y="70" text-anchor="middle" font-size="8" fill="#a0aec0">Gateway</text>
358
+
359
+ <rect x="184" y="88" width="126" height="52" rx="3" fill="#1e2535" stroke="#4a5568"/>
360
+ <text x="247" y="106" text-anchor="middle" font-size="7" fill="#60a5fa" letter-spacing="1">FASTAPI</text>
361
+ <text x="247" y="119" text-anchor="middle" font-size="6.5" fill="#718096">HTTP Β· JSON</text>
362
+ <text x="247" y="131" text-anchor="middle" font-size="6" fill="#4a5568">localhost:8000</text>
363
+
364
+ <rect x="184" y="154" width="126" height="40" rx="3" fill="#1e2535" stroke="#262f42"/>
365
+ <text x="247" y="170" text-anchor="middle" font-size="6.5" fill="#718096">REQUEST PARSE</text>
366
+ <text x="247" y="182" text-anchor="middle" font-size="6" fill="#4a5568">Text + metadata</text>
367
+
368
+ <rect x="184" y="208" width="126" height="40" rx="3" fill="#1e2535" stroke="#262f42"/>
369
+ <text x="247" y="224" text-anchor="middle" font-size="6.5" fill="#718096">RESPONSE FORMAT</text>
370
+ <text x="247" y="236" text-anchor="middle" font-size="6" fill="#4a5568">Steps Β· Citations</text>
371
+
372
+ <rect x="184" y="262" width="126" height="40" rx="3" fill="#1e2535" stroke="#262f42"/>
373
+ <text x="247" y="278" text-anchor="middle" font-size="6.5" fill="#718096">ERROR HANDLING</text>
374
+ <text x="247" y="290" text-anchor="middle" font-size="6" fill="#4a5568">Guardrail responses</text>
375
+
376
+ <!-- LAYER 3: INTELLIGENCE CORE -->
377
+ <rect x="334" y="40" width="420" height="520" rx="3" fill="#161c27" stroke="#262f42"/>
378
+ <rect x="334" y="40" width="420" height="3" fill="#f59e0b" rx="2"/>
379
+ <text x="544" y="58" text-anchor="middle" font-size="7" fill="#f59e0b" letter-spacing="2">LAYER 03</text>
380
+ <text x="544" y="70" text-anchor="middle" font-size="8" fill="#a0aec0">Intelligence Core</text>
381
+
382
+ <!-- Guardrail pipeline box -->
383
+ <rect x="346" y="86" width="396" height="220" rx="3" fill="#0e1117" stroke="#344057" stroke-dasharray="4,3"/>
384
+ <text x="544" y="104" text-anchor="middle" font-size="7.5" fill="#f59e0b" letter-spacing="2">GUARDRAIL PIPELINE β€” 5 SEQUENTIAL LAYERS</text>
385
+
386
+ <!-- G1 -->
387
+ <rect x="356" y="114" width="68" height="60" rx="3" fill="#1e2535" stroke="#d97706"/>
388
+ <text x="390" y="131" text-anchor="middle" font-size="7" fill="#f59e0b">G1</text>
389
+ <text x="390" y="143" text-anchor="middle" font-size="7" fill="#cbd5e0">Query</text>
390
+ <text x="390" y="154" text-anchor="middle" font-size="7" fill="#cbd5e0">Normaliser</text>
391
+ <text x="390" y="166" text-anchor="middle" font-size="6" fill="#718096">Denoise voice</text>
392
+
393
+ <!-- G2 -->
394
+ <rect x="436" y="114" width="68" height="60" rx="3" fill="#1e2535" stroke="#d97706"/>
395
+ <text x="470" y="131" text-anchor="middle" font-size="7" fill="#f59e0b">G2</text>
396
+ <text x="470" y="143" text-anchor="middle" font-size="7" fill="#cbd5e0">Scope</text>
397
+ <text x="470" y="154" text-anchor="middle" font-size="7" fill="#cbd5e0">Guard</text>
398
+ <text x="470" y="166" text-anchor="middle" font-size="6" fill="#718096">Off-topic block</text>
399
+
400
+ <!-- G3 -->
401
+ <rect x="516" y="114" width="68" height="60" rx="3" fill="#1e2535" stroke="#d97706"/>
402
+ <text x="550" y="131" text-anchor="middle" font-size="7" fill="#f59e0b">G3</text>
403
+ <text x="550" y="143" text-anchor="middle" font-size="7" fill="#cbd5e0">Confidence</text>
404
+ <text x="550" y="154" text-anchor="middle" font-size="7" fill="#cbd5e0">Threshold</text>
405
+ <text x="550" y="166" text-anchor="middle" font-size="6" fill="#718096">Score β‰₯ 0.70</text>
406
+
407
+ <!-- G4 -->
408
+ <rect x="596" y="114" width="68" height="60" rx="3" fill="#1e2535" stroke="#ef4444"/>
409
+ <text x="630" y="131" text-anchor="middle" font-size="7" fill="#ef4444">G4</text>
410
+ <text x="630" y="143" text-anchor="middle" font-size="7" fill="#cbd5e0">Safety</text>
411
+ <text x="630" y="154" text-anchor="middle" font-size="7" fill="#cbd5e0">Flag</text>
412
+ <text x="630" y="166" text-anchor="middle" font-size="6" fill="#718096">LOTO / hazard</text>
413
+
414
+ <!-- G5 -->
415
+ <rect x="676" y="114" width="58" height="60" rx="3" fill="#1e2535" stroke="#10b981"/>
416
+ <text x="705" y="131" text-anchor="middle" font-size="7" fill="#10b981">G5</text>
417
+ <text x="705" y="143" text-anchor="middle" font-size="7" fill="#cbd5e0">Citation</text>
418
+ <text x="705" y="154" text-anchor="middle" font-size="7" fill="#cbd5e0">Enforcer</text>
419
+ <text x="705" y="166" text-anchor="middle" font-size="6" fill="#718096">Source req'd</text>
420
+
421
+ <!-- Arrows between guardrails -->
422
+ <line x1="424" y1="144" x2="436" y2="144" stroke="#f59e0b" stroke-width="1" marker-end="url(#arr-a)" opacity="0.7"/>
423
+ <line x1="504" y1="144" x2="516" y2="144" stroke="#f59e0b" stroke-width="1" marker-end="url(#arr-a)" opacity="0.7"/>
424
+ <line x1="584" y1="144" x2="596" y2="144" stroke="#f59e0b" stroke-width="1" marker-end="url(#arr-a)" opacity="0.7"/>
425
+ <line x1="664" y1="144" x2="676" y2="144" stroke="#f59e0b" stroke-width="1" marker-end="url(#arr-a)" opacity="0.7"/>
426
+
427
+ <!-- Retrieval -->
428
+ <rect x="346" y="318" width="396" height="48" rx="3" fill="#1e2535" stroke="#344057"/>
429
+ <text x="544" y="338" text-anchor="middle" font-size="7.5" fill="#60a5fa" letter-spacing="1">CHROMADB RETRIEVAL Β· top-k=3 Β· nomic-embed-text Β· cosine similarity Β· threshold 0.70</text>
430
+ <text x="544" y="354" text-anchor="middle" font-size="7" fill="#4a5568">Procedural chunking Β· persistent local disk Β· no external service</text>
431
+
432
+ <!-- Arrow: guardrail β†’ retrieval -->
433
+ <line x1="544" y1="306" x2="544" y2="318" stroke="#f59e0b" stroke-width="1.2" marker-end="url(#arr-a)"/>
434
+
435
+ <!-- LLM -->
436
+ <rect x="346" y="380" width="396" height="48" rx="3" fill="#1e2535" stroke="#344057"/>
437
+ <text x="544" y="400" text-anchor="middle" font-size="7.5" fill="#a78bfa" letter-spacing="1">OLLAMA Β· LLAMA 3.2 Β· 3B INSTRUCT Β· LOCAL PORT 11434</text>
438
+ <text x="544" y="416" text-anchor="middle" font-size="7" fill="#4a5568">Structured prompt Β· max 5 steps Β· citation mandatory Β· safety prefix on G4</text>
439
+
440
+ <!-- Arrow: retrieval β†’ LLM -->
441
+ <line x1="544" y1="366" x2="544" y2="380" stroke="#f59e0b" stroke-width="1.2" marker-end="url(#arr-a)"/>
442
+
443
+ <!-- LlamaIndex -->
444
+ <rect x="346" y="442" width="396" height="48" rx="3" fill="#262f42" stroke="#4a5568"/>
445
+ <text x="544" y="462" text-anchor="middle" font-size="7.5" fill="#e2e8f0" letter-spacing="1">LLAMAINDEX ORCHESTRATOR</text>
446
+ <text x="544" y="478" text-anchor="middle" font-size="7" fill="#718096">Query engine Β· ingestion pipeline Β· index management Β· response synthesis</text>
447
+
448
+ <!-- Arrow: LLM β†’ orchestrator -->
449
+ <line x1="544" y1="428" x2="544" y2="442" stroke="#f59e0b" stroke-width="1.2" marker-end="url(#arr-a)"/>
450
+
451
+ <!-- Guardrail down-arrows -->
452
+ <line x1="390" y1="174" x2="390" y2="195" stroke="#f59e0b" stroke-width="1" marker-end="url(#arr-a)" opacity="0.5"/>
453
+ <rect x="356" y="195" width="396" height="32" rx="2" fill="#0e1117" stroke="#262f42"/>
454
+ <text x="544" y="215" text-anchor="middle" font-size="6.5" fill="#718096">↑ G1β†’G2 pre-retrieval Β· G3 post-retrieval Β· G4 pre-generation Β· G5 post-generation ↑</text>
455
+ <line x1="390" y1="227" x2="390" y2="318" stroke="#f59e0b" stroke-width="1" marker-end="url(#arr-a)" opacity="0.3"/>
456
+
457
+ <!-- LAYER 4: DATA -->
458
+ <rect x="766" y="40" width="224" height="520" rx="3" fill="#161c27" stroke="#262f42"/>
459
+ <rect x="766" y="40" width="224" height="3" fill="#10b981" rx="2"/>
460
+ <text x="878" y="58" text-anchor="middle" font-size="7" fill="#34d399" letter-spacing="2">LAYER 04</text>
461
+ <text x="878" y="70" text-anchor="middle" font-size="8" fill="#a0aec0">Data & Documents</text>
462
+
463
+ <rect x="778" y="88" width="200" height="52" rx="3" fill="#1e2535" stroke="#2d6a4f"/>
464
+ <text x="878" y="106" text-anchor="middle" font-size="7.5" fill="#34d399" letter-spacing="1">EQUIPMENT MANUALS</text>
465
+ <text x="878" y="120" text-anchor="middle" font-size="7" fill="#718096">PDF Β· Haas, Fanuc, ABB</text>
466
+ <text x="878" y="132" text-anchor="middle" font-size="6" fill="#4a5568">Procedural chunking</text>
467
+
468
+ <rect x="778" y="150" width="200" height="52" rx="3" fill="#1e2535" stroke="#2d6a4f"/>
469
+ <text x="878" y="168" text-anchor="middle" font-size="7.5" fill="#34d399" letter-spacing="1">SOPs &amp; WORK INSTR.</text>
470
+ <text x="878" y="182" text-anchor="middle" font-size="7" fill="#718096">PDF Β· TXT Β· ISO 9001</text>
471
+ <text x="878" y="194" text-anchor="middle" font-size="6" fill="#4a5568">Section-based chunks</text>
472
+
473
+ <rect x="778" y="212" width="200" height="52" rx="3" fill="#1e2535" stroke="#2d6a4f"/>
474
+ <text x="878" y="230" text-anchor="middle" font-size="7.5" fill="#34d399" letter-spacing="1">NCR / INCIDENT REPORTS</text>
475
+ <text x="878" y="244" text-anchor="middle" font-size="7" fill="#718096">PDF Β· Structured text</text>
476
+ <text x="878" y="256" text-anchor="middle" font-size="6" fill="#4a5568">Issue-resolution pairs</text>
477
+
478
+ <rect x="778" y="278" width="200" height="68" rx="3" fill="#262f42" stroke="#4a5568"/>
479
+ <text x="878" y="298" text-anchor="middle" font-size="7.5" fill="#a0aec0" letter-spacing="1">INGESTION PIPELINE</text>
480
+ <text x="878" y="314" text-anchor="middle" font-size="6.5" fill="#718096">PyMuPDF parsing</text>
481
+ <text x="878" y="328" text-anchor="middle" font-size="6.5" fill="#718096">nomic-embed-text</text>
482
+ <text x="878" y="340" text-anchor="middle" font-size="6.5" fill="#718096">Metadata tagging</text>
483
+
484
+ <rect x="778" y="360" width="200" height="52" rx="3" fill="#1e2535" stroke="#2d6a4f"/>
485
+ <text x="878" y="378" text-anchor="middle" font-size="7.5" fill="#34d399" letter-spacing="1">CHROMADB</text>
486
+ <text x="878" y="392" text-anchor="middle" font-size="7" fill="#718096">Persistent on disk</text>
487
+ <text x="878" y="404" text-anchor="middle" font-size="6" fill="#4a5568">No cloud Β· No egress</text>
488
+
489
+ <rect x="778" y="426" width="200" height="52" rx="3" fill="#0e1117" stroke="#344057" stroke-dasharray="4,3"/>
490
+ <text x="878" y="444" text-anchor="middle" font-size="7" fill="#718096" letter-spacing="1">AIR-GAP BOUNDARY</text>
491
+ <text x="878" y="458" text-anchor="middle" font-size="6.5" fill="#4a5568">Zero data exfiltration</text>
492
+ <text x="878" y="470" text-anchor="middle" font-size="6.5" fill="#4a5568">On-prem Β· Plant WiFi</text>
493
+
494
+ <!-- CROSS-LAYER ARROWS -->
495
+ <!-- Phone β†’ Gateway -->
496
+ <line x1="150" y1="112" x2="172" y2="112" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arr-a)"/>
497
+ <text x="160" y="106" text-anchor="middle" font-size="6" fill="#d97706">HTTP</text>
498
+ <!-- Gateway β†’ Intelligence -->
499
+ <line x1="310" y1="112" x2="334" y2="112" stroke="#60a5fa" stroke-width="1.2" marker-end="url(#arr-a)" opacity="0.8"/>
500
+ <!-- Intelligence β†’ Data (retrieval) -->
501
+ <line x1="742" y1="342" x2="778" y2="390" stroke="#10b981" stroke-width="1.2" marker-end="url(#arr-b)" stroke-dasharray="3,2" opacity="0.6"/>
502
+ <!-- Data β†’ Intelligence (chunks) -->
503
+ <line x1="778" y1="400" x2="742" y2="360" stroke="#10b981" stroke-width="1" marker-end="url(#arr-b)" stroke-dasharray="3,2" opacity="0.4"/>
504
+ <!-- Ingestion β†’ ChromaDB -->
505
+ <line x1="878" y1="346" x2="878" y2="360" stroke="#34d399" stroke-width="1" marker-end="url(#arr-b)" opacity="0.7"/>
506
+ <!-- Response back to phone -->
507
+ <path d="M 247 490 Q 80 540 80 448" stroke="#718096" stroke-width="1" fill="none" stroke-dasharray="3,2" marker-end="url(#arr-c)" opacity="0.5"/>
508
+ <text x="148" y="556" text-anchor="middle" font-size="6" fill="#4a5568">Cited response</text>
509
+ </svg>
510
+ </div>
511
+ </section>
512
+
513
+ <!-- ══ 04 ARCHITECTURE DECISION RECORDS ══ -->
514
+ <section>
515
+ <div class="section-label">04 β€” Architecture Decision Records</div>
516
+ <h2 class="section-title">Eight decisions. <em>Each one justified.</em></h2>
517
+ <p class="section-intro">Every component in VaultRAG was chosen over an alternative. These ADRs state what was selected, what was considered, and the reasoning β€” including what the original notes got wrong and why it was changed.</p>
518
+
519
+ <div class="adr-stack scroll-reveal" id="adr-stack">
520
+
521
+ <!-- ADR-001 -->
522
+ <div class="adr-card">
523
+ <div class="adr-header" onclick="toggleADR(this)">
524
+ <span class="adr-id">ADR-001</span>
525
+ <span class="adr-decision">LLM: Llama 3.2 3B over Llama 3.1 8B</span>
526
+ <span class="adr-status accepted">Accepted</span>
527
+ <span class="adr-chevron">β–Ά</span>
528
+ </div>
529
+ <div class="adr-body open">
530
+ <div class="adr-row"><span class="adr-row-label">Decision</span><span class="adr-row-value"><strong>Llama 3.2 3B Instruct via Ollama</strong></span></div>
531
+ <div class="adr-row"><span class="adr-row-label">Original</span><span class="adr-row-value"><span class="alt">Llama 3.1 8B Instruct β€” specified in original VaultRAG notes</span></span></div>
532
+ <div class="adr-row"><span class="adr-row-label">Why changed</span><span class="adr-row-value">Llama 3.1 8B requires ~6GB of RAM for the model alone. On a HuggingFace Spaces free instance (16GB shared, ~8GB available to a Docker container), running 8B alongside ChromaDB and FastAPI causes OOM failures under load. 3B runs in ~2.5GB, leaving sufficient headroom. Llama 3.2 is a newer architecture with better instruction-following than 3.1 at equivalent parameter count β€” quality regresses less than expected from the parameter reduction.</span></div>
533
+ <div class="adr-row"><span class="adr-row-label">Considered</span><span class="adr-row-value"><span class="alt">Llama 3.1 8B Β· Mistral 7B Β· Phi-3 Mini Β· Gemma 2 2B</span></span></div>
534
+ <div class="adr-row"><span class="adr-row-label">Trade-off</span><span class="adr-row-value"><span class="pro">βœ“ Fits demo environment Β· Faster inference Β· Newer architecture</span><br><span class="con">βœ— Less reasoning depth on complex multi-step procedures Β· Production path recommends 8B+ on dedicated hardware</span></span></div>
535
+ <div class="adr-row"><span class="adr-row-label">Production path</span><span class="adr-row-value">On-prem deployment uses Llama 3.1 8B or 70B depending on hardware. Ollama's model-swap design means zero application code changes β€” swap the model string in config.</span></div>
536
+ </div>
537
+ </div>
538
+
539
+ <!-- ADR-002 -->
540
+ <div class="adr-card">
541
+ <div class="adr-header" onclick="toggleADR(this)">
542
+ <span class="adr-id">ADR-002</span>
543
+ <span class="adr-decision">Embeddings: nomic-embed-text over Sentence-BERT</span>
544
+ <span class="adr-status accepted">Accepted</span>
545
+ <span class="adr-chevron">β–Ά</span>
546
+ </div>
547
+ <div class="adr-body">
548
+ <div class="adr-row"><span class="adr-row-label">Decision</span><span class="adr-row-value"><strong>nomic-embed-text via Ollama</strong></span></div>
549
+ <div class="adr-row"><span class="adr-row-label">Original</span><span class="adr-row-value"><span class="alt">Sentence-BERT via Hugging Face Transformers β€” specified in index.html notes</span></span></div>
550
+ <div class="adr-row"><span class="adr-row-label">Why changed</span><span class="adr-row-value">Sentence-BERT requires a separate Python process, a separate model download, and a separate dependency tree. nomic-embed-text runs through Ollama β€” the same process already serving the LLM. One fewer system dependency, one fewer failure point, identical embedding quality on technical text. The original notes listed both Sentence-BERT and nomic-embed-text as if they were complementary; they are redundant. nomic-embed-text wins on operational simplicity.</span></div>
551
+ <div class="adr-row"><span class="adr-row-label">Trade-off</span><span class="adr-row-value"><span class="pro">βœ“ Single-process deployment Β· No separate model server Β· Ollama handles lifecycle</span><br><span class="con">βœ— Slightly less flexibility in embedding dimension tuning vs. raw HF models</span></span></div>
552
+ </div>
553
+ </div>
554
+
555
+ <!-- ADR-003 -->
556
+ <div class="adr-card">
557
+ <div class="adr-header" onclick="toggleADR(this)">
558
+ <span class="adr-id">ADR-003</span>
559
+ <span class="adr-decision">Guardrails: Custom prompts over LlamaGuard + Giskard</span>
560
+ <span class="adr-status accepted">Accepted</span>
561
+ <span class="adr-chevron">β–Ά</span>
562
+ </div>
563
+ <div class="adr-body">
564
+ <div class="adr-row"><span class="adr-row-label">Decision</span><span class="adr-row-value"><strong>5-layer custom prompt-based guardrails with similarity thresholds</strong></span></div>
565
+ <div class="adr-row"><span class="adr-row-label">Original</span><span class="adr-row-value"><span class="alt">LlamaGuard model + Giskard automated vulnerability scanning</span></span></div>
566
+ <div class="adr-row"><span class="adr-row-label">Why changed</span><span class="adr-row-value">LlamaGuard is a 7B safety model. Running it alongside Llama 3.2 3B doubles the active model memory footprint β€” infeasible on the demo environment and marginal on production hardware. Giskard is a testing framework, not a runtime guardrail β€” it belongs in CI/CD, not in the inference path. The 5-layer custom architecture delivers equivalent safety with zero additional models, using structured prompts (G1, G2, G5), float comparisons (G3), and keyword + embedding matching (G4). It is also more auditable: each refusal has a traceable, readable reason.</span></div>
567
+ <div class="adr-row"><span class="adr-row-label">Trade-off</span><span class="adr-row-value"><span class="pro">βœ“ No RAM overhead Β· Auditable refusal reasons Β· Tunable without model retraining</span><br><span class="con">βœ— No adversarial jailbreak resistance vs. a dedicated safety model Β· LlamaGuard remains the production upgrade path</span></span></div>
568
+ <div class="adr-row"><span class="adr-row-label">Roadmap</span><span class="adr-row-value">Production v1.0 integrates LlamaGuard as G4.5 β€” running only when G4 Safety Flag triggers, not on every query. This bounded approach adds safety model coverage where stakes are highest without the memory overhead of always-on execution.</span></div>
569
+ </div>
570
+ </div>
571
+
572
+ <!-- ADR-004 -->
573
+ <div class="adr-card">
574
+ <div class="adr-header" onclick="toggleADR(this)">
575
+ <span class="adr-id">ADR-004</span>
576
+ <span class="adr-decision">Frontend: FastAPI + HTML over Streamlit</span>
577
+ <span class="adr-status accepted">Accepted</span>
578
+ <span class="adr-chevron">β–Ά</span>
579
+ </div>
580
+ <div class="adr-body">
581
+ <div class="adr-row"><span class="adr-row-label">Decision</span><span class="adr-row-value"><strong>FastAPI backend + single responsive HTML/CSS/JS page</strong></span></div>
582
+ <div class="adr-row"><span class="adr-row-label">Original</span><span class="adr-row-value"><span class="alt">Streamlit β€” specified in TECH_STACK.html</span></span></div>
583
+ <div class="adr-row"><span class="adr-row-label">Why changed</span><span class="adr-row-value">Streamlit renders a desktop-optimised layout that degrades severely on mobile. It cannot support the Web Speech API voice input natively. Its component model fights against the single-button, full-screen, one-handed UX required by a factory floor user. A plain HTML page served by FastAPI has zero mobile layout constraints, full access to browser APIs (including Web Speech API), loads in under 200ms, and works on any phone on the plant WiFi with no dependency on Streamlit's Python server overhead.</span></div>
584
+ <div class="adr-row"><span class="adr-row-label">Trade-off</span><span class="adr-row-value"><span class="pro">βœ“ Mobile-first Β· Voice API support Β· Fast load Β· No framework overhead</span><br><span class="con">βœ— More HTML/CSS code to maintain Β· No built-in Streamlit widgets for data visualisation</span></span></div>
585
+ </div>
586
+ </div>
587
+
588
+ <!-- ADR-005 -->
589
+ <div class="adr-card">
590
+ <div class="adr-header" onclick="toggleADR(this)">
591
+ <span class="adr-id">ADR-005</span>
592
+ <span class="adr-decision">Voice: Web Speech API over Whisper</span>
593
+ <span class="adr-status accepted">Accepted</span>
594
+ <span class="adr-chevron">β–Ά</span>
595
+ </div>
596
+ <div class="adr-body">
597
+ <div class="adr-row"><span class="adr-row-label">Decision</span><span class="adr-row-value"><strong>Web Speech API β€” native browser, no dependency</strong></span></div>
598
+ <div class="adr-row"><span class="adr-row-label">Considered</span><span class="adr-row-value"><span class="alt">OpenAI Whisper (local) Β· AssemblyAI Β· Deepgram</span></span></div>
599
+ <div class="adr-row"><span class="adr-row-label">Reasoning</span><span class="adr-row-value">Whisper local adds 1–3GB of model weight and 2–4 seconds of transcription latency per query. AssemblyAI and Deepgram send audio to external APIs β€” incompatible with the data sovereignty requirement. The Web Speech API runs in the browser, uses the device's native speech recognition engine (Google on Android, Apple on iOS), adds zero latency overhead, requires zero server resources, and is available on every modern smartphone without installation. For a query interface designed around short technical phrases ("E-04 error code", "spindle torque spec"), device-native recognition accuracy is sufficient.</span></div>
600
+ <div class="adr-row"><span class="adr-row-label">Trade-off</span><span class="adr-row-value"><span class="pro">βœ“ Zero latency Β· Zero cost Β· Zero server overhead Β· Works offline on device</span><br><span class="con">βœ— Requires active internet on device for Google/Apple STT backend Β· Accuracy lower on heavy accent or high noise vs. Whisper large-v3 Β· Production path: local Whisper for air-gapped facilities</span></span></div>
601
+ </div>
602
+ </div>
603
+
604
+ <!-- ADR-006 -->
605
+ <div class="adr-card">
606
+ <div class="adr-header" onclick="toggleADR(this)">
607
+ <span class="adr-id">ADR-006</span>
608
+ <span class="adr-decision">Hosting: HuggingFace Spaces over GCP / Render</span>
609
+ <span class="adr-status accepted">Accepted</span>
610
+ <span class="adr-chevron">β–Ά</span>
611
+ </div>
612
+ <div class="adr-body">
613
+ <div class="adr-row"><span class="adr-row-label">Decision</span><span class="adr-row-value"><strong>HuggingFace Spaces (Docker) for demo Β· GitHub Pages for frontend</strong></span></div>
614
+ <div class="adr-row"><span class="adr-row-label">Considered</span><span class="adr-row-value"><span class="alt">GCP e2-micro (free tier) Β· GCP e2-medium (credits) Β· Render.com free tier Β· Railway.app</span></span></div>
615
+ <div class="adr-row"><span class="adr-row-label">Reasoning</span><span class="adr-row-value">GCP e2-micro has 1GB RAM β€” insufficient for Ollama + ChromaDB + FastAPI. GCP e2-medium would consume free credits that are reserved for other portfolio projects. Render.com free tier spins down after 15 minutes of inactivity β€” a 30–60 second cold start in a live demo is a silent failure. HuggingFace Spaces supports Docker natively, stays warm on free tier, and offers free GPU allocation which makes Llama 3.2 3B inference responsive for demos. Railway.app provides $5/month free credits β€” viable but limited. HFS wins on warmth + Docker + GPU access.</span></div>
616
+ <div class="adr-row"><span class="adr-row-label">Portfolio note</span><span class="adr-row-value">The demo environment is not the production architecture. The production deployment model is an on-prem Docker container on a facility server. This distinction is documented in the portfolio: "Demo runs on HuggingFace Spaces free tier. In production this stack runs entirely on-prem β€” no data leaves the facility network."</span></div>
617
+ </div>
618
+ </div>
619
+
620
+ <!-- ADR-007 -->
621
+ <div class="adr-card">
622
+ <div class="adr-header" onclick="toggleADR(this)">
623
+ <span class="adr-id">ADR-007</span>
624
+ <span class="adr-decision">Vector store: ChromaDB over Pinecone / Weaviate</span>
625
+ <span class="adr-status accepted">Accepted</span>
626
+ <span class="adr-chevron">β–Ά</span>
627
+ </div>
628
+ <div class="adr-body">
629
+ <div class="adr-row"><span class="adr-row-label">Decision</span><span class="adr-row-value"><strong>ChromaDB β€” embedded, persistent, local</strong></span></div>
630
+ <div class="adr-row"><span class="adr-row-label">Considered</span><span class="adr-row-value"><span class="alt">Pinecone Β· Weaviate Β· pgvector Β· Qdrant</span></span></div>
631
+ <div class="adr-row"><span class="adr-row-label">Reasoning</span><span class="adr-row-value">Pinecone and Weaviate cloud are managed services β€” they send embeddings and query vectors to external servers, violating the data sovereignty invariant. pgvector requires PostgreSQL, adding an infrastructure dependency. Qdrant is a strong alternative but adds a separate server process. ChromaDB runs embedded in the Python process (or as a lightweight local server), persists to disk, requires no external service, and integrates natively with LlamaIndex. For a corpus of up to ~50,000 chunks (sufficient for a mid-size facility's documentation), ChromaDB's performance is more than adequate.</span></div>
632
+ <div class="adr-row"><span class="adr-row-label">Trade-off</span><span class="adr-row-value"><span class="pro">βœ“ Embedded Β· Zero external dependency Β· LlamaIndex native Β· Local persistence</span><br><span class="con">βœ— Not designed for corpora >1M chunks Β· No native distributed mode Β· Production at scale: Qdrant or Weaviate self-hosted</span></span></div>
633
+ </div>
634
+ </div>
635
+
636
+ <!-- ADR-008 -->
637
+ <div class="adr-card">
638
+ <div class="adr-header" onclick="toggleADR(this)">
639
+ <span class="adr-id">ADR-008</span>
640
+ <span class="adr-decision">Chunking: Procedural sections over token windows</span>
641
+ <span class="adr-status accepted">Accepted</span>
642
+ <span class="adr-chevron">β–Ά</span>
643
+ </div>
644
+ <div class="adr-body">
645
+ <div class="adr-row"><span class="adr-row-label">Decision</span><span class="adr-row-value"><strong>Section-aware procedural chunking β€” split at heading + procedure boundaries</strong></span></div>
646
+ <div class="adr-row"><span class="adr-row-label">Default</span><span class="adr-row-value"><span class="alt">Fixed token windows (512 or 1024 tokens) β€” LlamaIndex default</span></span></div>
647
+ <div class="adr-row"><span class="adr-row-label">Reasoning</span><span class="adr-row-value">Manufacturing documents are not uniform prose. They are structured as numbered procedures, each with discrete steps, torque specs, and safety warnings. A 512-token window that splits mid-procedure returns a chunk that begins at "Step 4" with no context for Steps 1–3. This produces retrieval that is syntactically correct but procedurally incomplete β€” and in a safety-critical context, an incomplete procedure is more dangerous than no answer. The chunking strategy splits at section headings and procedure boundaries, preserving the complete procedure as a single retrievable unit. Each chunk is tagged with document title, section number, and page range for the Citation Enforcer.</span></div>
648
+ <div class="adr-row"><span class="adr-row-label">Trade-off</span><span class="adr-row-value"><span class="pro">βœ“ Complete procedures in single chunks Β· Traceable citations Β· Safety-appropriate context</span><br><span class="con">βœ— Variable chunk sizes reduce retrieval consistency Β· Complex procedures may exceed context window Β· Requires PDF parsing quality (PyMuPDF)</span></span></div>
649
+ </div>
650
+ </div>
651
+
652
+ </div>
653
+ </section>
654
+
655
+ <!-- ══ 05 CHUNKING STRATEGY DIAGRAM ══ -->
656
+ <section>
657
+ <div class="section-label">05 β€” Chunking Strategy</div>
658
+ <h2 class="section-title">Why the default chunking <em>kills safety.</em></h2>
659
+ <p class="section-intro">Token-window chunking is the LlamaIndex default for a reason β€” it works well on uniform prose. Manufacturing procedure documents are not uniform prose. The chunking strategy is one of the most consequential decisions in the pipeline.</p>
660
+
661
+ <div class="chunk-compare scroll-reveal">
662
+ <div class="chunk-panel bad">
663
+ <div class="chunk-type">❌ Default β€” Token Window (512 tokens)</div>
664
+ <h4>Splits mid-procedure</h4>
665
+ <p>A 512-token window cuts wherever the token count runs out. In a 7-step bearing replacement procedure, this means the chunk may contain Steps 4–7 with no reference to the torque spec in Step 2 or the safety isolation in Step 1.</p>
666
+ <p>The retrieval returns a syntactically valid chunk. The response sounds confident. The procedure is incomplete. The fault recurs. The NCR is raised on Friday.</p>
667
+ <div class="chunk-example">
668
+ Chunk #247 (tokens 512–1024):<br><br>
669
+ "...tighten using appropriate torque. 5. Re-install bearing housing cover. 6. Reconnect spindle coolant lines. 7. Power on and verify fault cleared..."<br><br>
670
+ <span style="color: #ef4444;">↑ No torque value. No isolation step. Retrieved with 0.82 similarity.</span>
671
+ </div>
672
+ </div>
673
+ <div class="chunk-panel good">
674
+ <div class="chunk-type">βœ“ VaultRAG β€” Procedural Section Chunking</div>
675
+ <h4>Preserves complete procedures</h4>
676
+ <p>VaultRAG splits at section headings and procedure boundaries, keeping each numbered procedure intact as a single chunk. The complete 7-step procedure β€” including the torque spec in Step 2 and the isolation requirement in Step 1 β€” is retrieved as a unit.</p>
677
+ <p>The chunk is tagged with document, section, and page. The Citation Enforcer validates the reference. The response is complete, safe, and traceable.</p>
678
+ <div class="chunk-example">
679
+ Chunk: Haas VF-2SS Β· Section 18.4 Β· pp.247–249<br><br>
680
+ "18.4 E-04 Spindle Fault β€” Bearing Replacement<br>
681
+ 1. ISOLATE: Apply LOTO per SOP-ELEC-04 before proceeding.<br>
682
+ 2. Remove bearing housing. Torque spec: 45 Nm Β±2 Nm.<br>
683
+ 3–7. [complete procedure]"<br><br>
684
+ <span style="color: #10b981;">↑ Complete Β· Cited Β· Safety flag triggered by "LOTO"</span>
685
+ </div>
686
+ </div>
687
+ </div>
688
+ </section>
689
+
690
+ <!-- ══ 06 DEPLOYMENT MODEL ══ -->
691
+ <section>
692
+ <div class="section-label">06 β€” Deployment Model</div>
693
+ <h2 class="section-title">Three environments. <em>One codebase.</em></h2>
694
+ <p class="section-intro">VaultRAG runs identically across three environments. The same Docker image, the same application code, the same guardrail logic. What changes is the model size and the hardware. <code style="font-family:var(--font-mono);font-size:0.85em;background:var(--steel-700);padding:2px 8px;border-radius:2px;">docker-compose up</code> runs the entire stack anywhere.</p>
695
+
696
+ <div class="deploy-grid scroll-reveal">
697
+ <div class="deploy-card dev">
698
+ <div class="deploy-env">Environment β€” Local Dev</div>
699
+ <div class="deploy-name">Developer Machine</div>
700
+ <p class="deploy-body">Full stack runs locally. Ollama + nomic-embed-text + ChromaDB + FastAPI. Used for development, testing guardrail logic, and ingesting new document sets. Voice input via laptop browser microphone.</p>
701
+ <div class="deploy-specs">
702
+ <div class="deploy-spec">LLM<strong>Llama 3.2 3B</strong></div>
703
+ <div class="deploy-spec">RAM Required<strong>8GB minimum</strong></div>
704
+ <div class="deploy-spec">Network<strong>localhost</strong></div>
705
+ <div class="deploy-spec">Start<strong>docker-compose up</strong></div>
706
+ </div>
707
+ </div>
708
+ <div class="deploy-card demo">
709
+ <div class="deploy-env">Environment β€” Portfolio Demo</div>
710
+ <div class="deploy-name">HuggingFace Spaces</div>
711
+ <p class="deploy-body">Dockerised stack on HF Spaces free tier with GPU allocation. Frontend served via GitHub Pages. Demo environment β€” warm, accessible, free. Includes caveat: data sovereignty only applies in on-prem deployment.</p>
712
+ <div class="deploy-specs">
713
+ <div class="deploy-spec">LLM<strong>Llama 3.2 3B</strong></div>
714
+ <div class="deploy-spec">Backend<strong>HuggingFace Spaces</strong></div>
715
+ <div class="deploy-spec">Frontend<strong>GitHub Pages</strong></div>
716
+ <div class="deploy-spec">Cost<strong>Β£0 / month</strong></div>
717
+ </div>
718
+ </div>
719
+ <div class="deploy-card prod">
720
+ <div class="deploy-env">Environment β€” Production</div>
721
+ <div class="deploy-name">On-Prem Facility Server</div>
722
+ <p class="deploy-body">Same Docker image. Facility server on plant LAN. Technicians access via plant WiFi from any phone. No internet required after model download. Documents never leave the facility. Full data sovereignty guaranteed by architecture.</p>
723
+ <div class="deploy-specs">
724
+ <div class="deploy-spec">LLM<strong>Llama 3.1 8B+</strong></div>
725
+ <div class="deploy-spec">RAM Recommended<strong>32GB</strong></div>
726
+ <div class="deploy-spec">Network<strong>Plant LAN only</strong></div>
727
+ <div class="deploy-spec">Egress<strong>Zero after setup</strong></div>
728
+ </div>
729
+ </div>
730
+ </div>
731
+
732
+ <!-- Deployment flow diagram -->
733
+ <div class="diagram-wrap scroll-reveal">
734
+ <div class="diagram-label amber">Deployment flow β€” local dev to production Β· single Docker image</div>
735
+ <svg viewBox="0 0 960 160" xmlns="http://www.w3.org/2000/svg" font-family="'JetBrains Mono',monospace" width="100%" style="position:relative;z-index:1;">
736
+ <defs>
737
+ <marker id="arr-d" markerWidth="7" markerHeight="7" refX="5" refY="3" orient="auto"><path d="M0,0 L0,6 L7,3 z" fill="#f59e0b" opacity="0.8"/></marker>
738
+ </defs>
739
+ <!-- Dev -->
740
+ <rect x="10" y="20" width="180" height="120" rx="4" fill="#161c27" stroke="#3b82f6" stroke-width="1.5"/>
741
+ <rect x="10" y="20" width="180" height="3" fill="#3b82f6" rx="2"/>
742
+ <text x="100" y="44" text-anchor="middle" font-size="7.5" fill="#60a5fa" letter-spacing="1.5">LOCAL DEV</text>
743
+ <text x="100" y="62" text-anchor="middle" font-size="8" fill="#e2e8f0">Developer machine</text>
744
+ <text x="100" y="78" text-anchor="middle" font-size="7" fill="#718096">docker-compose up</text>
745
+ <text x="100" y="94" text-anchor="middle" font-size="7" fill="#718096">localhost:8000</text>
746
+ <text x="100" y="110" text-anchor="middle" font-size="7" fill="#4a5568">Llama 3.2 3B Β· 8GB RAM</text>
747
+ <text x="100" y="128" text-anchor="middle" font-size="6.5" fill="#4a5568">Full guardrail testing</text>
748
+
749
+ <!-- Arrow: dev β†’ GitHub -->
750
+ <line x1="190" y1="80" x2="240" y2="80" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arr-d)"/>
751
+ <text x="215" y="72" text-anchor="middle" font-size="6.5" fill="#d97706">git push</text>
752
+
753
+ <!-- GitHub -->
754
+ <rect x="240" y="20" width="160" height="120" rx="4" fill="#161c27" stroke="#344057"/>
755
+ <text x="320" y="44" text-anchor="middle" font-size="7.5" fill="#a0aec0" letter-spacing="1.5">GITHUB</text>
756
+ <text x="320" y="62" text-anchor="middle" font-size="8" fill="#e2e8f0">Source + Dockerfile</text>
757
+ <text x="320" y="78" text-anchor="middle" font-size="7" fill="#718096">GitHub Actions CI</text>
758
+ <text x="320" y="94" text-anchor="middle" font-size="7" fill="#718096">Linting + tests</text>
759
+ <text x="320" y="112" text-anchor="middle" font-size="7" fill="#4a5568">GitHub Pages (frontend)</text>
760
+
761
+ <!-- Arrow: GitHub β†’ HF Spaces -->
762
+ <line x1="400" y1="80" x2="450" y2="80" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arr-d)"/>
763
+ <text x="425" y="72" text-anchor="middle" font-size="6.5" fill="#d97706">deploy</text>
764
+
765
+ <!-- HF Spaces -->
766
+ <rect x="450" y="20" width="180" height="120" rx="4" fill="#161c27" stroke="#f59e0b" stroke-width="1.5"/>
767
+ <rect x="450" y="20" width="180" height="3" fill="#f59e0b" rx="2"/>
768
+ <text x="540" y="44" text-anchor="middle" font-size="7.5" fill="#f59e0b" letter-spacing="1.5">HF SPACES DEMO</text>
769
+ <text x="540" y="62" text-anchor="middle" font-size="8" fill="#e2e8f0">Portfolio demo</text>
770
+ <text x="540" y="78" text-anchor="middle" font-size="7" fill="#718096">Docker container</text>
771
+ <text x="540" y="94" text-anchor="middle" font-size="7" fill="#718096">Free GPU tier</text>
772
+ <text x="540" y="110" text-anchor="middle" font-size="7" fill="#4a5568">Publicly accessible</text>
773
+ <text x="540" y="128" text-anchor="middle" font-size="6.5" fill="#d97706">⚠ Demo only β€” not air-gapped</text>
774
+
775
+ <!-- Arrow: same image β†’ prod -->
776
+ <line x1="630" y1="80" x2="680" y2="80" stroke="#10b981" stroke-width="1.5" marker-end="url(#arr-d)"/>
777
+ <text x="655" y="72" text-anchor="middle" font-size="6.5" fill="#34d399">same image</text>
778
+
779
+ <!-- On-prem -->
780
+ <rect x="680" y="20" width="270" height="120" rx="4" fill="#161c27" stroke="#10b981" stroke-width="1.5"/>
781
+ <rect x="680" y="20" width="270" height="3" fill="#10b981" rx="2"/>
782
+ <text x="815" y="44" text-anchor="middle" font-size="7.5" fill="#34d399" letter-spacing="1.5">ON-PREM PRODUCTION</text>
783
+ <text x="815" y="62" text-anchor="middle" font-size="8" fill="#e2e8f0">Facility server Β· plant LAN</text>
784
+ <text x="815" y="78" text-anchor="middle" font-size="7" fill="#718096">docker-compose up (same command)</text>
785
+ <text x="815" y="94" text-anchor="middle" font-size="7" fill="#718096">Llama 3.1 8B+ Β· 32GB RAM</text>
786
+ <text x="815" y="110" text-anchor="middle" font-size="7" fill="#4a5568">Zero internet after model download</text>
787
+ <text x="815" y="128" text-anchor="middle" font-size="7" fill="#34d399">βœ“ Full data sovereignty</text>
788
+ </svg>
789
+ </div>
790
+ </section>
791
+
792
+ <!-- ══ 07 FULL STACK SUMMARY ══ -->
793
+ <section>
794
+ <div class="section-label">07 β€” Stack Summary</div>
795
+ <h2 class="section-title">The canonical stack. <em>No contradictions.</em></h2>
796
+ <p class="section-intro">The original VaultRAG notes contained redundant and conflicting component choices. This is the resolved, canonical stack for v0.1 MVP β€” every component justified, every dropped component explained.</p>
797
+
798
+ <div class="stack-table-wrap scroll-reveal">
799
+ <div class="stack-table-header">VaultRAG v0.1 β€” Canonical technology stack</div>
800
+ <table>
801
+ <thead>
802
+ <tr><th>Layer</th><th>Component</th><th>Role</th><th>Status vs. Original</th><th>ADR</th></tr>
803
+ </thead>
804
+ <tbody>
805
+ <tr>
806
+ <td>LLM</td>
807
+ <td><span class="td-component">Ollama Β· Llama 3.2 3B</span></td>
808
+ <td>Local inference. Structured response generation. Port 11434.</td>
809
+ <td><span class="td-tag changed">Changed from 3.1 8B</span></td>
810
+ <td>ADR-001</td>
811
+ </tr>
812
+ <tr>
813
+ <td>Embeddings</td>
814
+ <td><span class="td-component">nomic-embed-text</span></td>
815
+ <td>Document and query embedding via Ollama. No separate process.</td>
816
+ <td><span class="td-tag changed">Replaces Sentence-BERT</span></td>
817
+ <td>ADR-002</td>
818
+ </tr>
819
+ <tr>
820
+ <td>Vector Store</td>
821
+ <td><span class="td-component">ChromaDB</span></td>
822
+ <td>Persistent local vector store. Embedded in Python process.</td>
823
+ <td><span class="td-tag kept">Kept from original</span></td>
824
+ <td>ADR-007</td>
825
+ </tr>
826
+ <tr>
827
+ <td>RAG Framework</td>
828
+ <td><span class="td-component">LlamaIndex</span></td>
829
+ <td>Orchestration, ingestion pipeline, query engine, response synthesis.</td>
830
+ <td><span class="td-tag kept">Kept from original</span></td>
831
+ <td>β€”</td>
832
+ </tr>
833
+ <tr>
834
+ <td>Guardrails</td>
835
+ <td><span class="td-component">5-layer custom prompts</span></td>
836
+ <td>G1–G5: normalise, scope, confidence, safety, citation.</td>
837
+ <td><span class="td-tag changed">Replaces LlamaGuard + Giskard</span></td>
838
+ <td>ADR-003</td>
839
+ </tr>
840
+ <tr>
841
+ <td>Document parsing</td>
842
+ <td><span class="td-component">PyMuPDF</span></td>
843
+ <td>PDF text extraction with section boundary detection.</td>
844
+ <td><span class="td-tag kept">Kept from original</span></td>
845
+ <td>ADR-008</td>
846
+ </tr>
847
+ <tr>
848
+ <td>Voice input</td>
849
+ <td><span class="td-component">Web Speech API</span></td>
850
+ <td>Browser-native STT. Zero install, zero server overhead.</td>
851
+ <td><span class="td-tag changed">New β€” not in original notes</span></td>
852
+ <td>ADR-005</td>
853
+ </tr>
854
+ <tr>
855
+ <td>Backend</td>
856
+ <td><span class="td-component">FastAPI</span></td>
857
+ <td>HTTP server. Serves API + static frontend. localhost:8000.</td>
858
+ <td><span class="td-tag changed">Replaces Streamlit</span></td>
859
+ <td>ADR-004</td>
860
+ </tr>
861
+ <tr>
862
+ <td>Frontend</td>
863
+ <td><span class="td-component">HTML / CSS / JS</span></td>
864
+ <td>Single mobile-responsive page. Voice button. Chat interface.</td>
865
+ <td><span class="td-tag changed">Replaces Streamlit UI</span></td>
866
+ <td>ADR-004</td>
867
+ </tr>
868
+ <tr>
869
+ <td>Containerisation</td>
870
+ <td><span class="td-component">Docker + Compose</span></td>
871
+ <td>Single-command deployment across dev, demo, and production.</td>
872
+ <td><span class="td-tag kept">Kept from original</span></td>
873
+ <td>β€”</td>
874
+ </tr>
875
+ <tr>
876
+ <td style="color:var(--steel-500)">Dropped</td>
877
+ <td style="color:var(--steel-500)"><s>LlamaGuard</s></td>
878
+ <td style="color:var(--steel-500)">RAM infeasible alongside 3B LLM on free tier. Roadmap item.</td>
879
+ <td><span class="td-tag dropped">Dropped from MVP</span></td>
880
+ <td>ADR-003</td>
881
+ </tr>
882
+ <tr>
883
+ <td style="color:var(--steel-500)">Dropped</td>
884
+ <td style="color:var(--steel-500)"><s>Giskard</s></td>
885
+ <td style="color:var(--steel-500)">Testing framework, not runtime guardrail. Belongs in CI/CD pipeline.</td>
886
+ <td><span class="td-tag dropped">Dropped from MVP</span></td>
887
+ <td>ADR-003</td>
888
+ </tr>
889
+ <tr>
890
+ <td style="color:var(--steel-500)">Dropped</td>
891
+ <td style="color:var(--steel-500)"><s>Sentence-BERT</s></td>
892
+ <td style="color:var(--steel-500)">Redundant with nomic-embed-text. Separate process with no quality advantage.</td>
893
+ <td><span class="td-tag dropped">Dropped from MVP</span></td>
894
+ <td>ADR-002</td>
895
+ </tr>
896
+ <tr>
897
+ <td style="color:var(--steel-500)">Dropped</td>
898
+ <td style="color:var(--steel-500)"><s>Streamlit</s></td>
899
+ <td style="color:var(--steel-500)">Desktop-only. No Web Speech API. Incompatible with factory floor UX.</td>
900
+ <td><span class="td-tag dropped">Dropped from MVP</span></td>
901
+ <td>ADR-004</td>
902
+ </tr>
903
+ </tbody>
904
+ </table>
905
+ </div>
906
+
907
+ <div style="text-align:center; margin-top: 32px;">
908
+ <a href="page-04.html" class="btn btn-primary">Watch it run β†’ Workflow Simulator</a>
909
+ </div>
910
+ </section>
911
+
912
+ <!-- PAGE NAV -->
913
+ <div class="page-nav">
914
+ <a class="page-nav-link" href="page-02.html"><span class="page-nav-label">← Previous</span><span>The Problem</span></a>
915
+ <a class="page-nav-link next" href="page-04.html"><span class="page-nav-label">Next β†’</span><span>Workflow Simulator</span></a>
916
+ </div>
917
+
918
+ <footer>
919
+ <p>VaultRAG Β· Architecture Portfolio Β· 2026 Β· <a href="https://github.com/raosiddharthp/VaultRAG">GitHub</a></p>
920
+ <p>Page 03 Β· Architecture & Design Β· Β© 2026 Siddharth Rao</p>
921
+ </footer>
922
+
923
+ <script>
924
+ function toggleADR(header) {
925
+ const body = header.nextElementSibling;
926
+ const chevron = header.querySelector('.adr-chevron');
927
+ const isOpen = body.classList.contains('open');
928
+ // close all
929
+ document.querySelectorAll('.adr-body').forEach(b => b.classList.remove('open'));
930
+ document.querySelectorAll('.adr-chevron').forEach(c => c.classList.remove('open'));
931
+ // open clicked if it was closed
932
+ if (!isOpen) { body.classList.add('open'); chevron.classList.add('open'); }
933
+ }
934
+
935
+ const reveals = document.querySelectorAll('.scroll-reveal');
936
+ const obs = new IntersectionObserver(entries => {
937
+ entries.forEach(e => { if (e.isIntersecting) { e.target.classList.add('visible'); obs.unobserve(e.target); } });
938
+ }, { threshold: 0.06 });
939
+ reveals.forEach(el => obs.observe(el));
940
+ </script>
941
+ </body>
942
+ </html>
page-04.html ADDED
@@ -0,0 +1,904 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>VaultRAG β€” Workflow Simulator</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap" rel="stylesheet">
10
+ <style>
11
+ :root {
12
+ --steel-900:#0e1117;--steel-800:#161c27;--steel-700:#1e2535;
13
+ --steel-600:#262f42;--steel-500:#344057;--steel-400:#4a5568;
14
+ --steel-300:#718096;--steel-200:#a0aec0;--steel-100:#cbd5e0;
15
+ --amber-500:#f59e0b;--amber-400:#fbbf24;--amber-600:#d97706;
16
+ --danger:#ef4444;--success:#10b981;--info:#3b82f6;--purple:#8b5cf6;
17
+ --font-display:'Barlow Condensed',sans-serif;
18
+ --font-body:'Barlow',sans-serif;
19
+ --font-mono:'JetBrains Mono',monospace;
20
+ }
21
+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
22
+ html{scroll-behavior:smooth;}
23
+ body{background:var(--steel-900);color:var(--steel-100);font-family:var(--font-body);font-size:16px;line-height:1.6;overflow-x:hidden;}
24
+ body::before{content:'';position:fixed;inset:0;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");pointer-events:none;z-index:0;opacity:0.4;}
25
+
26
+ nav{position:fixed;top:0;left:0;right:0;z-index:100;display:flex;align-items:center;justify-content:space-between;padding:0 48px;height:64px;background:rgba(14,17,23,0.94);backdrop-filter:blur(12px);border-bottom:1px solid rgba(245,158,11,0.15);}
27
+ .nav-brand{font-family:var(--font-display);font-weight:700;font-size:1.2rem;letter-spacing:0.08em;color:var(--amber-400);text-decoration:none;}
28
+ .nav-brand span{color:var(--steel-300);font-weight:300;}
29
+ nav ul{display:flex;gap:24px;list-style:none;}
30
+ nav a{font-family:var(--font-mono);font-size:0.68rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--steel-300);text-decoration:none;transition:color 0.2s;}
31
+ nav a:hover,nav a.active{color:var(--amber-400);}
32
+ .nav-github{color:var(--amber-400)!important;border:1px solid var(--amber-500);padding:6px 14px;border-radius:2px;}
33
+ .nav-github:hover{background:var(--amber-500)!important;color:var(--steel-900)!important;}
34
+
35
+ .page-header{padding:120px 48px 56px;position:relative;z-index:1;border-bottom:1px solid var(--steel-700);background:linear-gradient(180deg,rgba(245,158,11,0.04) 0%,transparent 100%);}
36
+ .page-header::after{content:'';position:absolute;inset:0;background-image:linear-gradient(rgba(245,158,11,0.025) 1px,transparent 1px),linear-gradient(90deg,rgba(245,158,11,0.025) 1px,transparent 1px);background-size:60px 60px;pointer-events:none;}
37
+ .breadcrumb{font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--steel-400);margin-bottom:16px;display:flex;align-items:center;gap:8px;}
38
+ .breadcrumb a{color:var(--steel-400);text-decoration:none;}
39
+ .breadcrumb a:hover{color:var(--amber-400);}
40
+ .breadcrumb span{color:var(--steel-600);}
41
+ .page-number{font-family:var(--font-display);font-size:7rem;font-weight:800;color:rgba(245,158,11,0.06);line-height:1;position:absolute;right:48px;top:80px;pointer-events:none;}
42
+ .page-title{font-family:var(--font-display);font-size:clamp(2.8rem,5.5vw,5rem);font-weight:800;line-height:0.95;margin-bottom:20px;max-width:800px;}
43
+ .page-title em{font-style:italic;font-weight:300;color:var(--amber-400);}
44
+ .page-intro{font-size:1rem;color:var(--steel-200);max-width:680px;line-height:1.8;}
45
+
46
+ /* ── SIMULATOR SHELL ── */
47
+ .sim-wrap{position:relative;z-index:1;padding:56px 48px;}
48
+
49
+ /* SCENARIO SELECTOR */
50
+ .scenario-bar{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;padding:28px 32px;margin-bottom:32px;}
51
+ .scenario-bar-label{font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.18em;text-transform:uppercase;color:var(--steel-300);margin-bottom:16px;}
52
+ .scenario-buttons{display:flex;gap:8px;flex-wrap:wrap;}
53
+ .scenario-btn{font-family:var(--font-mono);font-size:0.7rem;letter-spacing:0.08em;text-transform:uppercase;padding:10px 20px;border-radius:3px;border:1px solid var(--steel-500);background:transparent;color:var(--steel-300);cursor:pointer;transition:all 0.2s;}
54
+ .scenario-btn:hover{border-color:var(--amber-500);color:var(--amber-400);}
55
+ .scenario-btn.active{background:var(--amber-500);border-color:var(--amber-500);color:var(--steel-900);font-weight:700;}
56
+ .scenario-btn.danger.active{background:var(--danger);border-color:var(--danger);color:#fff;}
57
+ .scenario-btn.success.active{background:var(--success);border-color:var(--success);color:#fff;}
58
+ .scenario-btn.info.active{background:var(--info);border-color:var(--info);color:#fff;}
59
+
60
+ .run-btn{display:flex;align-items:center;gap:10px;margin-top:20px;padding:14px 32px;background:var(--amber-500);color:var(--steel-900);border:none;border-radius:3px;font-family:var(--font-mono);font-size:0.8rem;font-weight:700;letter-spacing:0.12em;text-transform:uppercase;cursor:pointer;transition:all 0.2s;}
61
+ .run-btn:hover{background:var(--amber-400);}
62
+ .run-btn:disabled{background:var(--steel-600);color:var(--steel-400);cursor:not-allowed;}
63
+ .run-btn .btn-icon{font-size:1rem;transition:transform 0.3s;}
64
+ .run-btn.running .btn-icon{animation:spin 1s linear infinite;}
65
+ @keyframes spin{to{transform:rotate(360deg);}}
66
+
67
+ /* MAIN SIMULATOR GRID */
68
+ .sim-grid{display:grid;grid-template-columns:340px 1fr;gap:16px;align-items:start;}
69
+
70
+ /* LEFT: PIPELINE STEPS */
71
+ .pipeline-panel{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;overflow:hidden;position:sticky;top:80px;}
72
+ .pipeline-header{padding:18px 24px;background:var(--steel-700);border-bottom:1px solid var(--steel-600);font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.18em;text-transform:uppercase;color:var(--amber-400);display:flex;justify-content:space-between;align-items:center;}
73
+ .timer-display{font-family:var(--font-mono);font-size:0.75rem;color:var(--amber-500);letter-spacing:0.1em;}
74
+
75
+ .pipeline-steps-list{padding:0;}
76
+ .pipe-step{display:flex;align-items:flex-start;gap:14px;padding:16px 20px;border-bottom:1px solid var(--steel-700);opacity:0.35;transition:all 0.4s;}
77
+ .pipe-step:last-child{border-bottom:none;}
78
+ .pipe-step.active{opacity:1;background:rgba(245,158,11,0.04);}
79
+ .pipe-step.done{opacity:0.8;}
80
+ .pipe-step.done.pass .step-dot{background:var(--success);border-color:var(--success);box-shadow:0 0 6px rgba(16,185,129,0.5);}
81
+ .pipe-step.done.warn .step-dot{background:var(--amber-500);border-color:var(--amber-500);box-shadow:0 0 6px rgba(245,158,11,0.5);}
82
+ .pipe-step.done.fail .step-dot{background:var(--danger);border-color:var(--danger);box-shadow:0 0 6px rgba(239,68,68,0.5);}
83
+ .pipe-step.active .step-dot{border-color:var(--amber-500);animation:pulse-dot 1s ease-in-out infinite;}
84
+ @keyframes pulse-dot{0%,100%{box-shadow:0 0 0 0 rgba(245,158,11,0.5);}50%{box-shadow:0 0 0 5px rgba(245,158,11,0);}}
85
+ .step-dot{width:10px;height:10px;border-radius:50%;border:2px solid var(--steel-500);background:var(--steel-700);flex-shrink:0;margin-top:4px;transition:all 0.3s;}
86
+ .step-info{flex:1;min-width:0;}
87
+ .step-name{font-family:var(--font-mono);font-size:0.68rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--steel-200);margin-bottom:3px;}
88
+ .pipe-step.active .step-name{color:var(--amber-400);}
89
+ .step-detail{font-size:0.78rem;color:var(--steel-400);line-height:1.45;}
90
+ .step-time{font-family:var(--font-mono);font-size:0.6rem;color:var(--steel-500);margin-top:4px;}
91
+ .pipe-step.done .step-time{color:var(--success);}
92
+ .pipe-step.done.fail .step-time{color:var(--danger);}
93
+
94
+ /* RIGHT: OUTPUT PANEL */
95
+ .output-panel{display:flex;flex-direction:column;gap:16px;}
96
+
97
+ /* VOICE TRANSCRIPT */
98
+ .voice-card{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;overflow:hidden;}
99
+ .voice-header{padding:14px 20px;background:var(--steel-700);border-bottom:1px solid var(--steel-600);display:flex;align-items:center;gap:10px;}
100
+ .voice-dot{width:8px;height:8px;border-radius:50%;background:var(--steel-500);}
101
+ .voice-dot.active{background:var(--danger);box-shadow:0 0 8px var(--danger);animation:pulse-dot 0.8s ease-in-out infinite;}
102
+ .voice-label{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--steel-300);}
103
+ .voice-body{padding:20px;min-height:56px;display:flex;align-items:center;}
104
+ .voice-text{font-family:var(--font-mono);font-size:0.85rem;color:var(--steel-100);line-height:1.5;}
105
+ .voice-text.speaking{color:var(--amber-400);}
106
+ .voice-placeholder{font-family:var(--font-mono);font-size:0.78rem;color:var(--steel-500);font-style:italic;}
107
+
108
+ /* RETRIEVAL CARD */
109
+ .retrieval-card{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;overflow:hidden;display:none;}
110
+ .retrieval-card.visible{display:block;}
111
+ .ret-header{padding:14px 20px;background:var(--steel-700);border-bottom:1px solid var(--steel-600);font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--info);display:flex;justify-content:space-between;}
112
+ .ret-body{padding:16px 20px;display:flex;flex-direction:column;gap:8px;}
113
+ .chunk-item{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;padding:10px 14px;background:var(--steel-700);border-radius:3px;border-left:3px solid var(--steel-500);}
114
+ .chunk-item.top{border-color:var(--info);}
115
+ .chunk-ref{font-family:var(--font-mono);font-size:0.68rem;color:var(--steel-200);}
116
+ .chunk-score{font-family:var(--font-mono);font-size:0.72rem;font-weight:700;}
117
+ .chunk-score.high{color:var(--success);}
118
+ .chunk-score.mid{color:var(--amber-400);}
119
+ .chunk-score.low{color:var(--danger);}
120
+ .chunk-preview{font-size:0.78rem;color:var(--steel-400);margin-top:4px;line-height:1.4;font-style:italic;}
121
+
122
+ /* GUARDRAIL STATUS */
123
+ .guardrail-card{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;overflow:hidden;display:none;}
124
+ .guardrail-card.visible{display:block;}
125
+ .g-header{padding:14px 20px;background:var(--steel-700);border-bottom:1px solid var(--steel-600);font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--amber-400);}
126
+ .g-rows{padding:12px 16px;display:flex;flex-direction:column;gap:6px;}
127
+ .g-row{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:3px;background:var(--steel-700);opacity:0.4;transition:all 0.3s;}
128
+ .g-row.active{opacity:1;background:rgba(245,158,11,0.07);border:1px solid rgba(245,158,11,0.2);}
129
+ .g-row.pass{opacity:0.9;background:rgba(16,185,129,0.07);border:1px solid rgba(16,185,129,0.2);}
130
+ .g-row.fail{opacity:1;background:rgba(239,68,68,0.1);border:1px solid rgba(239,68,68,0.3);}
131
+ .g-row.warn{opacity:1;background:rgba(245,158,11,0.1);border:1px solid rgba(245,158,11,0.3);}
132
+ .g-badge{font-family:var(--font-mono);font-size:0.58rem;letter-spacing:0.1em;text-transform:uppercase;padding:2px 7px;border-radius:2px;white-space:nowrap;}
133
+ .g-row.active .g-badge{background:rgba(245,158,11,0.2);color:var(--amber-400);}
134
+ .g-row.pass .g-badge{background:rgba(16,185,129,0.2);color:var(--success);}
135
+ .g-row.fail .g-badge{background:rgba(239,68,68,0.2);color:var(--danger);}
136
+ .g-row.warn .g-badge{background:rgba(245,158,11,0.2);color:var(--amber-400);}
137
+ .g-name{font-family:var(--font-mono);font-size:0.7rem;color:var(--steel-200);flex:1;}
138
+ .g-detail{font-size:0.75rem;color:var(--steel-400);}
139
+
140
+ /* RESPONSE CARD */
141
+ .response-card{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;overflow:hidden;display:none;}
142
+ .response-card.visible{display:block;}
143
+ .resp-header{padding:14px 20px;background:var(--steel-700);border-bottom:1px solid var(--steel-600);display:flex;justify-content:space-between;align-items:center;}
144
+ .resp-header-left{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.15em;text-transform:uppercase;}
145
+ .resp-header-left.success-label{color:var(--success);}
146
+ .resp-header-left.danger-label{color:var(--danger);}
147
+ .resp-header-left.warn-label{color:var(--amber-400);}
148
+ .resp-sla{font-family:var(--font-mono);font-size:0.65rem;color:var(--steel-400);}
149
+ .resp-body{padding:24px;}
150
+
151
+ /* Safety banner */
152
+ .safety-banner{background:rgba(239,68,68,0.1);border:1px solid rgba(239,68,68,0.4);border-radius:3px;padding:12px 16px;margin-bottom:16px;display:flex;align-items:flex-start;gap:10px;}
153
+ .safety-banner-icon{font-size:1rem;flex-shrink:0;}
154
+ .safety-banner-text{font-family:var(--font-mono);font-size:0.72rem;color:var(--danger);line-height:1.5;letter-spacing:0.03em;}
155
+
156
+ /* Response text */
157
+ .resp-text{font-size:0.9rem;color:var(--steel-100);line-height:1.8;white-space:pre-wrap;}
158
+ .resp-text .step-num{color:var(--amber-400);font-weight:700;}
159
+ .resp-citation{margin-top:20px;padding:12px 16px;background:var(--steel-700);border-radius:3px;border-left:3px solid var(--info);}
160
+ .resp-citation-label{font-family:var(--font-mono);font-size:0.6rem;letter-spacing:0.12em;text-transform:uppercase;color:var(--info);margin-bottom:4px;}
161
+ .resp-citation-text{font-family:var(--font-mono);font-size:0.72rem;color:var(--steel-200);line-height:1.5;}
162
+
163
+ /* Refusal card */
164
+ .refusal-box{background:rgba(239,68,68,0.07);border:1px solid rgba(239,68,68,0.3);border-radius:3px;padding:20px;}
165
+ .refusal-icon{font-size:1.4rem;margin-bottom:8px;}
166
+ .refusal-title{font-family:var(--font-display);font-size:1.2rem;font-weight:700;color:var(--danger);margin-bottom:8px;}
167
+ .refusal-body{font-size:0.88rem;color:var(--steel-300);line-height:1.7;}
168
+ .refusal-reason{margin-top:12px;font-family:var(--font-mono);font-size:0.7rem;color:var(--steel-400);padding:8px 12px;background:var(--steel-800);border-radius:2px;}
169
+
170
+ /* SCENARIO DESCRIPTION */
171
+ .scenario-desc{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;padding:24px 28px;margin-bottom:24px;}
172
+ .scenario-desc-label{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--amber-500);margin-bottom:8px;}
173
+ .scenario-desc-title{font-family:var(--font-display);font-size:1.4rem;font-weight:700;color:#fff;margin-bottom:8px;}
174
+ .scenario-desc-body{font-size:0.88rem;color:var(--steel-300);line-height:1.7;}
175
+
176
+ /* HOW IT WORKS SECTION */
177
+ .how-it-works{position:relative;z-index:1;padding:56px 48px;border-top:1px solid var(--steel-800);}
178
+ .section-label{font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.2em;text-transform:uppercase;color:var(--amber-500);margin-bottom:14px;display:flex;align-items:center;gap:10px;}
179
+ .section-label::after{content:'';flex:1;max-width:50px;height:1px;background:var(--amber-600);}
180
+ .section-title{font-family:var(--font-display);font-size:clamp(1.8rem,3vw,2.5rem);font-weight:700;color:#fff;margin-bottom:14px;}
181
+ .section-title em{font-style:italic;font-weight:300;color:var(--amber-400);}
182
+ .steps-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:2px;background:var(--steel-700);border-radius:4px;overflow:hidden;margin-top:48px;}
183
+ .how-step{background:var(--steel-800);padding:32px 24px;position:relative;}
184
+ .how-step-num{font-family:var(--font-display);font-size:3rem;font-weight:800;color:rgba(245,158,11,0.1);line-height:1;margin-bottom:12px;}
185
+ .how-step-title{font-family:var(--font-display);font-size:1.1rem;font-weight:700;color:#fff;margin-bottom:8px;}
186
+ .how-step-body{font-size:0.82rem;color:var(--steel-300);line-height:1.65;}
187
+ .how-step-time{margin-top:12px;font-family:var(--font-mono);font-size:0.62rem;color:var(--amber-600);padding:4px 8px;border:1px solid rgba(245,158,11,0.2);border-radius:2px;display:inline-block;}
188
+
189
+ /* PAGE NAV */
190
+ .page-nav{display:flex;justify-content:space-between;align-items:center;padding:40px 48px;border-top:1px solid var(--steel-700);}
191
+ .page-nav-link{font-family:var(--font-mono);font-size:0.7rem;letter-spacing:0.1em;text-transform:uppercase;text-decoration:none;color:var(--steel-300);display:flex;flex-direction:column;gap:6px;transition:color 0.2s;}
192
+ .page-nav-link:hover{color:var(--amber-400);}
193
+ .page-nav-label{font-size:0.6rem;color:var(--steel-500);}
194
+ .page-nav-link.next{text-align:right;}
195
+ .btn{font-family:var(--font-mono);font-size:0.7rem;letter-spacing:0.1em;text-transform:uppercase;text-decoration:none;padding:12px 24px;border-radius:2px;transition:all 0.2s;display:inline-flex;align-items:center;gap:8px;}
196
+ .btn-primary{background:var(--amber-500);color:var(--steel-900);font-weight:700;}
197
+ .btn-primary:hover{background:var(--amber-400);}
198
+
199
+ footer{padding:40px 48px;display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--steel-800);}
200
+ footer p{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.1em;color:var(--steel-500);text-transform:uppercase;}
201
+ footer a{color:var(--steel-400);text-decoration:none;}
202
+ footer a:hover{color:var(--amber-400);}
203
+
204
+ @media(max-width:900px){
205
+ nav{padding:0 20px;} nav ul{display:none;}
206
+ .page-header{padding:100px 24px 48px;} .page-number{display:none;}
207
+ .sim-wrap,.how-it-works{padding:40px 24px;}
208
+ .sim-grid{grid-template-columns:1fr;}
209
+ .pipeline-panel{position:static;}
210
+ .steps-grid{grid-template-columns:1fr 1fr;}
211
+ .page-nav{padding:28px 24px;}
212
+ footer{padding:28px 24px;flex-direction:column;gap:12px;text-align:center;}
213
+ }
214
+ </style>
215
+ </head>
216
+ <body>
217
+
218
+ <nav>
219
+ <a class="nav-brand" href="index.html">VAULT<span>RAG</span></a>
220
+ <ul>
221
+ <li><a href="index.html">Overview</a></li>
222
+ <li><a href="page-02.html">The Problem</a></li>
223
+ <li><a href="page-03.html">Architecture</a></li>
224
+ <li><a href="page-04.html" class="active">Simulator</a></li>
225
+ <li><a href="page-05.html">Cost Model</a></li>
226
+ <li><a href="page-06.html">Roadmap</a></li>
227
+ <li><a href="https://github.com/raosiddharthp/VaultRAG" class="nav-github">GitHub β†’</a></li>
228
+ </ul>
229
+ </nav>
230
+
231
+ <div class="page-header">
232
+ <div class="page-number">04</div>
233
+ <div class="breadcrumb">
234
+ <a href="index.html">VaultRAG</a><span>/</span>
235
+ <span>Page 04</span><span>/</span>
236
+ <span>Workflow Simulator</span>
237
+ </div>
238
+ <h1 class="page-title">Watch the pipeline <em>think in real time.</em></h1>
239
+ <p class="page-intro">Select a scenario. Press run. Watch the 5-layer guardrail pipeline execute β€” voice normalisation, scope checking, retrieval, confidence scoring, safety flagging, citation enforcement β€” step by step, with real timing. Every response is grounded in a source.</p>
240
+ </div>
241
+
242
+ <!-- ══ SIMULATOR ══ -->
243
+ <div class="sim-wrap">
244
+
245
+ <!-- SCENARIO SELECTOR -->
246
+ <div class="scenario-bar">
247
+ <div class="scenario-bar-label">Select a scenario</div>
248
+ <div class="scenario-buttons">
249
+ <button class="scenario-btn active" data-scenario="happy" onclick="selectScenario('happy',this)">Happy path β€” procedure found</button>
250
+ <button class="scenario-btn danger" data-scenario="scope" onclick="selectScenario('scope',this)">Guardrail fires β€” out of scope</button>
251
+ <button class="scenario-btn success" data-scenario="safety" onclick="selectScenario('safety',this)">Safety flag β€” LOTO procedure</button>
252
+ <button class="scenario-btn info" data-scenario="confidence" onclick="selectScenario('confidence',this)">Low confidence β€” insufficient context</button>
253
+ </div>
254
+ <button class="run-btn" id="runBtn" onclick="runSimulation()">
255
+ <span class="btn-icon">β–Ά</span>
256
+ <span id="runLabel">Run simulation</span>
257
+ </button>
258
+ </div>
259
+
260
+ <!-- SCENARIO DESCRIPTION -->
261
+ <div class="scenario-desc" id="scenarioDesc">
262
+ <div class="scenario-desc-label">Active scenario</div>
263
+ <div class="scenario-desc-title" id="scenarioTitle">Happy path β€” procedure found</div>
264
+ <div class="scenario-desc-body" id="scenarioBody">Technician Marcus is standing next to the Haas VF-2SS CNC on Line 3. The machine threw an E-04 fault at 07:14. He holds his phone to his mouth and speaks the query. VaultRAG normalises the voice input, retrieves the matching procedure from the indexed manual, and returns a cited step-by-step answer in under 8 seconds.</div>
265
+ </div>
266
+
267
+ <div class="sim-grid">
268
+
269
+ <!-- LEFT: PIPELINE -->
270
+ <div class="pipeline-panel">
271
+ <div class="pipeline-header">
272
+ <span>Guardrail Pipeline</span>
273
+ <span class="timer-display" id="timerDisplay">00.00s</span>
274
+ </div>
275
+ <div class="pipeline-steps-list" id="pipelineSteps">
276
+ <div class="pipe-step" id="ps-voice">
277
+ <div class="step-dot"></div>
278
+ <div class="step-info">
279
+ <div class="step-name">Voice Input</div>
280
+ <div class="step-detail">Web Speech API captures query from device microphone</div>
281
+ <div class="step-time" id="t-voice">β€”</div>
282
+ </div>
283
+ </div>
284
+ <div class="pipe-step" id="ps-g1">
285
+ <div class="step-dot"></div>
286
+ <div class="step-info">
287
+ <div class="step-name">G1 Β· Query Normaliser</div>
288
+ <div class="step-detail">Denoise transcription, reformat as structured query</div>
289
+ <div class="step-time" id="t-g1">β€”</div>
290
+ </div>
291
+ </div>
292
+ <div class="pipe-step" id="ps-g2">
293
+ <div class="step-dot"></div>
294
+ <div class="step-info">
295
+ <div class="step-name">G2 Β· Scope Guard</div>
296
+ <div class="step-detail">Check query relevance against document corpus</div>
297
+ <div class="step-time" id="t-g2">β€”</div>
298
+ </div>
299
+ </div>
300
+ <div class="pipe-step" id="ps-retrieval">
301
+ <div class="step-dot"></div>
302
+ <div class="step-info">
303
+ <div class="step-name">ChromaDB Retrieval</div>
304
+ <div class="step-detail">Semantic search Β· top-k=3 Β· cosine similarity</div>
305
+ <div class="step-time" id="t-retrieval">β€”</div>
306
+ </div>
307
+ </div>
308
+ <div class="pipe-step" id="ps-g3">
309
+ <div class="step-dot"></div>
310
+ <div class="step-info">
311
+ <div class="step-name">G3 Β· Confidence Threshold</div>
312
+ <div class="step-detail">Validate similarity scores β‰₯ 0.70</div>
313
+ <div class="step-time" id="t-g3">β€”</div>
314
+ </div>
315
+ </div>
316
+ <div class="pipe-step" id="ps-g4">
317
+ <div class="step-dot"></div>
318
+ <div class="step-info">
319
+ <div class="step-name">G4 Β· Safety Flag</div>
320
+ <div class="step-detail">Scan chunks for LOTO / hazard keywords</div>
321
+ <div class="step-time" id="t-g4">β€”</div>
322
+ </div>
323
+ </div>
324
+ <div class="pipe-step" id="ps-llm">
325
+ <div class="step-dot"></div>
326
+ <div class="step-info">
327
+ <div class="step-name">Llama 3.2 Generation</div>
328
+ <div class="step-detail">Structured prompt Β· step-by-step Β· citation mandatory</div>
329
+ <div class="step-time" id="t-llm">β€”</div>
330
+ </div>
331
+ </div>
332
+ <div class="pipe-step" id="ps-g5">
333
+ <div class="step-dot"></div>
334
+ <div class="step-info">
335
+ <div class="step-name">G5 Β· Citation Enforcer</div>
336
+ <div class="step-detail">Validate source reference present in output</div>
337
+ <div class="step-time" id="t-g5">β€”</div>
338
+ </div>
339
+ </div>
340
+ <div class="pipe-step" id="ps-response">
341
+ <div class="step-dot"></div>
342
+ <div class="step-info">
343
+ <div class="step-name">Response Delivered</div>
344
+ <div class="step-detail">Cited answer returned to technician's phone</div>
345
+ <div class="step-time" id="t-response">β€”</div>
346
+ </div>
347
+ </div>
348
+ </div>
349
+ </div>
350
+
351
+ <!-- RIGHT: OUTPUT -->
352
+ <div class="output-panel" id="outputPanel">
353
+
354
+ <!-- VOICE TRANSCRIPT -->
355
+ <div class="voice-card">
356
+ <div class="voice-header">
357
+ <div class="voice-dot" id="voiceDot"></div>
358
+ <span class="voice-label">Voice Input β€” Web Speech API</span>
359
+ </div>
360
+ <div class="voice-body">
361
+ <div class="voice-placeholder" id="voicePlaceholder">Select a scenario and press Run simulation</div>
362
+ <div class="voice-text" id="voiceText" style="display:none;"></div>
363
+ </div>
364
+ </div>
365
+
366
+ <!-- RETRIEVAL -->
367
+ <div class="retrieval-card" id="retrievalCard">
368
+ <div class="ret-header">
369
+ <span>ChromaDB Retrieval Results</span>
370
+ <span id="retrievalMeta" style="color:var(--steel-400);">β€”</span>
371
+ </div>
372
+ <div class="ret-body" id="retrievalBody"></div>
373
+ </div>
374
+
375
+ <!-- GUARDRAIL STATUS -->
376
+ <div class="guardrail-card" id="guardrailCard">
377
+ <div class="g-header">Guardrail Pipeline Status</div>
378
+ <div class="g-rows" id="guardrailRows">
379
+ <div class="g-row" id="gr-g1"><span class="g-badge">G1</span><span class="g-name">Query Normaliser</span><span class="g-detail" id="gd-g1">Waiting</span></div>
380
+ <div class="g-row" id="gr-g2"><span class="g-badge">G2</span><span class="g-name">Scope Guard</span><span class="g-detail" id="gd-g2">Waiting</span></div>
381
+ <div class="g-row" id="gr-g3"><span class="g-badge">G3</span><span class="g-name">Confidence Threshold</span><span class="g-detail" id="gd-g3">Waiting</span></div>
382
+ <div class="g-row" id="gr-g4"><span class="g-badge">G4</span><span class="g-name">Safety Flag</span><span class="g-detail" id="gd-g4">Waiting</span></div>
383
+ <div class="g-row" id="gr-g5"><span class="g-badge">G5</span><span class="g-name">Citation Enforcer</span><span class="g-detail" id="gd-g5">Waiting</span></div>
384
+ </div>
385
+ </div>
386
+
387
+ <!-- RESPONSE -->
388
+ <div class="response-card" id="responseCard">
389
+ <div class="resp-header">
390
+ <span class="resp-header-left" id="respHeaderLabel">Response</span>
391
+ <span class="resp-sla" id="respSLA">β€”</span>
392
+ </div>
393
+ <div class="resp-body" id="respBody"></div>
394
+ </div>
395
+
396
+ </div>
397
+ </div>
398
+ </div>
399
+
400
+ <!-- ══ HOW IT WORKS ══ -->
401
+ <div class="how-it-works">
402
+ <div class="section-label">How it works</div>
403
+ <h2 class="section-title">Nine steps. <em>Under 8 seconds.</em></h2>
404
+ <p style="font-size:0.95rem;color:var(--steel-300);max-width:680px;line-height:1.8;">From the moment a technician speaks their query to the moment a cited, structured answer appears on their phone screen β€” nine system steps fire in sequence. Every step is shown in the simulator above.</p>
405
+
406
+ <div class="steps-grid">
407
+ <div class="how-step">
408
+ <div class="how-step-num">01</div>
409
+ <div class="how-step-title">Technician speaks</div>
410
+ <p class="how-step-body">One-handed. One button. Web Speech API captures audio from the device microphone, no install required.</p>
411
+ <span class="how-step-time">Channel: Browser mic</span>
412
+ </div>
413
+ <div class="how-step">
414
+ <div class="how-step-num">02</div>
415
+ <div class="how-step-title">G1 normalises</div>
416
+ <p class="how-step-body">Raw transcription ("uh E zero four error on the Haas") is cleaned and reformulated into a structured query by the LLM with a strict system prompt.</p>
417
+ <span class="how-step-time">&lt; 0.8s</span>
418
+ </div>
419
+ <div class="how-step">
420
+ <div class="how-step-num">03</div>
421
+ <div class="how-step-title">G2 checks scope</div>
422
+ <p class="how-step-body">Top-1 similarity pre-check against the corpus. If nothing is remotely relevant, refuse immediately before spending retrieval budget.</p>
423
+ <span class="how-step-time">&lt; 0.3s</span>
424
+ </div>
425
+ <div class="how-step">
426
+ <div class="how-step-num">04</div>
427
+ <div class="how-step-title">ChromaDB retrieves</div>
428
+ <p class="how-step-body">Top-3 chunks by cosine similarity. nomic-embed-text embeds the query. Procedural sections returned with metadata: doc title, section, page range.</p>
429
+ <span class="how-step-time">&lt; 1.2s</span>
430
+ </div>
431
+ <div class="how-step">
432
+ <div class="how-step-num">05</div>
433
+ <div class="how-step-title">G3 validates confidence</div>
434
+ <p class="how-step-body">Best chunk similarity must be β‰₯ 0.70. Below threshold: refuse with explanation. Never generate a response the corpus cannot support.</p>
435
+ <span class="how-step-time">&lt; 0.1s</span>
436
+ </div>
437
+ <div class="how-step">
438
+ <div class="how-step-num">06</div>
439
+ <div class="how-step-title">G4 flags safety</div>
440
+ <p class="how-step-body">Scans retrieved chunks for LOTO, lockout, high voltage, pressure vessel, hazmat keywords. If triggered, mandatory safety prefix prepended to response.</p>
441
+ <span class="how-step-time">&lt; 0.2s</span>
442
+ </div>
443
+ <div class="how-step">
444
+ <div class="how-step-num">07</div>
445
+ <div class="how-step-title">Llama 3.2 generates</div>
446
+ <p class="how-step-body">Structured prompt enforces step-by-step format, maximum 5 steps, citation required. Response generated entirely locally β€” no external API call.</p>
447
+ <span class="how-step-time">&lt; 4.5s</span>
448
+ </div>
449
+ <div class="how-step">
450
+ <div class="how-step-num">08</div>
451
+ <div class="how-step-title">G5 enforces citation</div>
452
+ <p class="how-step-body">Validates source reference is present in output. If missing, one retry with stricter prompt. If still absent, response is blocked and refused.</p>
453
+ <span class="how-step-time">&lt; 0.2s</span>
454
+ </div>
455
+ <div class="how-step">
456
+ <div class="how-step-num">09</div>
457
+ <div class="how-step-title">Answer delivered</div>
458
+ <p class="how-step-body">Cited, structured procedure appears on the technician's phone. Section number, page range, document title. Traceable. Auditable. Correct.</p>
459
+ <span class="how-step-time">Total: &lt; 8s</span>
460
+ </div>
461
+ </div>
462
+ </div>
463
+
464
+ <div class="page-nav">
465
+ <a class="page-nav-link" href="page-03.html"><span class="page-nav-label">← Previous</span><span>Architecture & Design</span></a>
466
+ <a class="page-nav-link next" href="page-05.html"><span class="page-nav-label">Next β†’</span><span>Cost Model</span></a>
467
+ </div>
468
+
469
+ <footer>
470
+ <p>VaultRAG Β· Architecture Portfolio Β· 2026 Β· <a href="https://github.com/raosiddharthp/VaultRAG">GitHub</a></p>
471
+ <p>Page 04 Β· Workflow Simulator Β· Β© 2026 Siddharth Rao</p>
472
+ </footer>
473
+
474
+ <script>
475
+ // ── SCENARIO DATA ──────────────────────────────────────────────────────────
476
+ const SCENARIOS = {
477
+
478
+ happy: {
479
+ title: 'Happy path β€” procedure found',
480
+ body: 'Technician Marcus is standing next to the Haas VF-2SS CNC on Line 3. The machine threw an E-04 fault at 07:14. He holds his phone to his mouth and speaks the query. VaultRAG normalises the voice input, retrieves the matching procedure from the indexed manual, and returns a cited step-by-step answer in under 8 seconds.',
481
+ voice: '"uh... E zero four error on the Haas... spindle fault... how do I fix it"',
482
+ normalised: 'How do I resolve an E-04 spindle fault on a Haas VF-2SS CNC machine?',
483
+ steps: [
484
+ { id:'voice', delay:400, status:'pass', detail:'Query captured Β· 0.62s transcription', time:'0.62s' },
485
+ { id:'g1', delay:900, status:'pass', detail:'Normalised Β· jargon resolved Β· query structured', time:'0.81s' },
486
+ { id:'g2', delay:400, status:'pass', detail:'Scope confirmed Β· top-1 similarity: 0.88', time:'0.31s' },
487
+ { id:'retrieval',delay:1200, status:'pass', detail:'3 chunks retrieved Β· top score: 0.91', time:'1.18s' },
488
+ { id:'g3', delay:200, status:'pass', detail:'Confidence: 0.91 β‰₯ 0.70 Β· threshold passed', time:'0.08s' },
489
+ { id:'g4', delay:300, status:'pass', detail:'No LOTO/hazard keywords Β· safety clear', time:'0.12s' },
490
+ { id:'llm', delay:3800, status:'pass', detail:'Generated Β· 5 steps Β· citation present', time:'3.74s' },
491
+ { id:'g5', delay:200, status:'pass', detail:'Citation validated Β· source reference confirmed', time:'0.09s' },
492
+ { id:'response',delay:100, status:'pass', detail:'Delivered to device Β· total: 7.95s', time:'7.95s' },
493
+ ],
494
+ retrieval: {
495
+ meta: 'top-k=3 Β· cosine similarity Β· 0.31s',
496
+ chunks: [
497
+ { ref:'Haas VF-2SS Service Manual Β· Section 18.4 Β· pp.247–249', score:'0.91', level:'high', preview:'"18.4 E-04 Spindle Fault β€” Bearing Replacement. ISOLATE: Apply LOTO per SOP-ELEC-04 before proceeding..."' },
498
+ { ref:'Haas VF-2SS Service Manual Β· Section 18.1 Β· pp.240–242', score:'0.78', level:'mid', preview:'"18.1 Spindle Motor Overview. The VF-2SS spindle assembly operates at..."' },
499
+ { ref:'NCR-2024-047 Β· Line 3 Incident Report Β· pp.2–3', score:'0.71', level:'mid', preview:'"Root cause: Spindle bearing torque misapplication. Correct spec: 45 Nm Β±2 Nm..."' },
500
+ ]
501
+ },
502
+ guardrails: {
503
+ g1:{ status:'pass', detail:'Structured query formed' },
504
+ g2:{ status:'pass', detail:'Scope confirmed: 0.88' },
505
+ g3:{ status:'pass', detail:'Confidence: 0.91 βœ“' },
506
+ g4:{ status:'pass', detail:'No hazard keywords' },
507
+ g5:{ status:'pass', detail:'Citation present βœ“' },
508
+ },
509
+ responseType: 'success',
510
+ safetyBanner: false,
511
+ responseText: `Resolving E-04 Spindle Fault β€” Haas VF-2SS
512
+
513
+ 1. STOP: Do not attempt to restart the spindle. Power down Line 3 at the main panel.
514
+
515
+ 2. INSPECT: Open the spindle housing access panel. Check for visible bearing damage or displacement.
516
+
517
+ 3. RE-SEAT: If bearing has migrated, re-seat and torque the spindle bearing housing bolts to 45 Nm Β±2 Nm using a calibrated torque wrench. Do not estimate.
518
+
519
+ 4. VERIFY: Close housing. Power on. Run spindle at 20% speed for 30 seconds. Monitor for vibration or noise before returning to production speed.
520
+
521
+ 5. LOG: Record fault, procedure applied, and torque measurement in the Line 3 maintenance log before resuming production.`,
522
+ citation: 'Haas VF-2SS CNC Service Manual Β· Section 18.4 "E-04 Spindle Fault β€” Bearing Replacement" Β· Pages 247–249 Β· Cross-referenced: NCR-2024-047 Line 3 Incident Report',
523
+ sla: 'Total: 7.95s Β· 5 guardrail checks Β· 3 chunks retrieved',
524
+ },
525
+
526
+ scope: {
527
+ title: 'Guardrail fires β€” out of scope query',
528
+ body: 'A technician types a question unrelated to the uploaded document corpus β€” asking about something outside the facility\'s knowledge base. G2 Scope Guard detects no meaningful similarity between the query and any indexed document and refuses immediately, before any retrieval or generation is attempted.',
529
+ voice: '"What was the score in last night\'s match?"',
530
+ normalised: 'What was the score in last night\'s football match?',
531
+ steps: [
532
+ { id:'voice', delay:400, status:'pass', detail:'Query captured Β· 0.41s', time:'0.41s' },
533
+ { id:'g1', delay:700, status:'pass', detail:'Normalised Β· no jargon detected', time:'0.63s' },
534
+ { id:'g2', delay:400, status:'fail', detail:'BLOCKED Β· top-1 similarity: 0.09 < 0.30 minimum', time:'0.28s' },
535
+ { id:'retrieval',delay:0, status:null, detail:'Skipped β€” G2 blocked query', time:'skipped' },
536
+ { id:'g3', delay:0, status:null, detail:'Skipped', time:'skipped' },
537
+ { id:'g4', delay:0, status:null, detail:'Skipped', time:'skipped' },
538
+ { id:'llm', delay:0, status:null, detail:'Skipped β€” no generation on scope failure', time:'skipped' },
539
+ { id:'g5', delay:0, status:null, detail:'Skipped', time:'skipped' },
540
+ { id:'response', delay:200, status:'fail', detail:'Refusal delivered Β· total: 1.32s', time:'1.32s' },
541
+ ],
542
+ retrieval: null,
543
+ guardrails: {
544
+ g1:{ status:'pass', detail:'Query normalised' },
545
+ g2:{ status:'fail', detail:'Similarity: 0.09 β€” BLOCKED' },
546
+ g3:{ status:null, detail:'Skipped' },
547
+ g4:{ status:null, detail:'Skipped' },
548
+ g5:{ status:null, detail:'Skipped' },
549
+ },
550
+ responseType: 'refusal',
551
+ safetyBanner: false,
552
+ refusalTitle: 'Query outside document scope',
553
+ refusalBody: 'VaultRAG can only answer questions based on the documents uploaded to this facility\'s knowledge base β€” equipment manuals, SOPs, work instructions, and incident reports.',
554
+ refusalReason: 'G2 Scope Guard: top-1 corpus similarity = 0.09 Β· minimum threshold = 0.30 Β· No indexed document is relevant to this query.',
555
+ sla: 'Total: 1.32s Β· Blocked at G2 Β· No retrieval or generation',
556
+ },
557
+
558
+ safety: {
559
+ title: 'Safety flag β€” LOTO procedure triggered',
560
+ body: 'Technician Priya needs to replace a fuse on the electrical panel feeding Line 5. She asks VaultRAG for the procedure. The query retrieves the correct isolation procedure, but G4 Safety Flag detects LOTO and high-voltage keywords in the retrieved chunks and prepends a mandatory safety warning before the steps are delivered.',
561
+ voice: '"how do I replace the fuse on the Line 5 electrical panel"',
562
+ normalised: 'What is the procedure for replacing a fuse on the Line 5 electrical panel?',
563
+ steps: [
564
+ { id:'voice', delay:400, status:'pass', detail:'Query captured Β· 0.55s', time:'0.55s' },
565
+ { id:'g1', delay:800, status:'pass', detail:'Normalised Β· electrical terminology structured', time:'0.77s' },
566
+ { id:'g2', delay:400, status:'pass', detail:'Scope confirmed Β· top-1 similarity: 0.84', time:'0.29s' },
567
+ { id:'retrieval',delay:1100, status:'pass', detail:'3 chunks retrieved Β· top score: 0.87', time:'1.09s' },
568
+ { id:'g3', delay:200, status:'pass', detail:'Confidence: 0.87 β‰₯ 0.70 Β· threshold passed', time:'0.07s' },
569
+ { id:'g4', delay:300, status:'warn', detail:'⚠ SAFETY FLAG · LOTO + 415V keywords detected', time:'0.19s' },
570
+ { id:'llm', delay:3900, status:'pass', detail:'Generated Β· safety prefix prepended', time:'3.82s' },
571
+ { id:'g5', delay:200, status:'pass', detail:'Citation validated Β· source confirmed', time:'0.08s' },
572
+ { id:'response', delay:100, status:'warn', detail:'Delivered with safety banner Β· total: 6.86s', time:'6.86s' },
573
+ ],
574
+ retrieval: {
575
+ meta: 'top-k=3 Β· cosine similarity Β· 1.09s',
576
+ chunks: [
577
+ { ref:'SOP-ELEC-04 Β· Line 5 Electrical Isolation Β· pp.4–7', score:'0.87', level:'high', preview:'"LOCKOUT/TAGOUT REQUIRED. Isolate 415V supply at DB-L5 before any fuse work. Verify isolation with approved tester..."' },
578
+ { ref:'Facility Electrical Manual Β· Section 6.3 Β· pp.88–91', score:'0.79', level:'mid', preview:'"6.3 Fuse Replacement β€” Distribution Boards. Only qualified personnel per EAWR 1989..."' },
579
+ { ref:'SOP-ELEC-04 Β· Line 5 Electrical Isolation Β· pp.2–3', score:'0.74', level:'mid', preview:'"Permit to Work required for all work on 415V circuits. Contact Electrical Supervisor..."' },
580
+ ]
581
+ },
582
+ guardrails: {
583
+ g1:{ status:'pass', detail:'Query structured' },
584
+ g2:{ status:'pass', detail:'Scope: 0.84 βœ“' },
585
+ g3:{ status:'pass', detail:'Confidence: 0.87 βœ“' },
586
+ g4:{ status:'warn', detail:'⚠ LOTO + 415V flagged' },
587
+ g5:{ status:'pass', detail:'Citation present βœ“' },
588
+ },
589
+ responseType: 'safety',
590
+ safetyBanner: true,
591
+ safetyText: '⚠ SAFETY-CRITICAL PROCEDURE β€” LOCKOUT/TAGOUT REQUIRED BEFORE PROCEEDING. Do not attempt this procedure without first isolating the 415V supply and obtaining a Permit to Work from the Electrical Supervisor. Verify isolation with an approved voltage tester before touching any components.',
592
+ responseText: `Fuse Replacement β€” Line 5 Electrical Panel (DB-L5)
593
+
594
+ 1. OBTAIN PERMIT: Request a Permit to Work from the Electrical Supervisor before proceeding. Work must not begin without a signed permit.
595
+
596
+ 2. ISOLATE: At distribution board DB-L5, switch off the 415V incoming supply. Apply your personal LOTO padlock and tag per SOP-ELEC-04 Section 2.1.
597
+
598
+ 3. VERIFY DEAD: Test all terminals with an approved voltage tester (CAT III/IV minimum). Confirm zero voltage on all phases before opening the fuse compartment.
599
+
600
+ 4. REPLACE FUSE: Remove the blown fuse using insulated fuse pullers. Replace with a fuse of identical rating, type, and manufacturer. Do not substitute.
601
+
602
+ 5. RESTORE: Remove LOTO, close panel, restore 415V supply, and verify equipment operation. Complete the Permit to Work return-to-service section.`,
603
+ citation: 'SOP-ELEC-04 Β· Line 5 Electrical Isolation Procedure Β· Pages 4–7 Β· Facility Electrical Manual Section 6.3 Β· Pages 88–91',
604
+ sla: 'Total: 6.86s Β· G4 Safety Flag triggered Β· Mandatory safety prefix applied',
605
+ },
606
+
607
+ confidence: {
608
+ title: 'Low confidence β€” insufficient context',
609
+ body: 'A technician asks about a very specific torque specification for a component that is referenced only briefly in the corpus, not in a dedicated procedure section. The retrieval returns chunks with similarity scores all below the 0.70 threshold. G3 Confidence Threshold refuses the query rather than generating a potentially incorrect answer.',
610
+ voice: '"what\'s the torque spec for the coolant pump bracket bolts on the Mazak"',
611
+ normalised: 'What is the torque specification for the coolant pump bracket mounting bolts on the Mazak Integrex?',
612
+ steps: [
613
+ { id:'voice', delay:400, status:'pass', detail:'Query captured Β· 0.49s', time:'0.49s' },
614
+ { id:'g1', delay:800, status:'pass', detail:'Normalised Β· machine model resolved', time:'0.72s' },
615
+ { id:'g2', delay:400, status:'pass', detail:'Scope preliminary pass Β· top-1: 0.61', time:'0.31s' },
616
+ { id:'retrieval',delay:1100, status:'pass', detail:'3 chunks retrieved Β· best score: 0.61', time:'1.14s' },
617
+ { id:'g3', delay:200, status:'fail', detail:'BLOCKED Β· best score 0.61 < threshold 0.70', time:'0.08s' },
618
+ { id:'g4', delay:0, status:null, detail:'Skipped β€” blocked at G3', time:'skipped' },
619
+ { id:'llm', delay:0, status:null, detail:'Skipped β€” no generation on confidence failure', time:'skipped' },
620
+ { id:'g5', delay:0, status:null, detail:'Skipped', time:'skipped' },
621
+ { id:'response', delay:200, status:'fail', detail:'Refusal delivered Β· total: 3.14s', time:'3.14s' },
622
+ ],
623
+ retrieval: {
624
+ meta: 'top-k=3 Β· cosine similarity Β· 1.14s',
625
+ chunks: [
626
+ { ref:'Mazak Integrex Service Manual Β· Section 9.1 Β· pp.112–113', score:'0.61', level:'low', preview:'"9.1 Coolant System Overview. The coolant pump assembly is mounted to the..."' },
627
+ { ref:'Mazak Integrex Parts Catalogue Β· pp.44–45', score:'0.54', level:'low', preview:'"Coolant pump bracket assembly: part no. MZK-CPB-440. See service manual for..."' },
628
+ { ref:'PM-SCHEDULE-2024 Β· Mazak Preventive Maintenance Β· pp.8', score:'0.48', level:'low', preview:'"Check coolant pump bracket fasteners for tightness. Refer to OEM spec..."' },
629
+ ]
630
+ },
631
+ guardrails: {
632
+ g1:{ status:'pass', detail:'Query structured' },
633
+ g2:{ status:'pass', detail:'Preliminary scope pass' },
634
+ g3:{ status:'fail', detail:'Best score: 0.61 β€” BLOCKED' },
635
+ g4:{ status:null, detail:'Skipped' },
636
+ g5:{ status:null, detail:'Skipped' },
637
+ },
638
+ responseType: 'refusal',
639
+ safetyBanner: false,
640
+ refusalTitle: 'Insufficient information in uploaded documents',
641
+ refusalBody: 'The indexed documents contain references to the Mazak Integrex coolant pump bracket, but no dedicated procedure with a specific torque value was found with sufficient confidence. Generating an answer from partial context risks providing an incorrect torque specification.',
642
+ refusalReason: 'G3 Confidence Threshold: best chunk similarity = 0.61 Β· minimum threshold = 0.70 Β· Action: Check the Mazak Integrex torque specification chart in the full OEM service manual (request from Engineering if not indexed).',
643
+ sla: 'Total: 3.14s Β· Blocked at G3 Β· Retrieval ran Β· Generation skipped',
644
+ }
645
+ };
646
+
647
+ // ── STATE ─────────────────────────────────────────��────────────────────────
648
+ let activeScenario = 'happy';
649
+ let isRunning = false;
650
+ let timerInterval = null;
651
+ let startTime = null;
652
+
653
+ // ── SCENARIO SELECT ────────────────────────────────────────────────────────
654
+ function selectScenario(key, btn) {
655
+ if (isRunning) return;
656
+ activeScenario = key;
657
+ document.querySelectorAll('.scenario-btn').forEach(b => b.classList.remove('active'));
658
+ btn.classList.add('active');
659
+ const s = SCENARIOS[key];
660
+ document.getElementById('scenarioTitle').textContent = s.title;
661
+ document.getElementById('scenarioBody').textContent = s.body;
662
+ resetUI();
663
+ }
664
+
665
+ // ── RESET ──────────────────────────────────────────────────────────────────
666
+ function resetUI() {
667
+ // pipeline steps
668
+ ['voice','g1','g2','retrieval','g3','g4','llm','g5','response'].forEach(id => {
669
+ const el = document.getElementById('ps-'+id);
670
+ el.className = 'pipe-step';
671
+ document.getElementById('t-'+id).textContent = 'β€”';
672
+ });
673
+ // timer
674
+ clearInterval(timerInterval);
675
+ document.getElementById('timerDisplay').textContent = '00.00s';
676
+ // voice
677
+ document.getElementById('voiceDot').className = 'voice-dot';
678
+ document.getElementById('voicePlaceholder').style.display = '';
679
+ document.getElementById('voiceText').style.display = 'none';
680
+ document.getElementById('voiceText').textContent = '';
681
+ // cards
682
+ document.getElementById('retrievalCard').classList.remove('visible');
683
+ document.getElementById('guardrailCard').classList.remove('visible');
684
+ document.getElementById('responseCard').classList.remove('visible');
685
+ // guardrail rows
686
+ ['g1','g2','g3','g4','g5'].forEach(g => {
687
+ const row = document.getElementById('gr-'+g);
688
+ row.className = 'g-row';
689
+ document.getElementById('gd-'+g).textContent = 'Waiting';
690
+ });
691
+ // run button
692
+ const btn = document.getElementById('runBtn');
693
+ btn.disabled = false;
694
+ btn.classList.remove('running');
695
+ document.getElementById('runLabel').textContent = 'Run simulation';
696
+ }
697
+
698
+ // ── TIMER ──────────────────────────────────────────────────────────────────
699
+ function startTimer() {
700
+ startTime = Date.now();
701
+ timerInterval = setInterval(() => {
702
+ const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);
703
+ document.getElementById('timerDisplay').textContent = elapsed + 's';
704
+ }, 50);
705
+ }
706
+ function stopTimer() { clearInterval(timerInterval); }
707
+
708
+ // ── HELPERS ────────────────────────────────────────────────────────────────
709
+ function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
710
+
711
+ function activateStep(id) {
712
+ document.getElementById('ps-'+id).className = 'pipe-step active';
713
+ }
714
+ function completeStep(id, status, time) {
715
+ const el = document.getElementById('ps-'+id);
716
+ el.className = 'pipe-step done ' + (status || 'pass');
717
+ document.getElementById('t-'+id).textContent = time;
718
+ }
719
+ function skipStep(id) {
720
+ const el = document.getElementById('ps-'+id);
721
+ el.className = 'pipe-step done';
722
+ document.getElementById('t-'+id).textContent = 'skipped';
723
+ el.style.opacity = '0.25';
724
+ }
725
+
726
+ async function typeText(el, text, speed = 18) {
727
+ el.textContent = '';
728
+ for (let i = 0; i < text.length; i++) {
729
+ el.textContent += text[i];
730
+ await sleep(speed);
731
+ }
732
+ }
733
+
734
+ // ── MAIN SIMULATION ────────────────────────────────────────────────────────
735
+ async function runSimulation() {
736
+ if (isRunning) return;
737
+ isRunning = true;
738
+ const btn = document.getElementById('runBtn');
739
+ btn.disabled = true;
740
+ btn.classList.add('running');
741
+ document.getElementById('runLabel').textContent = 'Running…';
742
+
743
+ resetUI();
744
+ await sleep(100);
745
+ startTimer();
746
+
747
+ const s = SCENARIOS[activeScenario];
748
+
749
+ // Show voice dot active
750
+ document.getElementById('voiceDot').className = 'voice-dot active';
751
+ document.getElementById('voicePlaceholder').style.display = 'none';
752
+ const voiceEl = document.getElementById('voiceText');
753
+ voiceEl.style.display = '';
754
+ voiceEl.className = 'voice-text speaking';
755
+
756
+ // Run steps
757
+ for (let i = 0; i < s.steps.length; i++) {
758
+ const step = s.steps[i];
759
+ if (step.delay === 0 && step.status === null) {
760
+ skipStep(step.id);
761
+ continue;
762
+ }
763
+ activateStep(step.id);
764
+
765
+ // Special behaviours per step
766
+ if (step.id === 'voice') {
767
+ await typeText(voiceEl, s.voice, 22);
768
+ await sleep(step.delay - s.voice.length * 22);
769
+ } else if (step.id === 'g1') {
770
+ await sleep(step.delay * 0.5);
771
+ voiceEl.className = 'voice-text';
772
+ await typeText(voiceEl, 'β†’ ' + s.normalised, 14);
773
+ await sleep(step.delay * 0.5 - s.normalised.length * 14);
774
+ } else if (step.id === 'retrieval') {
775
+ await sleep(step.delay);
776
+ // Show retrieval card
777
+ if (s.retrieval) {
778
+ document.getElementById('retrievalCard').classList.add('visible');
779
+ document.getElementById('guardrailCard').classList.add('visible');
780
+ document.getElementById('retrievalMeta').textContent = s.retrieval.meta;
781
+ const body = document.getElementById('retrievalBody');
782
+ body.innerHTML = '';
783
+ for (const chunk of s.retrieval.chunks) {
784
+ const div = document.createElement('div');
785
+ div.className = 'chunk-item' + (chunk === s.retrieval.chunks[0] ? ' top' : '');
786
+ div.innerHTML = `
787
+ <div>
788
+ <div class="chunk-ref">${chunk.ref}</div>
789
+ <div class="chunk-preview">${chunk.preview}</div>
790
+ </div>
791
+ <div class="chunk-score ${chunk.level}">${chunk.score}</div>`;
792
+ body.appendChild(div);
793
+ await sleep(180);
794
+ }
795
+ } else {
796
+ document.getElementById('guardrailCard').classList.add('visible');
797
+ }
798
+ } else if (step.id === 'g1' || step.id === 'g2' || step.id === 'g3' || step.id === 'g4' || step.id === 'g5') {
799
+ await sleep(step.delay);
800
+ } else if (step.id === 'llm') {
801
+ await sleep(step.delay);
802
+ } else {
803
+ await sleep(step.delay);
804
+ }
805
+
806
+ // Update guardrail row if applicable
807
+ const gKey = step.id.startsWith('g') && !step.id.includes('uardrail') ? step.id : null;
808
+ if (gKey && ['g1','g2','g3','g4','g5'].includes(gKey)) {
809
+ const gData = s.guardrails[gKey];
810
+ if (gData) {
811
+ const row = document.getElementById('gr-'+gKey);
812
+ const detail = document.getElementById('gd-'+gKey);
813
+ if (gData.status) {
814
+ row.className = 'g-row ' + gData.status;
815
+ }
816
+ detail.textContent = gData.detail;
817
+ }
818
+ }
819
+
820
+ completeStep(step.id, step.status, step.time);
821
+
822
+ // If response step, show the response
823
+ if (step.id === 'response') {
824
+ document.getElementById('voiceDot').className = 'voice-dot';
825
+ await renderResponse(s);
826
+ }
827
+
828
+ // Early exit if step failed scope/confidence (stop pipeline visually after showing remaining as skipped)
829
+ if (step.status === 'fail' && (step.id === 'g2' || step.id === 'g3')) {
830
+ // skip remaining
831
+ const remaining = s.steps.slice(i+1).filter(st => st.status === null || st.delay === 0);
832
+ for (const rem of remaining) { skipStep(rem.id); }
833
+ await sleep(300);
834
+ await renderResponse(s);
835
+ break;
836
+ }
837
+ }
838
+
839
+ stopTimer();
840
+ isRunning = false;
841
+ btn.disabled = false;
842
+ btn.classList.remove('running');
843
+ document.getElementById('runLabel').textContent = 'Run again';
844
+ }
845
+
846
+ // ── RENDER RESPONSE ────────────────────────────────────────────────────────
847
+ async function renderResponse(s) {
848
+ const card = document.getElementById('responseCard');
849
+ const label = document.getElementById('respHeaderLabel');
850
+ const slaEl = document.getElementById('respSLA');
851
+ const body = document.getElementById('respBody');
852
+
853
+ card.classList.add('visible');
854
+ slaEl.textContent = s.sla;
855
+ body.innerHTML = '';
856
+
857
+ if (s.responseType === 'refusal' || (s.responseType !== 'success' && s.responseType !== 'safety')) {
858
+ label.className = 'resp-header-left danger-label';
859
+ label.textContent = 'Guardrail Refusal';
860
+ const box = document.createElement('div');
861
+ box.className = 'refusal-box';
862
+ box.innerHTML = `
863
+ <div class="refusal-icon">πŸ›‘</div>
864
+ <div class="refusal-title">${s.refusalTitle}</div>
865
+ <div class="refusal-body">${s.refusalBody}</div>
866
+ <div class="refusal-reason">${s.refusalReason}</div>`;
867
+ body.appendChild(box);
868
+ return;
869
+ }
870
+
871
+ if (s.responseType === 'safety') {
872
+ label.className = 'resp-header-left warn-label';
873
+ label.textContent = 'Response β€” Safety flag active';
874
+ if (s.safetyBanner) {
875
+ const banner = document.createElement('div');
876
+ banner.className = 'safety-banner';
877
+ banner.innerHTML = `<div class="safety-banner-icon">⚠️</div><div class="safety-banner-text">${s.safetyText}</div>`;
878
+ body.appendChild(banner);
879
+ }
880
+ } else {
881
+ label.className = 'resp-header-left success-label';
882
+ label.textContent = 'Response β€” Procedure found';
883
+ }
884
+
885
+ // Stream response text
886
+ const pre = document.createElement('div');
887
+ pre.className = 'resp-text';
888
+ body.appendChild(pre);
889
+ await typeText(pre, s.responseText, 8);
890
+
891
+ // Citation
892
+ if (s.citation) {
893
+ const cit = document.createElement('div');
894
+ cit.className = 'resp-citation';
895
+ cit.innerHTML = `<div class="resp-citation-label">Source</div><div class="resp-citation-text">${s.citation}</div>`;
896
+ body.appendChild(cit);
897
+ }
898
+ }
899
+
900
+ // Init
901
+ resetUI();
902
+ </script>
903
+ </body>
904
+ </html>
page-05.html ADDED
@@ -0,0 +1,656 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>VaultRAG β€” Cost Model</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap" rel="stylesheet">
10
+ <style>
11
+ :root {
12
+ --steel-900:#0e1117;--steel-800:#161c27;--steel-700:#1e2535;
13
+ --steel-600:#262f42;--steel-500:#344057;--steel-400:#4a5568;
14
+ --steel-300:#718096;--steel-200:#a0aec0;--steel-100:#cbd5e0;
15
+ --amber-500:#f59e0b;--amber-400:#fbbf24;--amber-600:#d97706;
16
+ --danger:#ef4444;--success:#10b981;--info:#3b82f6;
17
+ --font-display:'Barlow Condensed',sans-serif;
18
+ --font-body:'Barlow',sans-serif;
19
+ --font-mono:'JetBrains Mono',monospace;
20
+ }
21
+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
22
+ html{scroll-behavior:smooth;}
23
+ body{background:var(--steel-900);color:var(--steel-100);font-family:var(--font-body);font-size:16px;line-height:1.7;overflow-x:hidden;}
24
+ body::before{content:'';position:fixed;inset:0;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");pointer-events:none;z-index:0;opacity:0.4;}
25
+
26
+ nav{position:fixed;top:0;left:0;right:0;z-index:100;display:flex;align-items:center;justify-content:space-between;padding:0 48px;height:64px;background:rgba(14,17,23,0.94);backdrop-filter:blur(12px);border-bottom:1px solid rgba(245,158,11,0.15);}
27
+ .nav-brand{font-family:var(--font-display);font-weight:700;font-size:1.2rem;letter-spacing:0.08em;color:var(--amber-400);text-decoration:none;}
28
+ .nav-brand span{color:var(--steel-300);font-weight:300;}
29
+ nav ul{display:flex;gap:24px;list-style:none;}
30
+ nav a{font-family:var(--font-mono);font-size:0.68rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--steel-300);text-decoration:none;transition:color 0.2s;}
31
+ nav a:hover,nav a.active{color:var(--amber-400);}
32
+ .nav-github{color:var(--amber-400)!important;border:1px solid var(--amber-500);padding:6px 14px;border-radius:2px;}
33
+ .nav-github:hover{background:var(--amber-500)!important;color:var(--steel-900)!important;}
34
+
35
+ .page-header{padding:120px 48px 56px;position:relative;z-index:1;border-bottom:1px solid var(--steel-700);background:linear-gradient(180deg,rgba(16,185,129,0.04) 0%,transparent 100%);}
36
+ .page-header::after{content:'';position:absolute;inset:0;background-image:linear-gradient(rgba(16,185,129,0.025) 1px,transparent 1px),linear-gradient(90deg,rgba(16,185,129,0.025) 1px,transparent 1px);background-size:60px 60px;pointer-events:none;}
37
+ .breadcrumb{font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--steel-400);margin-bottom:16px;display:flex;align-items:center;gap:8px;}
38
+ .breadcrumb a{color:var(--steel-400);text-decoration:none;}
39
+ .breadcrumb a:hover{color:var(--amber-400);}
40
+ .breadcrumb span{color:var(--steel-600);}
41
+ .page-number{font-family:var(--font-display);font-size:7rem;font-weight:800;color:rgba(16,185,129,0.06);line-height:1;position:absolute;right:48px;top:80px;pointer-events:none;}
42
+ .page-title{font-family:var(--font-display);font-size:clamp(2.8rem,5.5vw,5rem);font-weight:800;line-height:0.95;margin-bottom:20px;max-width:820px;}
43
+ .page-title em{font-style:italic;font-weight:300;color:var(--success);}
44
+ .page-intro{font-size:1rem;color:var(--steel-200);max-width:680px;line-height:1.8;}
45
+
46
+ section{position:relative;z-index:1;padding:72px 48px;}
47
+ section+section{border-top:1px solid var(--steel-800);}
48
+ .section-label{font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.2em;text-transform:uppercase;color:var(--amber-500);margin-bottom:14px;display:flex;align-items:center;gap:10px;}
49
+ .section-label::after{content:'';flex:1;max-width:50px;height:1px;background:var(--amber-600);}
50
+ .section-title{font-family:var(--font-display);font-size:clamp(1.8rem,3vw,2.6rem);font-weight:700;color:#fff;margin-bottom:14px;line-height:1.1;}
51
+ .section-title em{font-style:italic;font-weight:300;color:var(--amber-400);}
52
+ .section-intro{font-size:0.95rem;color:var(--steel-200);max-width:680px;line-height:1.8;margin-bottom:48px;}
53
+
54
+ /* ASSUMPTIONS BOX */
55
+ .assumptions{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;padding:32px;margin-bottom:56px;display:grid;grid-template-columns:repeat(6,1fr);gap:2px;background:var(--steel-700);}
56
+ .assumption{background:var(--steel-800);padding:20px 18px;}
57
+ .assumption-value{font-family:var(--font-display);font-size:1.8rem;font-weight:700;color:var(--amber-400);line-height:1;margin-bottom:4px;}
58
+ .assumption-label{font-family:var(--font-mono);font-size:0.6rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--steel-300);}
59
+
60
+ /* PROBLEM COST CARDS */
61
+ .problem-grid{display:grid;grid-template-columns:1fr 1fr;gap:2px;background:var(--steel-700);border-radius:4px;overflow:hidden;margin-bottom:48px;}
62
+ .problem-card{background:var(--steel-800);padding:36px 32px;position:relative;}
63
+ .problem-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--danger);}
64
+ .pc-eyebrow{font-family:var(--font-mono);font-size:0.6rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--danger);margin-bottom:14px;}
65
+ .pc-title{font-family:var(--font-display);font-size:1.3rem;font-weight:700;color:#fff;margin-bottom:12px;}
66
+ .pc-body{font-size:0.88rem;color:var(--steel-300);line-height:1.7;margin-bottom:20px;}
67
+ .pc-calc{background:var(--steel-700);border-radius:3px;padding:16px;font-family:var(--font-mono);font-size:0.72rem;color:var(--steel-200);line-height:1.8;}
68
+ .pc-calc .line{display:flex;justify-content:space-between;gap:16px;padding:4px 0;border-bottom:1px solid rgba(38,47,66,0.8);}
69
+ .pc-calc .line:last-child{border-bottom:none;padding-top:8px;margin-top:4px;}
70
+ .pc-calc .line.total .val{color:var(--danger);font-weight:700;font-size:0.85rem;}
71
+ .pc-calc .line.total .lbl{color:var(--steel-100);}
72
+ .pc-source{font-family:var(--font-mono);font-size:0.6rem;color:var(--steel-500);margin-top:12px;}
73
+ .pc-source a{color:var(--steel-400);text-decoration:none;}
74
+ .pc-source a:hover{color:var(--amber-400);}
75
+
76
+ /* COMPONENT COST CARDS */
77
+ .component-stack{display:flex;flex-direction:column;gap:2px;background:var(--steel-700);border-radius:4px;overflow:hidden;margin-bottom:48px;}
78
+ .comp-card{background:var(--steel-800);display:grid;grid-template-columns:56px 1fr 180px;gap:0;min-height:80px;}
79
+ .comp-number{display:flex;align-items:center;justify-content:center;background:var(--steel-700);font-family:var(--font-mono);font-size:0.7rem;color:var(--steel-400);letter-spacing:0.1em;border-right:1px solid var(--steel-600);}
80
+ .comp-body{padding:24px 28px;}
81
+ .comp-title{font-family:var(--font-display);font-size:1.1rem;font-weight:700;color:#fff;margin-bottom:4px;}
82
+ .comp-sub{font-family:var(--font-mono);font-size:0.65rem;color:var(--steel-400);letter-spacing:0.08em;margin-bottom:10px;}
83
+ .comp-desc{font-size:0.85rem;color:var(--steel-300);line-height:1.65;}
84
+ .comp-detail{margin-top:12px;padding:12px 14px;background:var(--steel-700);border-radius:3px;font-family:var(--font-mono);font-size:0.68rem;color:var(--steel-200);line-height:1.7;}
85
+ .comp-detail .dl{display:flex;justify-content:space-between;padding:3px 0;border-bottom:1px solid rgba(38,47,66,0.6);}
86
+ .comp-detail .dl:last-child{border-bottom:none;}
87
+ .comp-detail .dk{color:var(--steel-400);}
88
+ .comp-detail .dv{color:var(--steel-200);}
89
+ .comp-source{margin-top:8px;font-family:var(--font-mono);font-size:0.58rem;color:var(--steel-500);}
90
+ .comp-source a{color:var(--steel-400);text-decoration:none;}
91
+ .comp-source a:hover{color:var(--amber-400);}
92
+ .comp-cost{padding:24px 28px;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;border-left:1px solid var(--steel-700);background:var(--steel-800);}
93
+ .cost-value{font-family:var(--font-display);font-size:2.2rem;font-weight:800;line-height:1;margin-bottom:4px;}
94
+ .cost-value.green{color:var(--success);}
95
+ .cost-value.amber{color:var(--amber-400);}
96
+ .cost-value.zero{color:var(--steel-400);}
97
+ .cost-period{font-family:var(--font-mono);font-size:0.6rem;color:var(--steel-400);letter-spacing:0.1em;text-transform:uppercase;}
98
+ .cost-tag{margin-top:8px;font-family:var(--font-mono);font-size:0.58rem;padding:3px 8px;border-radius:2px;}
99
+ .cost-tag.free{background:rgba(16,185,129,0.12);color:var(--success);border:1px solid rgba(16,185,129,0.25);}
100
+ .cost-tag.paid{background:rgba(245,158,11,0.1);color:var(--amber-400);border:1px solid rgba(245,158,11,0.2);}
101
+
102
+ /* TOTAL COST BOX */
103
+ .total-box{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;overflow:hidden;margin-bottom:56px;}
104
+ .total-header{padding:20px 32px;background:var(--steel-700);border-bottom:1px solid var(--steel-600);font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--success);}
105
+ .total-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:2px;background:var(--steel-600);}
106
+ .total-cell{background:var(--steel-800);padding:28px 24px;}
107
+ .total-cell-value{font-family:var(--font-display);font-size:2.4rem;font-weight:800;line-height:1;margin-bottom:6px;}
108
+ .total-cell-value.green{color:var(--success);}
109
+ .total-cell-value.amber{color:var(--amber-400);}
110
+ .total-cell-value.danger{color:var(--danger);}
111
+ .total-cell-label{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--steel-300);margin-bottom:4px;}
112
+ .total-cell-desc{font-size:0.78rem;color:var(--steel-400);line-height:1.4;}
113
+
114
+ /* ROI DIAGRAM */
115
+ .roi-box{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;overflow:hidden;margin-bottom:48px;}
116
+ .roi-header{padding:20px 32px;background:var(--steel-700);border-bottom:1px solid var(--steel-600);font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--amber-400);}
117
+ .roi-body{padding:32px;}
118
+
119
+ /* COMPARISON TABLE */
120
+ .compare-wrap{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:4px;overflow:hidden;margin-bottom:48px;}
121
+ .compare-header{padding:16px 24px;background:var(--steel-700);border-bottom:1px solid var(--steel-600);font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--amber-400);}
122
+ table{width:100%;border-collapse:collapse;}
123
+ th{background:var(--steel-700);padding:12px 20px;text-align:left;font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--steel-300);border-bottom:1px solid var(--steel-600);}
124
+ td{padding:14px 20px;border-bottom:1px solid rgba(38,47,66,0.7);font-size:0.88rem;color:var(--steel-200);vertical-align:middle;}
125
+ tr:last-child td{border-bottom:none;}
126
+ tr:hover td{background:rgba(38,47,66,0.3);}
127
+ .td-good{color:var(--success);font-family:var(--font-mono);font-size:0.78rem;}
128
+ .td-bad{color:var(--danger);font-family:var(--font-mono);font-size:0.78rem;}
129
+ .td-neutral{color:var(--amber-400);font-family:var(--font-mono);font-size:0.78rem;}
130
+ .td-bold{font-family:var(--font-display);font-size:1rem;font-weight:700;color:var(--amber-400);}
131
+
132
+ /* SCROLL REVEAL */
133
+ .scroll-reveal{opacity:0;transform:translateY(24px);transition:opacity 0.7s,transform 0.7s;}
134
+ .scroll-reveal.visible{opacity:1;transform:translateY(0);}
135
+
136
+ .page-nav{display:flex;justify-content:space-between;align-items:center;padding:40px 48px;border-top:1px solid var(--steel-700);}
137
+ .page-nav-link{font-family:var(--font-mono);font-size:0.7rem;letter-spacing:0.1em;text-transform:uppercase;text-decoration:none;color:var(--steel-300);display:flex;flex-direction:column;gap:6px;transition:color 0.2s;}
138
+ .page-nav-link:hover{color:var(--amber-400);}
139
+ .page-nav-label{font-size:0.6rem;color:var(--steel-500);}
140
+ .page-nav-link.next{text-align:right;}
141
+ .btn{font-family:var(--font-mono);font-size:0.7rem;letter-spacing:0.1em;text-transform:uppercase;text-decoration:none;padding:12px 24px;border-radius:2px;transition:all 0.2s;display:inline-flex;align-items:center;gap:8px;}
142
+ .btn-primary{background:var(--amber-500);color:var(--steel-900);font-weight:700;}
143
+ .btn-primary:hover{background:var(--amber-400);}
144
+
145
+ footer{padding:40px 48px;display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--steel-800);}
146
+ footer p{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.1em;color:var(--steel-500);text-transform:uppercase;}
147
+ footer a{color:var(--steel-400);text-decoration:none;}
148
+ footer a:hover{color:var(--amber-400);}
149
+
150
+ @media(max-width:900px){
151
+ nav{padding:0 20px;} nav ul{display:none;}
152
+ .page-header{padding:100px 24px 48px;} .page-number{display:none;}
153
+ section{padding:48px 24px;}
154
+ .assumptions{grid-template-columns:repeat(3,1fr);}
155
+ .problem-grid{grid-template-columns:1fr;}
156
+ .comp-card{grid-template-columns:1fr;} .comp-number{display:none;} .comp-cost{border-left:none;border-top:1px solid var(--steel-700);align-items:flex-start;}
157
+ .total-grid{grid-template-columns:repeat(2,1fr);}
158
+ .page-nav{padding:28px 24px;}
159
+ footer{padding:28px 24px;flex-direction:column;gap:12px;text-align:center;}
160
+ }
161
+ </style>
162
+ </head>
163
+ <body>
164
+
165
+ <nav>
166
+ <a class="nav-brand" href="index.html">VAULT<span>RAG</span></a>
167
+ <ul>
168
+ <li><a href="index.html">Overview</a></li>
169
+ <li><a href="page-02.html">The Problem</a></li>
170
+ <li><a href="page-03.html">Architecture</a></li>
171
+ <li><a href="page-04.html">Simulator</a></li>
172
+ <li><a href="page-05.html" class="active">Cost Model</a></li>
173
+ <li><a href="page-06.html">Roadmap</a></li>
174
+ <li><a href="https://github.com/raosiddharthp/VaultRAG" class="nav-github">GitHub β†’</a></li>
175
+ </ul>
176
+ </nav>
177
+
178
+ <div class="page-header">
179
+ <div class="page-number">05</div>
180
+ <div class="breadcrumb">
181
+ <a href="index.html">VaultRAG</a><span>/</span>
182
+ <span>Page 05</span><span>/</span><span>Cost Model</span>
183
+ </div>
184
+ <h1 class="page-title">Β£0 in API fees.<br><em>Here is every number.</em></h1>
185
+ <p class="page-intro">Every cost figure on this page is derived from published vendor pricing or cited research. This page shows two models: the cost of the problem β€” what the knowledge gap is costing FlexForm right now β€” and the cost of the solution β€” what VaultRAG costs to run. Every assumption is stated. Every source is linked.</p>
186
+ </div>
187
+
188
+ <!-- ══ 01 MODEL ASSUMPTIONS ══ -->
189
+ <section>
190
+ <div class="section-label">01 β€” Model Assumptions</div>
191
+ <h2 class="section-title">Baseline scenario. <em>FlexForm Precision Β· 340 employees.</em></h2>
192
+ <p class="section-intro">All calculations use the FlexForm anchor client profile from Page 03. Figures are illustrative of a mid-size Tier-2 automotive supplier. Sources are cited; assumptions are stated where data is estimated.</p>
193
+
194
+ <div class="assumptions scroll-reveal">
195
+ <div class="assumption"><div class="assumption-value">340</div><div class="assumption-label">Employees</div></div>
196
+ <div class="assumption"><div class="assumption-value">260</div><div class="assumption-label">Floor workers</div></div>
197
+ <div class="assumption"><div class="assumption-value">800</div><div class="assumption-label">Downtime hrs/yr</div></div>
198
+ <div class="assumption"><div class="assumption-value">Β£4,333</div><div class="assumption-label">Cost per downtime min</div></div>
199
+ <div class="assumption"><div class="assumption-value">14</div><div class="assumption-label">NCRs last 12 months</div></div>
200
+ <div class="assumption"><div class="assumption-value">28K+</div><div class="assumption-label">Documentation pages</div></div>
201
+ </div>
202
+ </section>
203
+
204
+ <!-- ══ 02 COST OF THE PROBLEM ══ -->
205
+ <section>
206
+ <div class="section-label">02 β€” Cost of the Problem</div>
207
+ <h2 class="section-title">What the knowledge gap <em>costs FlexForm today.</em></h2>
208
+ <p class="section-intro">These are not hypothetical losses. They are costs that are accruing right now, every shift, every day β€” because the right information is not reaching the floor in time. Both figures are conservatively estimated from published research.</p>
209
+
210
+ <div class="problem-grid scroll-reveal">
211
+
212
+ <div class="problem-card">
213
+ <div class="pc-eyebrow">Cost β€” 01 Β· Downtime attributable to procedure errors</div>
214
+ <div class="pc-title">Annual downtime cost from human error</div>
215
+ <p class="pc-body">23% of unplanned manufacturing downtime is caused by human error β€” including wrong or misremembered procedures. At 800 hours of unplanned downtime per year and Β£260,000/hr equivalent, a conservative 23% attribution produces a significant annual exposure directly addressable by faster, more reliable procedure retrieval.</p>
216
+ <div class="pc-calc">
217
+ <div class="line"><span class="lbl">Annual unplanned downtime</span><span class="val">800 hrs</span></div>
218
+ <div class="line"><span class="lbl">Human error attribution rate</span><span class="val">23%</span></div>
219
+ <div class="line"><span class="lbl">Attributable downtime hours</span><span class="val">184 hrs/yr</span></div>
220
+ <div class="line"><span class="lbl">Cost per hour (Β£ equivalent, mid-size plant)</span><span class="val">Β£125,000/hr</span></div>
221
+ <div class="line total"><span class="lbl total">Annual cost attributable to knowledge gap</span><span class="val">Β£23M/yr</span></div>
222
+ </div>
223
+ <div class="pc-source">
224
+ β†— <a href="https://assets.new.siemens.com/siemens/assets/api/uuid:1b43afb5-2d07-47f7-9eb7-893fe7d0bc59/TCOD-2024_original.pdf" target="_blank">Siemens True Cost of Downtime 2024 (800 hrs figure)</a> Β·
225
+ <a href="https://www.ismworld.org/supply-management-news-and-reports/news-publications/inside-supply-management-magazine/blog/2024/2024-08/the-monthly-metric-unscheduled-downtime/" target="_blank">ABB Value of Reliability 2024 (Β£125K/hr mid-size)</a> Β·
226
+ <a href="https://pluto-men.com/human-error-persistent-challenge-manufacturing-operations/" target="_blank">Plutomen / ABB (23% human error rate)</a>
227
+ </div>
228
+ </div>
229
+
230
+ <div class="problem-card">
231
+ <div class="pc-eyebrow">Cost β€” 02 Β· Information search time across the floor workforce</div>
232
+ <div class="pc-title">Annual labour cost of document retrieval inefficiency</div>
233
+ <p class="pc-body">McKinsey research indicates employees spend an average of 1.8 hours per day searching for information. For a manufacturing floor workforce, this is a conservative estimate β€” the relevant figure is the time lost per incident when a technician needs a procedure and cannot locate it quickly. Across 260 floor workers, this accrues significantly.</p>
234
+ <div class="pc-calc">
235
+ <div class="line"><span class="lbl">Floor workers</span><span class="val">260</span></div>
236
+ <div class="line"><span class="lbl">Search time per worker per day</span><span class="val">0.5 hrs (conservative)</span></div>
237
+ <div class="line"><span class="lbl">Working days per year</span><span class="val">250</span></div>
238
+ <div class="line"><span class="lbl">Total search hours per year</span><span class="val">32,500 hrs</span></div>
239
+ <div class="line"><span class="lbl">Average floor labour cost per hour</span><span class="val">Β£18/hr</span></div>
240
+ <div class="line total"><span class="lbl total">Annual search time cost</span><span class="val">Β£585,000/yr</span></div>
241
+ </div>
242
+ <div class="pc-source">
243
+ β†— <a href="https://copernic.com/en/2025/03/21/the-hidden-costs-of-poor-document-search-how-much-time-is-your-business-wasting/" target="_blank">McKinsey Global Institute via Copernic 2025 (1.8 hrs/day baseline)</a> Β·
244
+ <a href="https://m-files.com/resources/en-hub/rt-main-blog-en/how-long-does-it-actually-take-to-find-a-document-dissecting-the-many-stats-out-there" target="_blank">Gartner via M-Files (18 min per document)</a>
245
+ </div>
246
+ </div>
247
+
248
+ <div class="problem-card">
249
+ <div class="pc-eyebrow">Cost β€” 03 Β· Non-conformance reports from procedure errors</div>
250
+ <div class="pc-title">Annual NCR cost from incorrect procedure application</div>
251
+ <p class="pc-body">FlexForm logged 14 NCRs in the last 12 months. Root cause analysis traced 9 of them to incorrect or incomplete procedure application β€” exactly the failure mode VaultRAG addresses. Each NCR incurs direct costs: engineering investigation, rework, customer notification, corrective action documentation.</p>
252
+ <div class="pc-calc">
253
+ <div class="line"><span class="lbl">NCRs last 12 months</span><span class="val">14</span></div>
254
+ <div class="line"><span class="lbl">NCRs traced to procedure errors</span><span class="val">9 (64%)</span></div>
255
+ <div class="line"><span class="lbl">Average NCR resolution cost</span><span class="val">Β£12,000</span></div>
256
+ <div class="line"><span class="lbl">Range (minor to major)</span><span class="val">Β£4,000–£40,000</span></div>
257
+ <div class="line total"><span class="lbl total">Annual NCR cost from procedure errors</span><span class="val">Β£108,000/yr</span></div>
258
+ </div>
259
+ <div class="pc-source">
260
+ β†— <a href="https://www.orcalean.com/article/common-pitfalls-in-work-instructions-that-lead-to-human-error-and-how-to-avoid-them" target="_blank">ASQ β€” 33% quality problems from human error</a> Β·
261
+ NCR cost estimate: composite of published automotive Tier-2 NCR cost studies
262
+ </div>
263
+ </div>
264
+
265
+ <div class="problem-card">
266
+ <div class="pc-eyebrow">Cost β€” 04 Β· Total addressable problem cost</div>
267
+ <div class="pc-title">Combined annual exposure at FlexForm</div>
268
+ <p class="pc-body">The three cost components above β€” downtime, search time, and NCR costs β€” represent the directly addressable financial exposure from the knowledge retrieval gap. VaultRAG does not eliminate all of these costs; it reduces the fraction attributable to slow or incorrect retrieval. Even a 10% improvement on the downtime line alone exceeds the annual cost of the solution by orders of magnitude.</p>
269
+ <div class="pc-calc">
270
+ <div class="line"><span class="lbl">Downtime attributable to procedure errors</span><span class="val">Β£23,000,000</span></div>
271
+ <div class="line"><span class="lbl">Search time productivity loss</span><span class="val">Β£585,000</span></div>
272
+ <div class="line"><span class="lbl">NCR costs from procedure errors</span><span class="val">Β£108,000</span></div>
273
+ <div class="line total"><span class="lbl total">Total annual addressable exposure</span><span class="val">~Β£23.7M/yr</span></div>
274
+ </div>
275
+ <div class="pc-source">Conservative estimate. Downtime figure uses Β£125K/hr (mid-size plant, ABB 2024), not Β£260K/hr (Aberdeen general manufacturing). Actual exposure likely higher.</div>
276
+ </div>
277
+ </div>
278
+ </section>
279
+
280
+ <!-- ══ 03 COST OF THE SOLUTION ══ -->
281
+ <section>
282
+ <div class="section-label">03 β€” Cost of the Solution</div>
283
+ <h2 class="section-title">Six components. <em>Four are structurally zero.</em></h2>
284
+ <p class="section-intro">VaultRAG's architecture is designed so that the majority of components have zero ongoing cost in both the demo environment and on-prem production. Real costs accrue on exactly two line items: the server hardware and the one-time model download. Everything else is open-source and runs at zero marginal cost per query.</p>
285
+
286
+ <!-- C1: Ollama + LLM -->
287
+ <div class="component-stack scroll-reveal">
288
+ <div class="comp-card">
289
+ <div class="comp-number">C1</div>
290
+ <div class="comp-body">
291
+ <div class="comp-title">LLM Inference β€” Ollama + Llama 3.2 3B</div>
292
+ <div class="comp-sub">Local execution Β· Port 11434 Β· No API calls</div>
293
+ <p class="comp-desc">Ollama serves Llama 3.2 3B entirely locally. Once the model is downloaded (one-time, ~2.0GB), every inference is free. There is no per-token cost, no API key, no rate limit, and no internet requirement. The marginal cost of every query β€” every guardrail check, every generation β€” is electricity.</p>
294
+ <div class="comp-detail">
295
+ <div class="dl"><span class="dk">Model download (one-time)</span><span class="dv">~2.0 GB Β· Llama 3.2 3B Q4</span></div>
296
+ <div class="dl"><span class="dk">Per-query inference cost</span><span class="dv">Β£0.00 Β· local GPU/CPU</span></div>
297
+ <div class="dl"><span class="dk">API calls to external services</span><span class="dv">Zero</span></div>
298
+ <div class="dl"><span class="dk">Comparison: OpenAI GPT-4o-mini</span><span class="dv">~$0.00015 per query Β· $1.50/10K queries</span></div>
299
+ <div class="dl"><span class="dk">Comparison: Anthropic Claude Haiku</span><span class="dv">~$0.00025 per query at 1K tokens</span></div>
300
+ </div>
301
+ <div class="comp-source">β†— <a href="https://ollama.com" target="_blank">Ollama.com β€” open source local model serving</a> Β· <a href="https://ai.meta.com/blog/llama-3-2-connect-2024-vision-edge-mobile-devices/" target="_blank">Meta Llama 3.2 β€” Apache 2.0 licence</a></div>
302
+ </div>
303
+ <div class="comp-cost">
304
+ <div class="cost-value zero">Β£0.00</div>
305
+ <div class="cost-period">per month</div>
306
+ <div class="cost-tag free">Structurally free</div>
307
+ </div>
308
+ </div>
309
+
310
+ <!-- C2: ChromaDB -->
311
+ <div class="comp-card">
312
+ <div class="comp-number">C2</div>
313
+ <div class="comp-body">
314
+ <div class="comp-title">Vector Store β€” ChromaDB</div>
315
+ <div class="comp-sub">Embedded Β· Persistent to disk Β· No server</div>
316
+ <p class="comp-desc">ChromaDB runs embedded in the Python process and persists the vector index to local disk. There is no managed service, no cloud egress, and no subscription fee. A 28,000-page document corpus produces approximately 140,000–280,000 chunks at procedural chunking density. ChromaDB handles this volume without degradation.</p>
317
+ <div class="comp-detail">
318
+ <div class="dl"><span class="dk">Licence</span><span class="dv">Apache 2.0 β€” free forever</span></div>
319
+ <div class="dl"><span class="dk">Estimated corpus size (FlexForm)</span><span class="dv">~140K–280K chunks</span></div>
320
+ <div class="dl"><span class="dk">Disk storage for embeddings</span><span class="dv">~2–4 GB (nomic-embed-text, 768-dim)</span></div>
321
+ <div class="dl"><span class="dk">Query latency at this scale</span><span class="dv">&lt; 200ms for top-k=3</span></div>
322
+ <div class="dl"><span class="dk">Comparison: Pinecone Serverless</span><span class="dv">$0.033/1M vectors stored + query costs</span></div>
323
+ </div>
324
+ <div class="comp-source">β†— <a href="https://www.trychroma.com" target="_blank">ChromaDB β€” open source embedding database</a></div>
325
+ </div>
326
+ <div class="comp-cost">
327
+ <div class="cost-value zero">Β£0.00</div>
328
+ <div class="cost-period">per month</div>
329
+ <div class="cost-tag free">Structurally free</div>
330
+ </div>
331
+ </div>
332
+
333
+ <!-- C3: LlamaIndex -->
334
+ <div class="comp-card">
335
+ <div class="comp-number">C3</div>
336
+ <div class="comp-body">
337
+ <div class="comp-title">RAG Orchestration β€” LlamaIndex</div>
338
+ <div class="comp-sub">Open source Β· MIT licence Β· No managed tier required</div>
339
+ <p class="comp-desc">LlamaIndex provides the ingestion pipeline, query engine, and retrieval orchestration. The open-source library (pip install llama-index) is free. LlamaCloud managed services exist but are not used. All orchestration runs locally in the same Python process as the FastAPI server.</p>
340
+ <div class="comp-detail">
341
+ <div class="dl"><span class="dk">Licence</span><span class="dv">MIT β€” free forever</span></div>
342
+ <div class="dl"><span class="dk">Managed services used</span><span class="dv">None</span></div>
343
+ <div class="dl"><span class="dk">LlamaCloud (not used)</span><span class="dv">$0.30/1K documents indexed Β· skipped</span></div>
344
+ </div>
345
+ <div class="comp-source">β†— <a href="https://www.llamaindex.ai" target="_blank">LlamaIndex β€” MIT licence</a></div>
346
+ </div>
347
+ <div class="comp-cost">
348
+ <div class="cost-value zero">Β£0.00</div>
349
+ <div class="cost-period">per month</div>
350
+ <div class="cost-tag free">Structurally free</div>
351
+ </div>
352
+ </div>
353
+
354
+ <!-- C4: FastAPI + frontend -->
355
+ <div class="comp-card">
356
+ <div class="comp-number">C4</div>
357
+ <div class="comp-body">
358
+ <div class="comp-title">Backend + Frontend β€” FastAPI Β· HTML/CSS/JS</div>
359
+ <div class="comp-sub">Open source Β· Served locally Β· No hosting cost in production</div>
360
+ <p class="comp-desc">FastAPI is open source (MIT). The frontend is a single HTML file served by FastAPI's static file handler. In production, this runs on the on-prem server with zero external hosting cost. In the demo environment, the frontend is hosted on GitHub Pages (free) and the backend on HuggingFace Spaces (free tier).</p>
361
+ <div class="comp-detail">
362
+ <div class="dl"><span class="dk">FastAPI licence</span><span class="dv">MIT β€” free</span></div>
363
+ <div class="dl"><span class="dk">Demo frontend hosting</span><span class="dv">GitHub Pages β€” free</span></div>
364
+ <div class="dl"><span class="dk">Demo backend hosting</span><span class="dv">HuggingFace Spaces free tier</span></div>
365
+ <div class="dl"><span class="dk">Production hosting</span><span class="dv">On-prem server β€” zero external cost</span></div>
366
+ </div>
367
+ <div class="comp-source">β†— <a href="https://fastapi.tiangolo.com" target="_blank">FastAPI β€” MIT licence</a> Β· <a href="https://pages.github.com" target="_blank">GitHub Pages β€” free</a> Β· <a href="https://huggingface.co/spaces" target="_blank">HuggingFace Spaces β€” free tier</a></div>
368
+ </div>
369
+ <div class="comp-cost">
370
+ <div class="cost-value zero">Β£0.00</div>
371
+ <div class="cost-period">per month</div>
372
+ <div class="cost-tag free">Structurally free</div>
373
+ </div>
374
+ </div>
375
+
376
+ <!-- C5: Server hardware -->
377
+ <div class="comp-card">
378
+ <div class="comp-number">C5</div>
379
+ <div class="comp-body">
380
+ <div class="comp-title">Server Hardware β€” On-Prem Production</div>
381
+ <div class="comp-sub">One-time capital cost Β· Shared infrastructure Β· 5-year depreciation</div>
382
+ <p class="comp-desc">Production VaultRAG runs on a facility server β€” either dedicated or shared with existing IT infrastructure. The minimum viable production spec is a machine with 32GB RAM and a modern consumer GPU (RTX 3080 or equivalent). Most manufacturing facilities already have servers of this class for MES, SCADA, or CAD workloads. If shared, the marginal hardware cost of VaultRAG is zero.</p>
383
+ <div class="comp-detail">
384
+ <div class="dl"><span class="dk">Minimum production spec</span><span class="dv">32GB RAM Β· RTX 3080 (10GB VRAM) Β· 500GB SSD</span></div>
385
+ <div class="dl"><span class="dk">Dedicated server cost (if new)</span><span class="dv">~Β£2,500–£4,000 one-time</span></div>
386
+ <div class="dl"><span class="dk">Amortised over 5 years</span><span class="dv">~Β£42–£67/month</span></div>
387
+ <div class="dl"><span class="dk">If shared with existing infrastructure</span><span class="dv">Β£0 incremental hardware cost</span></div>
388
+ <div class="dl"><span class="dk">Power consumption (GPU inference)</span><span class="dv">~Β£8–£15/month at UK industrial rates</span></div>
389
+ </div>
390
+ <div class="comp-source">β†— Hardware pricing: Scan.co.uk Β· Overclockers.co.uk Β· 2024 market rates Β· Power cost: Ofgem industrial tariff estimates</div>
391
+ </div>
392
+ <div class="comp-cost">
393
+ <div class="cost-value amber">Β£50</div>
394
+ <div class="cost-period">per month est.</div>
395
+ <div class="cost-tag paid">Amortised capex</div>
396
+ </div>
397
+ </div>
398
+
399
+ <!-- C6: Maintenance -->
400
+ <div class="comp-card">
401
+ <div class="comp-number">C6</div>
402
+ <div class="comp-body">
403
+ <div class="comp-title">Ongoing Maintenance β€” Document Re-indexing + Updates</div>
404
+ <div class="comp-sub">Internal IT time Β· Estimated 2–4 hrs/month</div>
405
+ <p class="comp-desc">The primary ongoing operational cost is re-indexing when documents change β€” new SOP versions, updated equipment manuals, revised NCR procedures. This is a script execution, not a development task. An internal IT administrator runs the ingestion pipeline when documents are updated. Estimated at 2–4 hours per month at mid-level IT rates.</p>
406
+ <div class="comp-detail">
407
+ <div class="dl"><span class="dk">Re-indexing time per document update</span><span class="dv">~15–30 min per batch (automated pipeline)</span></div>
408
+ <div class="dl"><span class="dk">Estimated update frequency</span><span class="dv">2–4 times per month</span></div>
409
+ <div class="dl"><span class="dk">IT administrator time per month</span><span class="dv">~2 hrs</span></div>
410
+ <div class="dl"><span class="dk">Mid-level IT rate (UK)</span><span class="dv">~Β£35/hr</span></div>
411
+ </div>
412
+ <div class="comp-source">β†— IT salary benchmarks: Reed Technology Salary Guide 2025 Β· Hays UK Tech Salary Report 2025</div>
413
+ </div>
414
+ <div class="comp-cost">
415
+ <div class="cost-value amber">Β£70</div>
416
+ <div class="cost-period">per month est.</div>
417
+ <div class="cost-tag paid">Internal IT time</div>
418
+ </div>
419
+ </div>
420
+ </div>
421
+ </section>
422
+
423
+ <!-- ══ 04 TOTAL COST SUMMARY ══ -->
424
+ <section>
425
+ <div class="section-label">04 β€” Total Cost Summary</div>
426
+ <h2 class="section-title">The full picture. <em>Side by side.</em></h2>
427
+ <p class="section-intro">Every number in one place. The cost of the problem, the cost of the solution, and the arithmetic that makes the case.</p>
428
+
429
+ <div class="total-box scroll-reveal">
430
+ <div class="total-header">VaultRAG v0.1 Β· FlexForm Precision Β· Annual cost comparison</div>
431
+ <div class="total-grid">
432
+ <div class="total-cell">
433
+ <div class="total-cell-label">Annual problem cost</div>
434
+ <div class="total-cell-value danger">Β£23.7M</div>
435
+ <div class="total-cell-desc">Downtime + search time + NCR costs attributable to knowledge retrieval gap</div>
436
+ </div>
437
+ <div class="total-cell">
438
+ <div class="total-cell-label">Annual solution cost</div>
439
+ <div class="total-cell-value amber">Β£1,440</div>
440
+ <div class="total-cell-desc">Β£120/month Β· server amortisation + IT maintenance. All software Β£0.</div>
441
+ </div>
442
+ <div class="total-cell">
443
+ <div class="total-cell-label">Breakeven improvement</div>
444
+ <div class="total-cell-value green">0.006%</div>
445
+ <div class="total-cell-desc">VaultRAG pays for itself if it prevents 0.006% of the annual problem cost</div>
446
+ </div>
447
+ <div class="total-cell">
448
+ <div class="total-cell-label">ROI at 10% improvement</div>
449
+ <div class="total-cell-value green">1,647Γ—</div>
450
+ <div class="total-cell-desc">A 10% reduction in procedure-error downtime returns Β£2.37M against Β£1,440 cost</div>
451
+ </div>
452
+ </div>
453
+ </div>
454
+
455
+ <!-- ROI BAR CHART SVG -->
456
+ <div class="roi-box scroll-reveal">
457
+ <div class="roi-header">Cost comparison β€” annual Β· logarithmic scale Β· FlexForm illustrative model</div>
458
+ <div class="roi-body">
459
+ <svg viewBox="0 0 900 280" xmlns="http://www.w3.org/2000/svg" font-family="'JetBrains Mono',monospace" width="100%">
460
+ <defs>
461
+ <linearGradient id="dangerGrad" x1="0" y1="0" x2="1" y2="0">
462
+ <stop offset="0%" stop-color="#ef4444"/>
463
+ <stop offset="100%" stop-color="#dc2626"/>
464
+ </linearGradient>
465
+ <linearGradient id="amberGrad2" x1="0" y1="0" x2="1" y2="0">
466
+ <stop offset="0%" stop-color="#d97706"/>
467
+ <stop offset="100%" stop-color="#f59e0b"/>
468
+ </linearGradient>
469
+ <linearGradient id="greenGrad" x1="0" y1="0" x2="1" y2="0">
470
+ <stop offset="0%" stop-color="#059669"/>
471
+ <stop offset="100%" stop-color="#10b981"/>
472
+ </linearGradient>
473
+ </defs>
474
+
475
+ <!-- Y axis label -->
476
+ <text x="10" y="20" font-size="7.5" fill="#4a5568" letter-spacing="1">ANNUAL COST (Β£)</text>
477
+
478
+ <!-- Grid lines -->
479
+ <line x1="160" y1="30" x2="880" y2="30" stroke="#262f42" stroke-width="1"/>
480
+ <line x1="160" y1="80" x2="880" y2="80" stroke="#262f42" stroke-width="1"/>
481
+ <line x1="160" y1="130" x2="880" y2="130" stroke="#262f42" stroke-width="1"/>
482
+ <line x1="160" y1="180" x2="880" y2="180" stroke="#262f42" stroke-width="1"/>
483
+ <line x1="160" y1="230" x2="880" y2="230" stroke="#262f42" stroke-width="1"/>
484
+
485
+ <!-- Y axis labels -->
486
+ <text x="150" y="34" text-anchor="end" font-size="7" fill="#4a5568">Β£25M</text>
487
+ <text x="150" y="84" text-anchor="end" font-size="7" fill="#4a5568">Β£2.5M</text>
488
+ <text x="150" y="134" text-anchor="end" font-size="7" fill="#4a5568">Β£250K</text>
489
+ <text x="150" y="184" text-anchor="end" font-size="7" fill="#4a5568">Β£25K</text>
490
+ <text x="150" y="234" text-anchor="end" font-size="7" fill="#4a5568">Β£2.5K</text>
491
+
492
+ <!-- BAR 1: Problem cost Β£23.7M -->
493
+ <rect x="200" y="32" width="140" height="196" rx="2" fill="url(#dangerGrad)" opacity="0.9"/>
494
+ <text x="270" y="28" text-anchor="middle" font-size="9" fill="#ef4444" font-weight="700">Β£23.7M</text>
495
+ <text x="270" y="248" text-anchor="middle" font-size="7.5" fill="#a0aec0">Annual</text>
496
+ <text x="270" y="260" text-anchor="middle" font-size="7.5" fill="#a0aec0">problem cost</text>
497
+
498
+ <!-- BAR 2: 10% improvement value Β£2.37M -->
499
+ <rect x="400" y="82" width="140" height="146" rx="2" fill="url(#amberGrad2)" opacity="0.85"/>
500
+ <text x="470" y="78" text-anchor="middle" font-size="9" fill="#f59e0b" font-weight="700">Β£2.37M</text>
501
+ <text x="470" y="248" text-anchor="middle" font-size="7.5" fill="#a0aec0">Value of 10%</text>
502
+ <text x="470" y="260" text-anchor="middle" font-size="7.5" fill="#a0aec0">improvement</text>
503
+
504
+ <!-- BAR 3: Solution cost Β£1,440 -->
505
+ <rect x="600" y="222" width="140" height="6" rx="1" fill="url(#greenGrad)" opacity="0.9"/>
506
+ <text x="670" y="218" text-anchor="middle" font-size="9" fill="#10b981" font-weight="700">Β£1,440</text>
507
+ <text x="670" y="248" text-anchor="middle" font-size="7.5" fill="#a0aec0">Annual</text>
508
+ <text x="670" y="260" text-anchor="middle" font-size="7.5" fill="#a0aec0">solution cost</text>
509
+
510
+ <!-- Annotation: ROI arrow -->
511
+ <line x1="740" y1="225" x2="800" y2="85" stroke="#10b981" stroke-width="1" stroke-dasharray="4,3" opacity="0.5"/>
512
+ <text x="820" y="80" text-anchor="middle" font-size="7.5" fill="#10b981">1,647Γ—</text>
513
+ <text x="820" y="92" text-anchor="middle" font-size="7" fill="#4a5568">ROI at 10%</text>
514
+ </svg>
515
+ </div>
516
+ </div>
517
+ </section>
518
+
519
+ <!-- ══ 05 COMPETITIVE COMPARISON ══ -->
520
+ <section>
521
+ <div class="section-label">05 β€” Competitive Comparison</div>
522
+ <h2 class="section-title">VaultRAG vs. <em>the alternatives.</em></h2>
523
+ <p class="section-intro">The choice is not between VaultRAG and nothing. It is between VaultRAG and the existing alternatives: cloud RAG services, enterprise knowledge bases, and doing nothing. Each has a cost and a compatibility profile.</p>
524
+
525
+ <div class="compare-wrap scroll-reveal">
526
+ <div class="compare-header">Solution comparison β€” FlexForm Precision context Β· 2026</div>
527
+ <table>
528
+ <thead>
529
+ <tr>
530
+ <th>Solution</th>
531
+ <th>Annual Cost</th>
532
+ <th>Data Sovereignty</th>
533
+ <th>Voice Input</th>
534
+ <th>Mobile-First</th>
535
+ <th>NDA / ITAR Compatible</th>
536
+ </tr>
537
+ </thead>
538
+ <tbody>
539
+ <tr>
540
+ <td><strong>VaultRAG v0.1</strong></td>
541
+ <td><span class="td-good">Β£1,440/yr</span></td>
542
+ <td><span class="td-good">βœ“ On-prem Β· zero egress</span></td>
543
+ <td><span class="td-good">βœ“ Web Speech API</span></td>
544
+ <td><span class="td-good">βœ“ Designed for it</span></td>
545
+ <td><span class="td-good">βœ“ Architecturally enforced</span></td>
546
+ </tr>
547
+ <tr>
548
+ <td>OpenAI-based RAG (custom)</td>
549
+ <td><span class="td-neutral">Β£8K–£40K/yr</span></td>
550
+ <td><span class="td-bad">βœ— Data sent to OpenAI API</span></td>
551
+ <td><span class="td-neutral">~ Add-on required</span></td>
552
+ <td><span class="td-neutral">~ Depends on build</span></td>
553
+ <td><span class="td-bad">βœ— Excluded by NDA/ITAR</span></td>
554
+ </tr>
555
+ <tr>
556
+ <td>Microsoft Copilot for M365</td>
557
+ <td><span class="td-bad">Β£360/user/yr Β· Β£122K for 340 users</span></td>
558
+ <td><span class="td-neutral">~ MS Azure cloud</span></td>
559
+ <td><span class="td-neutral">~ Limited</span></td>
560
+ <td><span class="td-neutral">~ Partial</span></td>
561
+ <td><span class="td-bad">βœ— Cloud dependency</span></td>
562
+ </tr>
563
+ <tr>
564
+ <td>SharePoint + keyword search</td>
565
+ <td><span class="td-neutral">Β£0 marginal (existing M365)</span></td>
566
+ <td><span class="td-neutral">~ MS cloud</span></td>
567
+ <td><span class="td-bad">βœ— None</span></td>
568
+ <td><span class="td-bad">βœ— Desktop-first UI</span></td>
569
+ <td><span class="td-neutral">~ Cloud dependent</span></td>
570
+ </tr>
571
+ <tr>
572
+ <td>Printed binders + tribal knowledge</td>
573
+ <td><span class="td-neutral">Β£0 direct cost</span></td>
574
+ <td><span class="td-good">βœ“ No digital egress</span></td>
575
+ <td><span class="td-bad">βœ— None</span></td>
576
+ <td><span class="td-bad">βœ— Not applicable</span></td>
577
+ <td><span class="td-good">βœ“ No digital data</span></td>
578
+ </tr>
579
+ <tr>
580
+ <td>Doing nothing</td>
581
+ <td><span class="td-bad">Β£0 direct Β· Β£23.7M indirect</span></td>
582
+ <td><span class="td-neutral">N/A</span></td>
583
+ <td><span class="td-bad">βœ—</span></td>
584
+ <td><span class="td-bad">βœ—</span></td>
585
+ <td><span class="td-neutral">N/A</span></td>
586
+ </tr>
587
+ </tbody>
588
+ </table>
589
+ </div>
590
+
591
+ <!-- Per-query cost breakdown -->
592
+ <div class="compare-wrap scroll-reveal">
593
+ <div class="compare-header">Per-query cost comparison β€” assuming 500 queries/month across 260 floor workers</div>
594
+ <table>
595
+ <thead>
596
+ <tr><th>Component</th><th>VaultRAG (on-prem)</th><th>OpenAI RAG equivalent</th><th>Saving</th></tr>
597
+ </thead>
598
+ <tbody>
599
+ <tr>
600
+ <td>LLM inference per query</td>
601
+ <td><span class="td-good">Β£0.000 Β· local Ollama</span></td>
602
+ <td><span class="td-bad">~Β£0.0001 Β· GPT-4o-mini</span></td>
603
+ <td><span class="td-good">100%</span></td>
604
+ </tr>
605
+ <tr>
606
+ <td>Embedding per query</td>
607
+ <td><span class="td-good">Β£0.000 Β· nomic-embed-text local</span></td>
608
+ <td><span class="td-bad">~Β£0.000002 Β· OpenAI ada-002</span></td>
609
+ <td><span class="td-good">100%</span></td>
610
+ </tr>
611
+ <tr>
612
+ <td>Vector search per query</td>
613
+ <td><span class="td-good">Β£0.000 Β· ChromaDB local</span></td>
614
+ <td><span class="td-bad">~Β£0.000033 Β· Pinecone serverless</span></td>
615
+ <td><span class="td-good">100%</span></td>
616
+ </tr>
617
+ <tr>
618
+ <td>Monthly total (500 queries)</td>
619
+ <td><span class="td-bold">Β£0.00 API costs</span></td>
620
+ <td><span class="td-bad">~Β£0.07 Β· minimal at small scale</span></td>
621
+ <td><span class="td-good">100%</span></td>
622
+ </tr>
623
+ <tr>
624
+ <td>Data sent to external API</td>
625
+ <td><span class="td-good">Zero bytes</span></td>
626
+ <td><span class="td-bad">Every query + every document chunk</span></td>
627
+ <td><span class="td-good">∞ data sovereignty</span></td>
628
+ </tr>
629
+ </tbody>
630
+ </table>
631
+ </div>
632
+
633
+ <div style="text-align:center;margin-top:32px;">
634
+ <a href="page-06.html" class="btn btn-primary">What's next β†’ Roadmap</a>
635
+ </div>
636
+ </section>
637
+
638
+ <div class="page-nav">
639
+ <a class="page-nav-link" href="page-04.html"><span class="page-nav-label">← Previous</span><span>Workflow Simulator</span></a>
640
+ <a class="page-nav-link next" href="page-06.html"><span class="page-nav-label">Next β†’</span><span>Roadmap</span></a>
641
+ </div>
642
+
643
+ <footer>
644
+ <p>VaultRAG Β· Architecture Portfolio Β· 2026 Β· <a href="https://github.com/raosiddharthp/VaultRAG">GitHub</a></p>
645
+ <p>Page 05 Β· Cost Model Β· Β© 2026 Siddharth Rao</p>
646
+ </footer>
647
+
648
+ <script>
649
+ const reveals = document.querySelectorAll('.scroll-reveal');
650
+ const obs = new IntersectionObserver(entries => {
651
+ entries.forEach(e => { if(e.isIntersecting){e.target.classList.add('visible');obs.unobserve(e.target);}});
652
+ },{threshold:0.07});
653
+ reveals.forEach(el => obs.observe(el));
654
+ </script>
655
+ </body>
656
+ </html>
page-06.html ADDED
@@ -0,0 +1,649 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>VaultRAG β€” Roadmap</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap" rel="stylesheet">
10
+ <style>
11
+ :root {
12
+ --steel-900:#0e1117;--steel-800:#161c27;--steel-700:#1e2535;
13
+ --steel-600:#262f42;--steel-500:#344057;--steel-400:#4a5568;
14
+ --steel-300:#718096;--steel-200:#a0aec0;--steel-100:#cbd5e0;
15
+ --amber-500:#f59e0b;--amber-400:#fbbf24;--amber-600:#d97706;
16
+ --danger:#ef4444;--success:#10b981;--info:#3b82f6;--purple:#8b5cf6;
17
+ --font-display:'Barlow Condensed',sans-serif;
18
+ --font-body:'Barlow',sans-serif;
19
+ --font-mono:'JetBrains Mono',monospace;
20
+ }
21
+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
22
+ html{scroll-behavior:smooth;}
23
+ body{background:var(--steel-900);color:var(--steel-100);font-family:var(--font-body);font-size:16px;line-height:1.7;overflow-x:hidden;}
24
+ body::before{content:'';position:fixed;inset:0;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");pointer-events:none;z-index:0;opacity:0.4;}
25
+
26
+ nav{position:fixed;top:0;left:0;right:0;z-index:100;display:flex;align-items:center;justify-content:space-between;padding:0 48px;height:64px;background:rgba(14,17,23,0.94);backdrop-filter:blur(12px);border-bottom:1px solid rgba(245,158,11,0.15);}
27
+ .nav-brand{font-family:var(--font-display);font-weight:700;font-size:1.2rem;letter-spacing:0.08em;color:var(--amber-400);text-decoration:none;}
28
+ .nav-brand span{color:var(--steel-300);font-weight:300;}
29
+ nav ul{display:flex;gap:24px;list-style:none;}
30
+ nav a{font-family:var(--font-mono);font-size:0.68rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--steel-300);text-decoration:none;transition:color 0.2s;}
31
+ nav a:hover,nav a.active{color:var(--amber-400);}
32
+ .nav-github{color:var(--amber-400)!important;border:1px solid var(--amber-500);padding:6px 14px;border-radius:2px;}
33
+ .nav-github:hover{background:var(--amber-500)!important;color:var(--steel-900)!important;}
34
+
35
+ .page-header{padding:120px 48px 56px;position:relative;z-index:1;border-bottom:1px solid var(--steel-700);background:linear-gradient(180deg,rgba(139,92,246,0.04) 0%,transparent 100%);}
36
+ .page-header::after{content:'';position:absolute;inset:0;background-image:linear-gradient(rgba(139,92,246,0.025) 1px,transparent 1px),linear-gradient(90deg,rgba(139,92,246,0.025) 1px,transparent 1px);background-size:60px 60px;pointer-events:none;}
37
+ .breadcrumb{font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--steel-400);margin-bottom:16px;display:flex;align-items:center;gap:8px;}
38
+ .breadcrumb a{color:var(--steel-400);text-decoration:none;}
39
+ .breadcrumb a:hover{color:var(--amber-400);}
40
+ .breadcrumb span{color:var(--steel-600);}
41
+ .page-number{font-family:var(--font-display);font-size:7rem;font-weight:800;color:rgba(139,92,246,0.06);line-height:1;position:absolute;right:48px;top:80px;pointer-events:none;}
42
+ .page-title{font-family:var(--font-display);font-size:clamp(2.8rem,5.5vw,5rem);font-weight:800;line-height:0.95;margin-bottom:20px;max-width:820px;}
43
+ .page-title em{font-style:italic;font-weight:300;color:var(--purple);}
44
+ .page-intro{font-size:1rem;color:var(--steel-200);max-width:680px;line-height:1.8;}
45
+
46
+ section{position:relative;z-index:1;padding:72px 48px;}
47
+ section+section{border-top:1px solid var(--steel-800);}
48
+ .section-label{font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.2em;text-transform:uppercase;color:var(--amber-500);margin-bottom:14px;display:flex;align-items:center;gap:10px;}
49
+ .section-label::after{content:'';flex:1;max-width:50px;height:1px;background:var(--amber-600);}
50
+ .section-title{font-family:var(--font-display);font-size:clamp(1.8rem,3vw,2.6rem);font-weight:700;color:#fff;margin-bottom:14px;line-height:1.1;}
51
+ .section-title em{font-style:italic;font-weight:300;color:var(--amber-400);}
52
+ .section-intro{font-size:0.95rem;color:var(--steel-200);max-width:680px;line-height:1.8;margin-bottom:48px;}
53
+
54
+ /* VERSION TIMELINE */
55
+ .version-timeline{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;background:var(--steel-700);border-radius:4px;overflow:hidden;margin-bottom:64px;}
56
+ .version-card{background:var(--steel-800);padding:36px 28px;position:relative;}
57
+ .version-card::before{content:'';position:absolute;top:0;left:0;right:0;height:4px;}
58
+ .version-card.v01::before{background:var(--amber-500);}
59
+ .version-card.v10::before{background:var(--success);}
60
+ .version-card.vfuture::before{background:var(--purple);}
61
+ .version-badge{font-family:var(--font-display);font-size:3rem;font-weight:800;line-height:1;margin-bottom:8px;}
62
+ .version-card.v01 .version-badge{color:rgba(245,158,11,0.2);}
63
+ .version-card.v10 .version-badge{color:rgba(16,185,129,0.2);}
64
+ .version-card.vfuture .version-badge{color:rgba(139,92,246,0.2);}
65
+ .version-label{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.15em;text-transform:uppercase;margin-bottom:16px;}
66
+ .version-card.v01 .version-label{color:var(--amber-500);}
67
+ .version-card.v10 .version-label{color:var(--success);}
68
+ .version-card.vfuture .version-label{color:var(--purple);}
69
+ .version-name{font-family:var(--font-display);font-size:1.4rem;font-weight:700;color:#fff;margin-bottom:12px;}
70
+ .version-desc{font-size:0.88rem;color:var(--steel-300);line-height:1.7;margin-bottom:20px;}
71
+ .version-status{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.1em;text-transform:uppercase;padding:5px 12px;border-radius:2px;display:inline-block;}
72
+ .version-card.v01 .version-status{background:rgba(245,158,11,0.12);color:var(--amber-400);border:1px solid rgba(245,158,11,0.25);}
73
+ .version-card.v10 .version-status{background:rgba(16,185,129,0.1);color:var(--success);border:1px solid rgba(16,185,129,0.2);}
74
+ .version-card.vfuture .version-status{background:rgba(139,92,246,0.1);color:var(--purple);border:1px solid rgba(139,92,246,0.2);}
75
+
76
+ /* MVP SCOPE TABLE */
77
+ .scope-table-wrap{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:4px;overflow:hidden;margin-bottom:64px;}
78
+ .scope-table-header{padding:16px 24px;background:var(--steel-700);border-bottom:1px solid var(--steel-600);font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.15em;text-transform:uppercase;color:var(--amber-400);}
79
+ table{width:100%;border-collapse:collapse;}
80
+ th{background:var(--steel-700);padding:12px 20px;text-align:left;font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--steel-300);border-bottom:1px solid var(--steel-600);}
81
+ td{padding:13px 20px;border-bottom:1px solid rgba(38,47,66,0.7);font-size:0.88rem;color:var(--steel-200);vertical-align:top;line-height:1.55;}
82
+ tr:last-child td{border-bottom:none;}
83
+ tr:hover td{background:rgba(38,47,66,0.3);}
84
+ .status-pill{font-family:var(--font-mono);font-size:0.58rem;letter-spacing:0.1em;text-transform:uppercase;padding:3px 8px;border-radius:2px;white-space:nowrap;display:inline-block;}
85
+ .pill-in{background:rgba(245,158,11,0.12);color:var(--amber-400);border:1px solid rgba(245,158,11,0.25);}
86
+ .pill-out{background:rgba(239,68,68,0.1);color:var(--danger);border:1px solid rgba(239,68,68,0.2);}
87
+ .pill-future{background:rgba(139,92,246,0.1);color:var(--purple);border:1px solid rgba(139,92,246,0.2);}
88
+ .pill-prod{background:rgba(16,185,129,0.1);color:var(--success);border:1px solid rgba(16,185,129,0.2);}
89
+
90
+ /* ROADMAP ITEMS */
91
+ .roadmap-grid{display:grid;grid-template-columns:1fr 1fr;gap:2px;background:var(--steel-700);border-radius:4px;overflow:hidden;margin-bottom:64px;}
92
+ .roadmap-item{background:var(--steel-800);padding:32px 28px;position:relative;}
93
+ .roadmap-item::before{content:'';position:absolute;top:0;left:0;bottom:0;width:3px;}
94
+ .roadmap-item.v10::before{background:var(--success);}
95
+ .roadmap-item.future::before{background:var(--purple);}
96
+ .ri-version{font-family:var(--font-mono);font-size:0.6rem;letter-spacing:0.15em;text-transform:uppercase;margin-bottom:10px;}
97
+ .roadmap-item.v10 .ri-version{color:var(--success);}
98
+ .roadmap-item.future .ri-version{color:var(--purple);}
99
+ .ri-title{font-family:var(--font-display);font-size:1.2rem;font-weight:700;color:#fff;margin-bottom:10px;line-height:1.2;}
100
+ .ri-body{font-size:0.87rem;color:var(--steel-300);line-height:1.7;margin-bottom:14px;}
101
+ .ri-why{font-size:0.82rem;color:var(--steel-400);font-style:italic;line-height:1.6;padding:10px 14px;background:var(--steel-700);border-radius:3px;border-left:2px solid var(--steel-500);}
102
+ .roadmap-item.v10 .ri-why{border-color:var(--success);}
103
+ .roadmap-item.future .ri-why{border-color:var(--purple);}
104
+
105
+ /* DEFERRED DECISIONS */
106
+ .deferred-stack{display:flex;flex-direction:column;gap:2px;background:var(--steel-700);border-radius:4px;overflow:hidden;margin-bottom:64px;}
107
+ .deferred-item{background:var(--steel-800);display:grid;grid-template-columns:1fr auto;gap:24px;align-items:start;padding:24px 28px;}
108
+ .di-title{font-family:var(--font-display);font-size:1.05rem;font-weight:600;color:var(--steel-100);margin-bottom:6px;}
109
+ .di-body{font-size:0.85rem;color:var(--steel-400);line-height:1.65;}
110
+ .di-reason{font-family:var(--font-mono);font-size:0.65rem;color:var(--steel-500);margin-top:8px;}
111
+ .di-version{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.1em;text-transform:uppercase;padding:4px 10px;border-radius:2px;white-space:nowrap;align-self:flex-start;}
112
+
113
+ /* PORTFOLIO SIGNAL */
114
+ .signal-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;background:var(--steel-700);border-radius:4px;overflow:hidden;margin-bottom:64px;}
115
+ .signal-card{background:var(--steel-800);padding:32px 26px;}
116
+ .signal-role{font-family:var(--font-mono);font-size:0.6rem;letter-spacing:0.18em;text-transform:uppercase;color:var(--amber-600);margin-bottom:14px;}
117
+ .signal-title{font-family:var(--font-display);font-size:1.15rem;font-weight:700;color:#fff;margin-bottom:10px;line-height:1.2;}
118
+ .signal-items{display:flex;flex-direction:column;gap:8px;}
119
+ .signal-item{font-size:0.85rem;color:var(--steel-300);line-height:1.6;display:flex;gap:8px;}
120
+ .signal-item::before{content:'β†’';color:var(--amber-600);flex-shrink:0;margin-top:1px;}
121
+
122
+ /* CLOSING STATEMENT */
123
+ .closing{background:var(--steel-700);border-radius:6px;padding:56px 48px;margin-top:64px;position:relative;overflow:hidden;}
124
+ .closing::before{content:'';position:absolute;inset:0;background-image:linear-gradient(rgba(245,158,11,0.03) 1px,transparent 1px),linear-gradient(90deg,rgba(245,158,11,0.03) 1px,transparent 1px);background-size:40px 40px;}
125
+ .closing-text{font-family:var(--font-display);font-size:clamp(1.8rem,3.5vw,3rem);font-weight:700;line-height:1.15;max-width:720px;position:relative;z-index:1;}
126
+ .closing-text em{font-style:italic;font-weight:300;color:var(--amber-400);}
127
+ .closing-sub{font-size:0.95rem;color:var(--steel-300);max-width:560px;line-height:1.8;margin-top:20px;position:relative;z-index:1;}
128
+ .closing-links{display:flex;gap:12px;margin-top:32px;flex-wrap:wrap;position:relative;z-index:1;}
129
+ .btn{font-family:var(--font-mono);font-size:0.7rem;letter-spacing:0.1em;text-transform:uppercase;text-decoration:none;padding:12px 24px;border-radius:2px;transition:all 0.2s;display:inline-flex;align-items:center;gap:8px;}
130
+ .btn-primary{background:var(--amber-500);color:var(--steel-900);font-weight:700;}
131
+ .btn-primary:hover{background:var(--amber-400);}
132
+ .btn-ghost{border:1px solid var(--steel-500);color:var(--steel-200);}
133
+ .btn-ghost:hover{border-color:var(--amber-500);color:var(--amber-400);}
134
+
135
+ /* FULL DIAGRAM */
136
+ .diagram-wrap{background:var(--steel-800);border:1px solid var(--steel-600);border-radius:6px;padding:40px;margin-bottom:48px;overflow:hidden;position:relative;}
137
+ .diagram-wrap::before{content:'';position:absolute;inset:0;background-image:linear-gradient(rgba(245,158,11,0.02) 1px,transparent 1px),linear-gradient(90deg,rgba(245,158,11,0.02) 1px,transparent 1px);background-size:40px 40px;pointer-events:none;}
138
+ .diagram-label{font-family:var(--font-mono);font-size:0.65rem;letter-spacing:0.18em;text-transform:uppercase;color:var(--steel-300);margin-bottom:28px;display:flex;align-items:center;gap:10px;position:relative;z-index:1;}
139
+ .diagram-label::before{content:'';width:8px;height:8px;border-radius:50%;flex-shrink:0;background:var(--purple);box-shadow:0 0 8px var(--purple);}
140
+
141
+ /* SCROLL REVEAL */
142
+ .scroll-reveal{opacity:0;transform:translateY(24px);transition:opacity 0.7s,transform 0.7s;}
143
+ .scroll-reveal.visible{opacity:1;transform:translateY(0);}
144
+
145
+ .page-nav{display:flex;justify-content:space-between;align-items:center;padding:40px 48px;border-top:1px solid var(--steel-700);}
146
+ .page-nav-link{font-family:var(--font-mono);font-size:0.7rem;letter-spacing:0.1em;text-transform:uppercase;text-decoration:none;color:var(--steel-300);display:flex;flex-direction:column;gap:6px;transition:color 0.2s;}
147
+ .page-nav-link:hover{color:var(--amber-400);}
148
+ .page-nav-label{font-size:0.6rem;color:var(--steel-500);}
149
+ .page-nav-link.next{text-align:right;}
150
+
151
+ footer{padding:40px 48px;display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--steel-800);}
152
+ footer p{font-family:var(--font-mono);font-size:0.62rem;letter-spacing:0.1em;color:var(--steel-500);text-transform:uppercase;}
153
+ footer a{color:var(--steel-400);text-decoration:none;}
154
+ footer a:hover{color:var(--amber-400);}
155
+
156
+ @media(max-width:900px){
157
+ nav{padding:0 20px;} nav ul{display:none;}
158
+ .page-header{padding:100px 24px 48px;} .page-number{display:none;}
159
+ section{padding:48px 24px;}
160
+ .version-timeline,.roadmap-grid,.signal-grid{grid-template-columns:1fr;}
161
+ .closing{padding:36px 24px;}
162
+ .page-nav{padding:28px 24px;}
163
+ footer{padding:28px 24px;flex-direction:column;gap:12px;text-align:center;}
164
+ }
165
+ </style>
166
+ </head>
167
+ <body>
168
+
169
+ <nav>
170
+ <a class="nav-brand" href="index.html">VAULT<span>RAG</span></a>
171
+ <ul>
172
+ <li><a href="index.html">Overview</a></li>
173
+ <li><a href="page-02.html">The Problem</a></li>
174
+ <li><a href="page-03.html">Architecture</a></li>
175
+ <li><a href="page-04.html">Simulator</a></li>
176
+ <li><a href="page-05.html">Cost Model</a></li>
177
+ <li><a href="page-06.html" class="active">Roadmap</a></li>
178
+ <li><a href="https://github.com/raosiddharthp/VaultRAG" class="nav-github">GitHub β†’</a></li>
179
+ </ul>
180
+ </nav>
181
+
182
+ <div class="page-header">
183
+ <div class="page-number">06</div>
184
+ <div class="breadcrumb">
185
+ <a href="index.html">VaultRAG</a><span>/</span>
186
+ <span>Page 06</span><span>/</span><span>Roadmap</span>
187
+ </div>
188
+ <h1 class="page-title">What v0.1 delivers.<br><em>What it deliberately doesn't.</em></h1>
189
+ <p class="page-intro">A roadmap is not a wishlist. Every item deferred from v0.1 was a deliberate architectural decision with a documented reason. This page states what the MVP delivers, what was excluded and why, and what a production path to v1.0 looks like β€” so a reviewer can assess judgment, not just capability.</p>
190
+ </div>
191
+
192
+ <!-- ══ 01 THREE VERSIONS ══ -->
193
+ <section>
194
+ <div class="section-label">01 β€” Version Overview</div>
195
+ <h2 class="section-title">Three stages. <em>One coherent path.</em></h2>
196
+ <p class="section-intro">Each version solves a specific problem and sets up the next. v0.1 proves the core loop works. v1.0 makes it production-ready. The future vision extends the platform to adjacent use cases without re-solving trust or safety.</p>
197
+
198
+ <div class="version-timeline scroll-reveal">
199
+ <div class="version-card v01">
200
+ <div class="version-badge">v0.1</div>
201
+ <div class="version-label">Current Β· MVP</div>
202
+ <div class="version-name">The Core Loop, Working</div>
203
+ <p class="version-desc">Voice query β†’ 5-layer guardrail pipeline β†’ cited procedure response. On-prem. Single document corpus. One user at a time. Deployed on HuggingFace Spaces for demo. The proof that the architecture is sound and the guardrails work as designed.</p>
204
+ <span class="version-status">Portfolio demo Β· Built</span>
205
+ </div>
206
+ <div class="version-card v10">
207
+ <div class="version-badge">v1.0</div>
208
+ <div class="version-label">Production path</div>
209
+ <div class="version-name">Multi-User Β· Multi-Corpus Β· Auditable</div>
210
+ <p class="version-desc">Department-level document namespacing. Role-based query permissions. Immutable audit log of every query and response. LlamaGuard integration on the safety path. Whisper local for fully air-gapped voice. Word and PowerPoint ingestion. Production hardware with GPU acceleration.</p>
211
+ <span class="version-status">Designed Β· Not built</span>
212
+ </div>
213
+ <div class="version-card vfuture">
214
+ <div class="version-badge">v2+</div>
215
+ <div class="version-label">Platform vision</div>
216
+ <div class="version-name">The Governed Intelligence Utility</div>
217
+ <p class="version-desc">VaultRAG as a platform abstraction layer: multiple secure assistants (maintenance, quality, safety, engineering) sharing a common on-prem trust infrastructure without re-solving the sovereignty and guardrail problems for each new use case. Proactive alerts when documents are updated. Multi-site federation.</p>
218
+ <span class="version-status">Vision Β· Architecture sketched</span>
219
+ </div>
220
+ </div>
221
+ </section>
222
+
223
+ <!-- ══ 02 MVP SCOPE ══ -->
224
+ <section>
225
+ <div class="section-label">02 β€” MVP Scope</div>
226
+ <h2 class="section-title">What is in v0.1. <em>What is not. Why.</em></h2>
227
+ <p class="section-intro">The principle for MVP scope was ruthless: every component must either make the core loop work or make a guardrail fire. Anything that did neither was deferred. This table is the complete inventory.</p>
228
+
229
+ <div class="scope-table-wrap scroll-reveal">
230
+ <div class="scope-table-header">VaultRAG v0.1 β€” complete feature scope</div>
231
+ <table>
232
+ <thead>
233
+ <tr><th>Feature</th><th>v0.1 Status</th><th>Decision rationale</th></tr>
234
+ </thead>
235
+ <tbody>
236
+ <tr>
237
+ <td><strong>Voice input via Web Speech API</strong></td>
238
+ <td><span class="status-pill pill-in">In v0.1</span></td>
239
+ <td>Core user interface requirement. A technician on the floor cannot type reliably. Without voice, the product fails its primary user.</td>
240
+ </tr>
241
+ <tr>
242
+ <td><strong>Text fallback input</strong></td>
243
+ <td><span class="status-pill pill-in">In v0.1</span></td>
244
+ <td>Voice recognition fails in extreme noise environments (&gt;100dB). Keyboard fallback ensures the system never leaves a user without recourse.</td>
245
+ </tr>
246
+ <tr>
247
+ <td><strong>PDF and TXT document ingestion</strong></td>
248
+ <td><span class="status-pill pill-in">In v0.1</span></td>
249
+ <td>The two dominant formats for manufacturing documentation. Everything else is roadmap.</td>
250
+ </tr>
251
+ <tr>
252
+ <td><strong>Procedural section chunking</strong></td>
253
+ <td><span class="status-pill pill-in">In v0.1</span></td>
254
+ <td>Safety-critical requirement. Token-window chunking splits procedures and produces incomplete β€” potentially dangerous β€” responses. See ADR-008.</td>
255
+ </tr>
256
+ <tr>
257
+ <td><strong>5-layer guardrail pipeline (G1–G5)</strong></td>
258
+ <td><span class="status-pill pill-in">In v0.1</span></td>
259
+ <td>Portfolio differentiator and safety requirement. Not optional in a manufacturing context. All five layers implemented as custom prompt-based logic.</td>
260
+ </tr>
261
+ <tr>
262
+ <td><strong>ChromaDB vector store</strong></td>
263
+ <td><span class="status-pill pill-in">In v0.1</span></td>
264
+ <td>Core retrieval infrastructure. The RAG pipeline cannot function without a vector store.</td>
265
+ </tr>
266
+ <tr>
267
+ <td><strong>Llama 3.2 3B via Ollama</strong></td>
268
+ <td><span class="status-pill pill-in">In v0.1</span></td>
269
+ <td>Local LLM is the architectural invariant. Ollama is the simplest local serving solution. 3B chosen for demo environment RAM constraints. See ADR-001.</td>
270
+ </tr>
271
+ <tr>
272
+ <td><strong>Mobile-responsive chat UI</strong></td>
273
+ <td><span class="status-pill pill-in">In v0.1</span></td>
274
+ <td>The primary user is on a phone on the factory floor. A desktop-first UI fails the primary persona entirely.</td>
275
+ </tr>
276
+ <tr>
277
+ <td><strong>Single document corpus</strong></td>
278
+ <td><span class="status-pill pill-in">In v0.1</span></td>
279
+ <td>Multi-corpus management adds indexing complexity, namespace isolation, and corpus selection logic that are v1.0 concerns. MVP validates the single-corpus pipeline first.</td>
280
+ </tr>
281
+ <tr>
282
+ <td>User authentication / login</td>
283
+ <td><span class="status-pill pill-out">Deferred v1.0</span></td>
284
+ <td>Authentication is an operational requirement but not a pipeline requirement. It adds session management, token handling, and role logic that are not needed to validate the core RAG loop.</td>
285
+ </tr>
286
+ <tr>
287
+ <td>Department-level document namespacing</td>
288
+ <td><span class="status-pill pill-out">Deferred v1.0</span></td>
289
+ <td>Role-based corpus access requires user identity, which requires authentication. The dependency chain means this follows auth, not precedes it.</td>
290
+ </tr>
291
+ <tr>
292
+ <td>Immutable audit log</td>
293
+ <td><span class="status-pill pill-out">Deferred v1.0</span></td>
294
+ <td>Essential for ISO 9001 compliance and internal governance. Not required to validate that the pipeline retrieves and cites correctly. Designed but not implemented.</td>
295
+ </tr>
296
+ <tr>
297
+ <td>LlamaGuard integration</td>
298
+ <td><span class="status-pill pill-out">Deferred v1.0</span></td>
299
+ <td>RAM-infeasible alongside Llama 3.2 3B on free demo tier. Custom G4 Safety Flag provides sufficient protection for MVP. LlamaGuard activates on G4 trigger in v1.0 β€” conditional, not always-on. See ADR-003.</td>
300
+ </tr>
301
+ <tr>
302
+ <td>Word / PowerPoint ingestion</td>
303
+ <td><span class="status-pill pill-out">Deferred v1.0</span></td>
304
+ <td>Many SOPs live in .docx format. python-docx integration is straightforward but adds a dependency and format-specific chunking logic. Deferred to keep MVP ingestion pipeline clean.</td>
305
+ </tr>
306
+ <tr>
307
+ <td>Whisper local voice (air-gapped)</td>
308
+ <td><span class="status-pill pill-out">Deferred v1.0</span></td>
309
+ <td>Web Speech API uses device STT (Google/Apple backend). For fully air-gapped facilities, local Whisper is required. Added RAM overhead makes it a production concern, not MVP. See ADR-005.</td>
310
+ </tr>
311
+ <tr>
312
+ <td>Text-to-speech response readback</td>
313
+ <td><span class="status-pill pill-out">Deferred v1.0</span></td>
314
+ <td>Logical extension of the voice-first paradigm β€” reading the response aloud hands-free. Web Speech Synthesis API makes this a one-line addition. Deferred to keep MVP UI surface minimal.</td>
315
+ </tr>
316
+ <tr>
317
+ <td>Query history and session memory</td>
318
+ <td><span class="status-pill pill-out">Deferred v1.0</span></td>
319
+ <td>Persistent conversation history requires session storage and raises data retention questions. Each VaultRAG query is stateless by design in v0.1 β€” simpler, safer, easier to audit.</td>
320
+ </tr>
321
+ <tr>
322
+ <td>Multi-site federation</td>
323
+ <td><span class="status-pill pill-future">v2+ vision</span></td>
324
+ <td>Multiple facility instances sharing a common document standard but isolated corpora. Requires a federation layer and inter-site governance model. Platform-level concern.</td>
325
+ </tr>
326
+ <tr>
327
+ <td>Proactive document update alerts</td>
328
+ <td><span class="status-pill pill-future">v2+ vision</span></td>
329
+ <td>Notify technicians when a procedure they previously queried has been updated. Requires query history (v1.0), document versioning, and a notification pipeline.</td>
330
+ </tr>
331
+ <tr>
332
+ <td>Custom disclaimer injection per department</td>
333
+ <td><span class="status-pill pill-future">v2+ vision</span></td>
334
+ <td>Prepend department-specific legal or compliance text to responses. Requires department namespacing and user identity β€” both v1.0 foundations.</td>
335
+ </tr>
336
+ </tbody>
337
+ </table>
338
+ </div>
339
+ </section>
340
+
341
+ <!-- ══ 03 V1.0 ROADMAP ══ -->
342
+ <section>
343
+ <div class="section-label">03 β€” v1.0 Production Path</div>
344
+ <h2 class="section-title">Eight additions. <em>Each one justified.</em></h2>
345
+ <p class="section-intro">These are not features for features' sake. Each v1.0 addition resolves a specific gap between the portfolio demo and a system a manufacturer would trust in production. The ordering is intentional β€” auth enables namespacing; namespacing enables audit; audit enables compliance.</p>
346
+
347
+ <div class="roadmap-grid scroll-reveal">
348
+
349
+ <div class="roadmap-item v10">
350
+ <div class="ri-version">v1.0 Β· Priority 1</div>
351
+ <div class="ri-title">User authentication + role-based access</div>
352
+ <p class="ri-body">JWT-based authentication. Each user belongs to one or more departments. Queries are scoped to the user's permitted corpus namespaces. A maintenance technician cannot query the Legal department's documents. An engineering manager can query both.</p>
353
+ <div class="ri-why">Why now: Without auth, the system cannot enforce data governance at the user level. Every subsequent v1.0 feature depends on knowing who is asking.</div>
354
+ </div>
355
+
356
+ <div class="roadmap-item v10">
357
+ <div class="ri-version">v1.0 Β· Priority 2</div>
358
+ <div class="ri-title">Department-level document namespacing</div>
359
+ <p class="ri-body">ChromaDB collections mapped to organisational namespaces. Maintenance docs, quality SOPs, engineering drawings, and safety procedures indexed in isolated collections. Query routing respects the authenticated user's permitted namespaces.</p>
360
+ <div class="ri-why">Why now: A single flat corpus is a demo simplification. Production facilities have strict need-to-know controls on document access β€” especially in ISO-audited environments.</div>
361
+ </div>
362
+
363
+ <div class="roadmap-item v10">
364
+ <div class="ri-version">v1.0 Β· Priority 3</div>
365
+ <div class="ri-title">Immutable audit log β€” every query, every response</div>
366
+ <p class="ri-body">Append-only log with timestamp, user ID, normalised query, retrieved chunk references, guardrail outcomes, and response hash. Written before the response is delivered. Cannot be modified or deleted. Reviewed in ISO 9001 management reviews.</p>
367
+ <div class="ri-why">Why now: Regulated manufacturers require evidence that every AI-assisted decision is traceable. Without an audit trail, VaultRAG cannot be used in an ISO-audited environment. This is a compliance gate, not a nice-to-have.</div>
368
+ </div>
369
+
370
+ <div class="roadmap-item v10">
371
+ <div class="ri-version">v1.0 Β· Priority 4</div>
372
+ <div class="ri-title">LlamaGuard on G4 trigger (conditional, not always-on)</div>
373
+ <p class="ri-body">LlamaGuard 2 activates only when the custom G4 Safety Flag fires β€” adding a safety model validation layer for the highest-stakes queries without the always-on RAM overhead. G4 acts as a triage gate; LlamaGuard acts as a secondary validator on G4-triggered queries only.</p>
374
+ <div class="ri-why">Why now: Custom keyword-based G4 has false-negative risk (novel hazard phrasing not in the keyword list). LlamaGuard adds adversarial robustness. The conditional activation pattern solves the RAM problem identified in ADR-003.</div>
375
+ </div>
376
+
377
+ <div class="roadmap-item v10">
378
+ <div class="ri-version">v1.0 Β· Priority 5</div>
379
+ <div class="ri-title">Whisper local STT for air-gapped facilities</div>
380
+ <p class="ri-body">Replace Web Speech API with locally deployed Whisper medium (244M parameters) for facilities that prohibit any device-level cloud connection. Whisper runs in a separate Docker container, receives audio via internal HTTP, returns transcription with no external calls. GPU-accelerated: &lt;1s for a 5-second query.</p>
381
+ <div class="ri-why">Why now: Web Speech API uses Google or Apple backend STT β€” this violates strict air-gapped requirements. Facilities operating under classified or defence supply chain constraints need local STT. v0.1 documents this as a known limitation.</div>
382
+ </div>
383
+
384
+ <div class="roadmap-item v10">
385
+ <div class="ri-version">v1.0 Β· Priority 6</div>
386
+ <div class="ri-title">Word and PowerPoint document ingestion</div>
387
+ <p class="ri-body">python-docx for .docx parsing with heading-based chunking. python-pptx for .pptx parsing with slide-title chunking. Many manufacturing SOPs are authored in Word; many training materials in PowerPoint. Extending ingestion beyond PDF/TXT captures the majority of the real-world corpus.</p>
388
+ <div class="ri-why">Why now: The MVP corpus is limited to PDF and TXT. A real facility's documentation estate is 60–70% Word documents. Without .docx ingestion, significant portions of the knowledge base are inaccessible.</div>
389
+ </div>
390
+
391
+ <div class="roadmap-item v10">
392
+ <div class="ri-version">v1.0 Β· Priority 7</div>
393
+ <div class="ri-title">Text-to-speech response readback</div>
394
+ <p class="ri-body">Web Speech Synthesis API reads the response aloud after delivery. The technician holds their phone near their ear, speaks the query, and hears the procedure read step by step β€” fully hands-free. A single JavaScript call on top of the existing response flow.</p>
395
+ <div class="ri-why">Why now: The floor use case demands hands-free operation. Reading a response off a screen while one hand is on equipment is impractical. TTS completes the voice-first loop. It is deliberately not in v0.1 to keep the UI surface minimal and testable.</div>
396
+ </div>
397
+
398
+ <div class="roadmap-item v10">
399
+ <div class="ri-version">v1.0 Β· Priority 8</div>
400
+ <div class="ri-title">Document version management and re-indexing triggers</div>
401
+ <p class="ri-body">When a document is updated (new SOP revision, revised manual), the system detects the version change, re-indexes the affected chunks, and invalidates any cached responses referencing the old version. A document management webhook or scheduled check triggers re-ingestion automatically.</p>
402
+ <div class="ri-why">Why now: An ISO-controlled SOP that changes must be reflected immediately in the knowledge base. A system that answers from a superseded procedure is potentially more dangerous than no system at all. Version management is a production safety requirement.</div>
403
+ </div>
404
+
405
+ </div>
406
+ </section>
407
+
408
+ <!-- ══ 04 PRODUCTION PATH DIAGRAM ══ -->
409
+ <section>
410
+ <div class="section-label">04 β€” Production Architecture</div>
411
+ <h2 class="section-title">How v0.1 <em>becomes v1.0.</em></h2>
412
+ <p class="section-intro">The v0.1 architecture is designed so that every v1.0 addition slots into the existing structure without requiring a rebuild. The core pipeline β€” voice β†’ guardrails β†’ retrieval β†’ generation β†’ citation β€” does not change. Each v1.0 component wraps or extends an existing layer.</p>
413
+
414
+ <div class="diagram-wrap scroll-reveal">
415
+ <div class="diagram-label">v0.1 β†’ v1.0 upgrade path Β· additive, not replacement</div>
416
+ <svg viewBox="0 0 960 400" xmlns="http://www.w3.org/2000/svg" font-family="'JetBrains Mono',monospace" width="100%" style="position:relative;z-index:1;">
417
+ <defs>
418
+ <marker id="arr-p" markerWidth="7" markerHeight="7" refX="5" refY="3" orient="auto"><path d="M0,0 L0,6 L7,3 z" fill="#f59e0b" opacity="0.8"/></marker>
419
+ <marker id="arr-g" markerWidth="7" markerHeight="7" refX="5" refY="3" orient="auto"><path d="M0,0 L0,6 L7,3 z" fill="#10b981" opacity="0.7"/></marker>
420
+ </defs>
421
+
422
+ <!-- v0.1 column -->
423
+ <text x="220" y="24" text-anchor="middle" font-size="7.5" fill="#f59e0b" letter-spacing="2">V0.1 Β· MVP</text>
424
+ <rect x="120" y="32" width="200" height="350" rx="4" fill="#161c27" stroke="#344057"/>
425
+ <rect x="120" y="32" width="200" height="3" fill="#f59e0b" rx="2"/>
426
+
427
+ <rect x="136" y="52" width="168" height="36" rx="3" fill="#1e2535" stroke="#344057"/>
428
+ <text x="220" y="67" text-anchor="middle" font-size="7.5" fill="#a0aec0">Web Speech API</text>
429
+ <text x="220" y="79" text-anchor="middle" font-size="6.5" fill="#4a5568">Voice β†’ Text (browser)</text>
430
+
431
+ <rect x="136" y="98" width="168" height="52" rx="3" fill="#1e2535" stroke="#d97706"/>
432
+ <text x="220" y="116" text-anchor="middle" font-size="7.5" fill="#f59e0b">G1–G5 Guardrails</text>
433
+ <text x="220" y="129" text-anchor="middle" font-size="6.5" fill="#718096">Custom prompt-based</text>
434
+ <text x="220" y="141" text-anchor="middle" font-size="6.5" fill="#4a5568">No extra model</text>
435
+
436
+ <rect x="136" y="160" width="168" height="36" rx="3" fill="#1e2535" stroke="#344057"/>
437
+ <text x="220" y="175" text-anchor="middle" font-size="7.5" fill="#a0aec0">ChromaDB Β· Single corpus</text>
438
+ <text x="220" y="187" text-anchor="middle" font-size="6.5" fill="#4a5568">Flat namespace</text>
439
+
440
+ <rect x="136" y="206" width="168" height="36" rx="3" fill="#1e2535" stroke="#344057"/>
441
+ <text x="220" y="221" text-anchor="middle" font-size="7.5" fill="#a0aec0">Llama 3.2 3B Β· Ollama</text>
442
+ <text x="220" y="233" text-anchor="middle" font-size="6.5" fill="#4a5568">Local inference</text>
443
+
444
+ <rect x="136" y="252" width="168" height="36" rx="3" fill="#1e2535" stroke="#344057"/>
445
+ <text x="220" y="267" text-anchor="middle" font-size="7.5" fill="#a0aec0">FastAPI + HTML UI</text>
446
+ <text x="220" y="279" text-anchor="middle" font-size="6.5" fill="#4a5568">Mobile-responsive Β· No auth</text>
447
+
448
+ <rect x="136" y="298" width="168" height="36" rx="3" fill="#1e2535" stroke="#344057"/>
449
+ <text x="220" y="313" text-anchor="middle" font-size="7.5" fill="#a0aec0">PDF / TXT ingestion</text>
450
+ <text x="220" y="325" text-anchor="middle" font-size="6.5" fill="#4a5568">PyMuPDF Β· 2 formats</text>
451
+
452
+ <!-- Arrow -->
453
+ <line x1="340" y1="200" x2="420" y2="200" stroke="#f59e0b" stroke-width="2" marker-end="url(#arr-p)"/>
454
+ <text x="380" y="192" text-anchor="middle" font-size="7" fill="#d97706">additive</text>
455
+ <text x="380" y="204" text-anchor="middle" font-size="7" fill="#d97706">upgrades</text>
456
+
457
+ <!-- v1.0 column -->
458
+ <text x="640" y="24" text-anchor="middle" font-size="7.5" fill="#10b981" letter-spacing="2">V1.0 Β· PRODUCTION</text>
459
+ <rect x="420" y="32" width="520" height="350" rx="4" fill="#161c27" stroke="#2d6a4f"/>
460
+ <rect x="420" y="32" width="520" height="3" fill="#10b981" rx="2"/>
461
+
462
+ <!-- Adds: Whisper -->
463
+ <rect x="436" y="52" width="226" height="36" rx="3" fill="#1e2535" stroke="#2d6a4f"/>
464
+ <text x="549" y="67" text-anchor="middle" font-size="7.5" fill="#34d399">Whisper Local STT</text>
465
+ <text x="549" y="79" text-anchor="middle" font-size="6.5" fill="#4a5568">Replaces Web Speech Β· Air-gapped</text>
466
+ <rect x="674" y="52" width="250" height="36" rx="3" fill="#1e2535" stroke="#344057"/>
467
+ <text x="799" y="67" text-anchor="middle" font-size="7.5" fill="#a0aec0">TTS Readback</text>
468
+ <text x="799" y="79" text-anchor="middle" font-size="6.5" fill="#4a5568">Web Speech Synthesis Β· Hands-free</text>
469
+
470
+ <!-- Adds: Guardrail upgrade -->
471
+ <rect x="436" y="98" width="488" height="52" rx="3" fill="#1e2535" stroke="#d97706"/>
472
+ <text x="680" y="116" text-anchor="middle" font-size="7.5" fill="#f59e0b">G1–G5 + LlamaGuard on G4 trigger</text>
473
+ <text x="680" y="129" text-anchor="middle" font-size="6.5" fill="#718096">LlamaGuard activates conditionally Β· G4 triage gate</text>
474
+ <text x="680" y="141" text-anchor="middle" font-size="6.5" fill="#4a5568">Adversarial robustness on safety-critical queries only</text>
475
+
476
+ <!-- Adds: Namespaced chromadb -->
477
+ <rect x="436" y="160" width="226" height="36" rx="3" fill="#1e2535" stroke="#2d6a4f"/>
478
+ <text x="549" y="175" text-anchor="middle" font-size="7.5" fill="#34d399">ChromaDB Β· Namespaced</text>
479
+ <text x="549" y="187" text-anchor="middle" font-size="6.5" fill="#4a5568">Dept-level isolation</text>
480
+ <rect x="674" y="160" width="250" height="36" rx="3" fill="#1e2535" stroke="#2d6a4f"/>
481
+ <text x="799" y="175" text-anchor="middle" font-size="7.5" fill="#34d399">Audit Log</text>
482
+ <text x="799" y="187" text-anchor="middle" font-size="6.5" fill="#4a5568">Append-only Β· ISO 9001</text>
483
+
484
+ <!-- LLM upgrade -->
485
+ <rect x="436" y="206" width="226" height="36" rx="3" fill="#1e2535" stroke="#344057"/>
486
+ <text x="549" y="221" text-anchor="middle" font-size="7.5" fill="#a0aec0">Llama 3.1 8B Β· Ollama</text>
487
+ <text x="549" y="233" text-anchor="middle" font-size="6.5" fill="#4a5568">Upgrade model string only</text>
488
+ <rect x="674" y="206" width="250" height="36" rx="3" fill="#1e2535" stroke="#344057"/>
489
+ <text x="799" y="221" text-anchor="middle" font-size="7.5" fill="#a0aec0">GPU-accelerated server</text>
490
+ <text x="799" y="233" text-anchor="middle" font-size="6.5" fill="#4a5568">32GB RAM Β· RTX 3080+</text>
491
+
492
+ <!-- Adds: Auth -->
493
+ <rect x="436" y="252" width="488" height="36" rx="3" fill="#1e2535" stroke="#2d6a4f"/>
494
+ <text x="680" y="267" text-anchor="middle" font-size="7.5" fill="#34d399">JWT Auth + Role-Based Access + Session Management</text>
495
+ <text x="680" y="279" text-anchor="middle" font-size="6.5" fill="#4a5568">User identity β†’ dept namespace scoping β†’ audit trail attribution</text>
496
+
497
+ <!-- Adds: Ingestion -->
498
+ <rect x="436" y="298" width="488" height="36" rx="3" fill="#1e2535" stroke="#2d6a4f"/>
499
+ <text x="680" y="313" text-anchor="middle" font-size="7.5" fill="#34d399">PDF Β· TXT Β· DOCX Β· PPTX Β· Version Management</text>
500
+ <text x="680" y="325" text-anchor="middle" font-size="6.5" fill="#4a5568">python-docx + python-pptx + version change detection + auto re-index trigger</text>
501
+
502
+ <!-- NEW badges -->
503
+ <rect x="658" y="55" width="28" height="12" rx="2" fill="rgba(16,185,129,0.2)" stroke="rgba(16,185,129,0.4)"/>
504
+ <text x="672" y="64" text-anchor="middle" font-size="6" fill="#10b981">NEW</text>
505
+ <rect x="892" y="55" width="28" height="12" rx="2" fill="rgba(16,185,129,0.2)" stroke="rgba(16,185,129,0.4)"/>
506
+ <text x="906" y="64" text-anchor="middle" font-size="6" fill="#10b981">NEW</text>
507
+ <rect x="658" y="163" width="28" height="12" rx="2" fill="rgba(16,185,129,0.2)" stroke="rgba(16,185,129,0.4)"/>
508
+ <text x="672" y="172" text-anchor="middle" font-size="6" fill="#10b981">NEW</text>
509
+ <rect x="892" y="163" width="28" height="12" rx="2" fill="rgba(16,185,129,0.2)" stroke="rgba(16,185,129,0.4)"/>
510
+ <text x="906" y="172" text-anchor="middle" font-size="6" fill="#10b981">NEW</text>
511
+ </svg>
512
+ </div>
513
+ </section>
514
+
515
+ <!-- ══ 05 DEFERRED DECISIONS ══ -->
516
+ <section>
517
+ <div class="section-label">05 β€” Deferred Architectural Decisions</div>
518
+ <h2 class="section-title">Not forgotten. <em>Deliberately postponed.</em></h2>
519
+ <p class="section-intro">These are architectural questions that were considered for v0.1 and explicitly deferred β€” not because they are unimportant, but because resolving them prematurely would have introduced complexity that obscures the core architecture signal.</p>
520
+
521
+ <div class="deferred-stack scroll-reveal">
522
+
523
+ <div class="deferred-item">
524
+ <div>
525
+ <div class="di-title">Hybrid retrieval: dense + sparse (BM25)</div>
526
+ <p class="di-body">Pure semantic search (dense retrieval) can miss exact keyword matches for specific part numbers, error codes, and model identifiers β€” exactly the kind of query a maintenance technician makes. Hybrid retrieval combining ChromaDB cosine similarity with a BM25 sparse index would improve precision on these high-specificity queries.</p>
527
+ <div class="di-reason">Deferred because: Pure semantic retrieval is sufficient to validate the pipeline architecture. Hybrid retrieval is an optimisation β€” valuable, but it does not change the guardrail design, the deployment model, or the sovereignty story. Added complexity without added architectural signal at MVP stage.</div>
528
+ </div>
529
+ <span class="di-version status-pill pill-out">v1.0 candidate</span>
530
+ </div>
531
+
532
+ <div class="deferred-item">
533
+ <div>
534
+ <div class="di-title">Query rewriting / HyDE (Hypothetical Document Embeddings)</div>
535
+ <p class="di-body">HyDE generates a hypothetical answer to the query before retrieval and uses that hypothetical answer's embedding to search the corpus β€” improving retrieval quality for queries that are phrased very differently from the document vocabulary. Relevant for voice queries where the transcription may not match the terminology in the manual.</p>
536
+ <div class="di-reason">Deferred because: Adds an extra LLM call per query (generation before retrieval), increasing latency and complexity. G1 Query Normaliser addresses the vocabulary gap for v0.1. HyDE is the next step if retrieval quality proves insufficient at production scale.</div>
537
+ </div>
538
+ <span class="di-version status-pill pill-out">v1.0 candidate</span>
539
+ </div>
540
+
541
+ <div class="deferred-item">
542
+ <div>
543
+ <div class="di-title">Re-ranking with a cross-encoder model</div>
544
+ <p class="di-body">After top-k retrieval, a cross-encoder re-ranker evaluates each retrieved chunk in the context of the specific query and re-orders them by relevance β€” typically improving precision at rank 1, which is the chunk most likely to ground the response. ColBERT or a lightweight cross-encoder would be candidates.</p>
545
+ <div class="di-reason">Deferred because: Adds another model to the inference stack (additional RAM, additional latency). The procedural chunking strategy already improves retrieval precision by keeping complete procedures intact. Re-ranking is an optimisation for larger corpora where multiple procedures may appear relevant.</div>
546
+ </div>
547
+ <span class="di-version status-pill pill-future">v2+ candidate</span>
548
+ </div>
549
+
550
+ <div class="deferred-item">
551
+ <div>
552
+ <div class="di-title">Multi-modal ingestion (diagrams, schematics, images)</div>
553
+ <p class="di-body">Manufacturing manuals contain critical information in diagrams, wiring schematics, and exploded-view drawings. A purely text-based RAG system cannot index this content. A multi-modal pipeline using a vision model (LLaVA, Phi-3 Vision) to generate textual descriptions of figures before indexing would capture this signal.</p>
554
+ <div class="di-reason">Deferred because: Requires a vision model alongside the text LLM β€” significant RAM increase. Figure description quality with local models is variable. The architecture is designed to accommodate this: the ingestion pipeline is modular, and a vision pre-processing step can be inserted before ChromaDB indexing without changing the retrieval or generation layers.</div>
555
+ </div>
556
+ <span class="di-version status-pill pill-future">v2+ candidate</span>
557
+ </div>
558
+
559
+ <div class="deferred-item">
560
+ <div>
561
+ <div class="di-title">Giskard automated vulnerability scanning</div>
562
+ <p class="di-body">Giskard is a testing framework for LLM applications β€” it automatically generates adversarial test cases (prompt injections, hallucination probes, bias tests) and evaluates the pipeline against them. Valuable for production QA but not a runtime guardrail.</p>
563
+ <div class="di-reason">Deferred because: Giskard belongs in the CI/CD pipeline, not in the inference path. It is a pre-deployment testing tool. Integrating it as a runtime component (as the original VaultRAG notes implied) was a category error corrected in ADR-003. It will be added to the GitHub Actions workflow before v1.0 release.</div>
564
+ </div>
565
+ <span class="di-version status-pill pill-out">v1.0 CI/CD</span>
566
+ </div>
567
+
568
+ </div>
569
+ </section>
570
+
571
+ <!-- ══ 06 PORTFOLIO SIGNAL ══ -->
572
+ <section>
573
+ <div class="section-label">06 β€” Portfolio Signal</div>
574
+ <h2 class="section-title">What this demonstrates. <em>By discipline.</em></h2>
575
+ <p class="section-intro">VaultRAG is a portfolio artifact. Every decision was made with a reviewer in mind β€” not as a shortcut, but as a discipline. An architecture that cannot be explained is not architecture. This section states what each discipline can read from the work.</p>
576
+
577
+ <div class="signal-grid scroll-reveal">
578
+ <div class="signal-card">
579
+ <div class="signal-role">Enterprise Architect</div>
580
+ <div class="signal-title">Coherent design from problem to infrastructure</div>
581
+ <div class="signal-items">
582
+ <div class="signal-item">A real anchor client (FlexForm) with documented pain points that drive every design decision</div>
583
+ <div class="signal-item">Three non-negotiable design principles stated before any component was selected</div>
584
+ <div class="signal-item">Eight ADRs documenting every stack decision, alternative considered, and trade-off accepted</div>
585
+ <div class="signal-item">Deployment model that traces from laptop to demo to production without changing application code</div>
586
+ <div class="signal-item">Roadmap that shows a coherent progression, not a features wishlist</div>
587
+ </div>
588
+ </div>
589
+ <div class="signal-card">
590
+ <div class="signal-role">ML Engineer</div>
591
+ <div class="signal-title">Production-grade RAG pipeline with genuine guardrails</div>
592
+ <div class="signal-items">
593
+ <div class="signal-item">5-layer guardrail architecture with discrete mechanisms β€” not a single catch-all prompt</div>
594
+ <div class="signal-item">Chunking strategy designed for the document type, not the default token window</div>
595
+ <div class="signal-item">Confidence threshold as a first-class pipeline component, not an afterthought</div>
596
+ <div class="signal-item">Deliberate choice to refuse rather than hallucinate β€” designed as a safety property</div>
597
+ <div class="signal-item">Clear upgrade path from custom guardrails to LlamaGuard with documented activation strategy</div>
598
+ </div>
599
+ </div>
600
+ <div class="signal-card">
601
+ <div class="signal-role">Cloud Architect</div>
602
+ <div class="signal-title">Infrastructure decisions that reflect real constraints</div>
603
+ <div class="signal-items">
604
+ <div class="signal-item">Data sovereignty enforced architecturally β€” not by configuration, by the absence of egress paths</div>
605
+ <div class="signal-item">Demo environment chosen for warmth, not convenience β€” Render cold-start failure documented and avoided</div>
606
+ <div class="signal-item">Dockerised deployment with a single compose file β€” environment parity from dev to production</div>
607
+ <div class="signal-item">Cost model that distinguishes between demo constraints and production reality</div>
608
+ <div class="signal-item">Hardware spec for production written to real facility infrastructure, not cloud-default assumptions</div>
609
+ </div>
610
+ </div>
611
+ </div>
612
+ </section>
613
+
614
+ <!-- ══ CLOSING ══ -->
615
+ <section>
616
+ <div class="closing scroll-reveal">
617
+ <div class="closing-text">
618
+ Six pages. Every decision <em>justified.</em><br>
619
+ Every trade-off documented.<br>
620
+ The floor can ask its question now.
621
+ </div>
622
+ <p class="closing-sub">VaultRAG demonstrates that local-first, voice-first, guardrail-governed RAG is architecturally viable β€” on free infrastructure, with open-source components, in environments where cloud tools are contractually excluded. The architecture scales from a demo on HuggingFace Spaces to a production deployment on a plant server without changing a line of application code.</p>
623
+ <div class="closing-links">
624
+ <a href="page-04.html" class="btn btn-primary">β–Ά Run the simulator</a>
625
+ <a href="index.html" class="btn btn-ghost">← Back to overview</a>
626
+ <a href="https://github.com/raosiddharthp/VaultRAG" class="btn btn-ghost">GitHub β†’</a>
627
+ </div>
628
+ </div>
629
+ </section>
630
+
631
+ <div class="page-nav">
632
+ <a class="page-nav-link" href="page-05.html"><span class="page-nav-label">← Previous</span><span>Cost Model</span></a>
633
+ <a class="page-nav-link next" href="index.html"><span class="page-nav-label">Back to start</span><span>Overview β†’</span></a>
634
+ </div>
635
+
636
+ <footer>
637
+ <p>VaultRAG Β· Architecture Portfolio Β· 2026 Β· <a href="https://github.com/raosiddharthp/VaultRAG">GitHub</a></p>
638
+ <p>Page 06 Β· Roadmap Β· Β© 2026 Siddharth Rao</p>
639
+ </footer>
640
+
641
+ <script>
642
+ const reveals = document.querySelectorAll('.scroll-reveal');
643
+ const obs = new IntersectionObserver(entries => {
644
+ entries.forEach(e => { if(e.isIntersecting){e.target.classList.add('visible');obs.unobserve(e.target);}});
645
+ },{threshold:0.07});
646
+ reveals.forEach(el => obs.observe(el));
647
+ </script>
648
+ </body>
649
+ </html>
style.css ADDED
@@ -0,0 +1,627 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ============================================================
2
+ VaultRAG β€” Global Stylesheet
3
+ Shared variables, reset, typography, nav, footer, utilities
4
+ Each page also contains its own scoped <style> block for
5
+ page-specific components.
6
+ ============================================================ */
7
+
8
+ /* ── GOOGLE FONTS ── */
9
+ @import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap');
10
+
11
+ /* ── DESIGN TOKENS ── */
12
+ :root {
13
+ /* Steel palette β€” primary background family */
14
+ --steel-900: #0e1117;
15
+ --steel-800: #161c27;
16
+ --steel-700: #1e2535;
17
+ --steel-600: #262f42;
18
+ --steel-500: #344057;
19
+ --steel-400: #4a5568;
20
+ --steel-300: #718096;
21
+ --steel-200: #a0aec0;
22
+ --steel-100: #cbd5e0;
23
+ --steel-50: #e8edf5;
24
+
25
+ /* Amber β€” primary accent (industrial heat) */
26
+ --amber-600: #d97706;
27
+ --amber-500: #f59e0b;
28
+ --amber-400: #fbbf24;
29
+ --amber-300: #fcd34d;
30
+ --amber-glow: rgba(245, 158, 11, 0.15);
31
+
32
+ /* Semantic colours */
33
+ --danger: #ef4444;
34
+ --success: #10b981;
35
+ --info: #3b82f6;
36
+ --purple: #8b5cf6;
37
+
38
+ /* Typography */
39
+ --font-display: 'Barlow Condensed', sans-serif;
40
+ --font-body: 'Barlow', sans-serif;
41
+ --font-mono: 'JetBrains Mono', monospace;
42
+
43
+ /* Spacing scale */
44
+ --space-xs: 4px;
45
+ --space-sm: 8px;
46
+ --space-md: 16px;
47
+ --space-lg: 24px;
48
+ --space-xl: 40px;
49
+ --space-2xl: 64px;
50
+ --space-3xl: 96px;
51
+
52
+ /* Border radius */
53
+ --radius-sm: 2px;
54
+ --radius-md: 4px;
55
+ --radius-lg: 6px;
56
+
57
+ /* Transitions */
58
+ --transition-fast: 0.15s ease;
59
+ --transition-base: 0.25s ease;
60
+ --transition-slow: 0.4s ease;
61
+ }
62
+
63
+ /* ── RESET ── */
64
+ *,
65
+ *::before,
66
+ *::after {
67
+ box-sizing: border-box;
68
+ margin: 0;
69
+ padding: 0;
70
+ }
71
+
72
+ html {
73
+ scroll-behavior: smooth;
74
+ -webkit-text-size-adjust: 100%;
75
+ }
76
+
77
+ body {
78
+ background: var(--steel-900);
79
+ color: var(--steel-100);
80
+ font-family: var(--font-body);
81
+ font-size: 16px;
82
+ line-height: 1.7;
83
+ overflow-x: hidden;
84
+ -webkit-font-smoothing: antialiased;
85
+ -moz-osx-font-smoothing: grayscale;
86
+ }
87
+
88
+ img, svg {
89
+ display: block;
90
+ max-width: 100%;
91
+ }
92
+
93
+ a {
94
+ color: inherit;
95
+ text-decoration: none;
96
+ }
97
+
98
+ button {
99
+ cursor: pointer;
100
+ font-family: inherit;
101
+ }
102
+
103
+ /* ── NOISE TEXTURE OVERLAY ── */
104
+ body::before {
105
+ content: '';
106
+ position: fixed;
107
+ inset: 0;
108
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
109
+ pointer-events: none;
110
+ z-index: 0;
111
+ opacity: 0.4;
112
+ }
113
+
114
+ /* ── NAVIGATION ── */
115
+ nav {
116
+ position: fixed;
117
+ top: 0;
118
+ left: 0;
119
+ right: 0;
120
+ z-index: 100;
121
+ display: flex;
122
+ align-items: center;
123
+ justify-content: space-between;
124
+ padding: 0 48px;
125
+ height: 64px;
126
+ background: rgba(14, 17, 23, 0.94);
127
+ backdrop-filter: blur(12px);
128
+ -webkit-backdrop-filter: blur(12px);
129
+ border-bottom: 1px solid rgba(245, 158, 11, 0.15);
130
+ }
131
+
132
+ .nav-brand {
133
+ font-family: var(--font-display);
134
+ font-weight: 700;
135
+ font-size: 1.2rem;
136
+ letter-spacing: 0.08em;
137
+ color: var(--amber-400);
138
+ text-decoration: none;
139
+ flex-shrink: 0;
140
+ }
141
+
142
+ .nav-brand span {
143
+ color: var(--steel-300);
144
+ font-weight: 300;
145
+ }
146
+
147
+ nav ul {
148
+ display: flex;
149
+ align-items: center;
150
+ gap: 28px;
151
+ list-style: none;
152
+ }
153
+
154
+ nav ul a {
155
+ font-family: var(--font-mono);
156
+ font-size: 0.68rem;
157
+ letter-spacing: 0.12em;
158
+ text-transform: uppercase;
159
+ color: var(--steel-300);
160
+ text-decoration: none;
161
+ transition: color var(--transition-base);
162
+ }
163
+
164
+ nav ul a:hover {
165
+ color: var(--amber-400);
166
+ }
167
+
168
+ nav ul a.active {
169
+ color: var(--amber-400);
170
+ }
171
+
172
+ .nav-github {
173
+ color: var(--amber-400) !important;
174
+ border: 1px solid var(--amber-500);
175
+ padding: 6px 14px;
176
+ border-radius: var(--radius-sm);
177
+ transition: background var(--transition-base), color var(--transition-base) !important;
178
+ }
179
+
180
+ .nav-github:hover {
181
+ background: var(--amber-500) !important;
182
+ color: var(--steel-900) !important;
183
+ }
184
+
185
+ /* ── FOOTER ── */
186
+ footer {
187
+ position: relative;
188
+ z-index: 1;
189
+ padding: 40px 48px;
190
+ display: flex;
191
+ align-items: center;
192
+ justify-content: space-between;
193
+ border-top: 1px solid var(--steel-800);
194
+ flex-wrap: wrap;
195
+ gap: 12px;
196
+ }
197
+
198
+ footer p {
199
+ font-family: var(--font-mono);
200
+ font-size: 0.62rem;
201
+ letter-spacing: 0.1em;
202
+ text-transform: uppercase;
203
+ color: var(--steel-500);
204
+ }
205
+
206
+ footer a {
207
+ color: var(--steel-400);
208
+ text-decoration: none;
209
+ transition: color var(--transition-base);
210
+ }
211
+
212
+ footer a:hover {
213
+ color: var(--amber-400);
214
+ }
215
+
216
+ /* ── PAGE NAV ── */
217
+ .page-nav {
218
+ position: relative;
219
+ z-index: 1;
220
+ display: flex;
221
+ justify-content: space-between;
222
+ align-items: center;
223
+ padding: 40px 48px;
224
+ border-top: 1px solid var(--steel-700);
225
+ flex-wrap: wrap;
226
+ gap: 16px;
227
+ }
228
+
229
+ .page-nav-link {
230
+ font-family: var(--font-mono);
231
+ font-size: 0.7rem;
232
+ letter-spacing: 0.1em;
233
+ text-transform: uppercase;
234
+ text-decoration: none;
235
+ color: var(--steel-300);
236
+ display: flex;
237
+ flex-direction: column;
238
+ gap: 5px;
239
+ transition: color var(--transition-base);
240
+ }
241
+
242
+ .page-nav-link:hover {
243
+ color: var(--amber-400);
244
+ }
245
+
246
+ .page-nav-link.next {
247
+ text-align: right;
248
+ }
249
+
250
+ .page-nav-label {
251
+ font-size: 0.6rem;
252
+ color: var(--steel-500);
253
+ }
254
+
255
+ /* ── SECTION DIVIDER ── */
256
+ .section-divider {
257
+ height: 1px;
258
+ background: linear-gradient(90deg, transparent, var(--steel-600), transparent);
259
+ margin: 0 48px;
260
+ position: relative;
261
+ z-index: 1;
262
+ }
263
+
264
+ /* ── SHARED SECTION COMPONENTS ── */
265
+ .section-label {
266
+ font-family: var(--font-mono);
267
+ font-size: 0.65rem;
268
+ letter-spacing: 0.2em;
269
+ text-transform: uppercase;
270
+ color: var(--amber-500);
271
+ margin-bottom: 14px;
272
+ display: flex;
273
+ align-items: center;
274
+ gap: 12px;
275
+ }
276
+
277
+ .section-label::after {
278
+ content: '';
279
+ flex: 1;
280
+ max-width: 50px;
281
+ height: 1px;
282
+ background: var(--amber-600);
283
+ }
284
+
285
+ /* ── BUTTONS ── */
286
+ .btn {
287
+ font-family: var(--font-mono);
288
+ font-size: 0.7rem;
289
+ letter-spacing: 0.12em;
290
+ text-transform: uppercase;
291
+ text-decoration: none;
292
+ padding: 12px 24px;
293
+ border-radius: var(--radius-sm);
294
+ border: none;
295
+ transition: all var(--transition-base);
296
+ display: inline-flex;
297
+ align-items: center;
298
+ gap: 8px;
299
+ cursor: pointer;
300
+ white-space: nowrap;
301
+ }
302
+
303
+ .btn-primary {
304
+ background: var(--amber-500);
305
+ color: var(--steel-900);
306
+ font-weight: 700;
307
+ }
308
+
309
+ .btn-primary:hover {
310
+ background: var(--amber-400);
311
+ }
312
+
313
+ .btn-ghost {
314
+ background: transparent;
315
+ border: 1px solid var(--steel-500);
316
+ color: var(--steel-200);
317
+ }
318
+
319
+ .btn-ghost:hover {
320
+ border-color: var(--amber-500);
321
+ color: var(--amber-400);
322
+ }
323
+
324
+ .btn-danger {
325
+ background: var(--danger);
326
+ color: #fff;
327
+ font-weight: 700;
328
+ }
329
+
330
+ .btn-danger:hover {
331
+ background: #dc2626;
332
+ }
333
+
334
+ /* ── TAGS / PILLS ── */
335
+ .tag {
336
+ font-family: var(--font-mono);
337
+ font-size: 0.65rem;
338
+ letter-spacing: 0.1em;
339
+ text-transform: uppercase;
340
+ padding: 5px 12px;
341
+ border-radius: var(--radius-sm);
342
+ border: 1px solid var(--steel-600);
343
+ color: var(--steel-300);
344
+ background: rgba(38, 47, 66, 0.6);
345
+ display: inline-block;
346
+ }
347
+
348
+ .tag-amber {
349
+ border-color: rgba(245, 158, 11, 0.4);
350
+ color: var(--amber-400);
351
+ background: rgba(245, 158, 11, 0.06);
352
+ }
353
+
354
+ .tag-success {
355
+ border-color: rgba(16, 185, 129, 0.35);
356
+ color: var(--success);
357
+ background: rgba(16, 185, 129, 0.07);
358
+ }
359
+
360
+ .tag-danger {
361
+ border-color: rgba(239, 68, 68, 0.35);
362
+ color: var(--danger);
363
+ background: rgba(239, 68, 68, 0.07);
364
+ }
365
+
366
+ .tag-info {
367
+ border-color: rgba(59, 130, 246, 0.35);
368
+ color: var(--info);
369
+ background: rgba(59, 130, 246, 0.07);
370
+ }
371
+
372
+ /* ── STATUS PILLS ── */
373
+ .status-pill {
374
+ font-family: var(--font-mono);
375
+ font-size: 0.58rem;
376
+ letter-spacing: 0.1em;
377
+ text-transform: uppercase;
378
+ padding: 3px 8px;
379
+ border-radius: var(--radius-sm);
380
+ white-space: nowrap;
381
+ display: inline-block;
382
+ }
383
+
384
+ .pill-in {
385
+ background: rgba(245, 158, 11, 0.12);
386
+ color: var(--amber-400);
387
+ border: 1px solid rgba(245, 158, 11, 0.25);
388
+ }
389
+
390
+ .pill-out {
391
+ background: rgba(239, 68, 68, 0.1);
392
+ color: var(--danger);
393
+ border: 1px solid rgba(239, 68, 68, 0.2);
394
+ }
395
+
396
+ .pill-future {
397
+ background: rgba(139, 92, 246, 0.1);
398
+ color: var(--purple);
399
+ border: 1px solid rgba(139, 92, 246, 0.2);
400
+ }
401
+
402
+ .pill-prod {
403
+ background: rgba(16, 185, 129, 0.1);
404
+ color: var(--success);
405
+ border: 1px solid rgba(16, 185, 129, 0.2);
406
+ }
407
+
408
+ /* ── SCROLL REVEAL ── */
409
+ .scroll-reveal {
410
+ opacity: 0;
411
+ transform: translateY(28px);
412
+ transition: opacity 0.7s ease, transform 0.7s ease;
413
+ }
414
+
415
+ .scroll-reveal.visible {
416
+ opacity: 1;
417
+ transform: translateY(0);
418
+ }
419
+
420
+ /* ── SHARED TABLE STYLES ── */
421
+ table {
422
+ width: 100%;
423
+ border-collapse: collapse;
424
+ }
425
+
426
+ th {
427
+ background: var(--steel-700);
428
+ padding: 12px 20px;
429
+ text-align: left;
430
+ font-family: var(--font-mono);
431
+ font-size: 0.62rem;
432
+ letter-spacing: 0.12em;
433
+ text-transform: uppercase;
434
+ color: var(--steel-300);
435
+ border-bottom: 1px solid var(--steel-600);
436
+ }
437
+
438
+ td {
439
+ padding: 13px 20px;
440
+ border-bottom: 1px solid rgba(38, 47, 66, 0.7);
441
+ font-size: 0.88rem;
442
+ color: var(--steel-200);
443
+ vertical-align: top;
444
+ line-height: 1.55;
445
+ }
446
+
447
+ tr:last-child td {
448
+ border-bottom: none;
449
+ }
450
+
451
+ tr:hover td {
452
+ background: rgba(38, 47, 66, 0.3);
453
+ }
454
+
455
+ /* ── DIAGRAM WRAPPER ── */
456
+ .diagram-wrap {
457
+ background: var(--steel-800);
458
+ border: 1px solid var(--steel-600);
459
+ border-radius: var(--radius-lg);
460
+ padding: 40px;
461
+ margin-bottom: 48px;
462
+ overflow: hidden;
463
+ position: relative;
464
+ }
465
+
466
+ .diagram-wrap::before {
467
+ content: '';
468
+ position: absolute;
469
+ inset: 0;
470
+ background-image:
471
+ linear-gradient(rgba(245, 158, 11, 0.025) 1px, transparent 1px),
472
+ linear-gradient(90deg, rgba(245, 158, 11, 0.025) 1px, transparent 1px);
473
+ background-size: 40px 40px;
474
+ pointer-events: none;
475
+ }
476
+
477
+ .diagram-label {
478
+ font-family: var(--font-mono);
479
+ font-size: 0.65rem;
480
+ letter-spacing: 0.18em;
481
+ text-transform: uppercase;
482
+ color: var(--steel-300);
483
+ margin-bottom: 28px;
484
+ display: flex;
485
+ align-items: center;
486
+ gap: 10px;
487
+ position: relative;
488
+ z-index: 1;
489
+ }
490
+
491
+ .diagram-label.amber::before {
492
+ content: '';
493
+ width: 8px;
494
+ height: 8px;
495
+ border-radius: 50%;
496
+ flex-shrink: 0;
497
+ background: var(--amber-500);
498
+ box-shadow: 0 0 8px var(--amber-500);
499
+ }
500
+
501
+ .diagram-label.blue::before {
502
+ content: '';
503
+ width: 8px;
504
+ height: 8px;
505
+ border-radius: 50%;
506
+ flex-shrink: 0;
507
+ background: var(--info);
508
+ box-shadow: 0 0 8px var(--info);
509
+ }
510
+
511
+ .diagram-label.green::before {
512
+ content: '';
513
+ width: 8px;
514
+ height: 8px;
515
+ border-radius: 50%;
516
+ flex-shrink: 0;
517
+ background: var(--success);
518
+ box-shadow: 0 0 8px var(--success);
519
+ }
520
+
521
+ .diagram-label.red::before {
522
+ content: '';
523
+ width: 8px;
524
+ height: 8px;
525
+ border-radius: 50%;
526
+ flex-shrink: 0;
527
+ background: var(--danger);
528
+ box-shadow: 0 0 8px var(--danger);
529
+ }
530
+
531
+ /* ── BREADCRUMB ── */
532
+ .breadcrumb {
533
+ font-family: var(--font-mono);
534
+ font-size: 0.65rem;
535
+ letter-spacing: 0.15em;
536
+ text-transform: uppercase;
537
+ color: var(--steel-400);
538
+ margin-bottom: 16px;
539
+ display: flex;
540
+ align-items: center;
541
+ gap: 8px;
542
+ flex-wrap: wrap;
543
+ }
544
+
545
+ .breadcrumb a {
546
+ color: var(--steel-400);
547
+ text-decoration: none;
548
+ transition: color var(--transition-base);
549
+ }
550
+
551
+ .breadcrumb a:hover {
552
+ color: var(--amber-400);
553
+ }
554
+
555
+ .breadcrumb span {
556
+ color: var(--steel-600);
557
+ }
558
+
559
+ /* ── ANIMATIONS ── */
560
+ @keyframes fadeUp {
561
+ from { opacity: 0; transform: translateY(24px); }
562
+ to { opacity: 1; transform: translateY(0); }
563
+ }
564
+
565
+ @keyframes pulse-amber {
566
+ 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
567
+ 50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
568
+ }
569
+
570
+ @keyframes pulse-dot {
571
+ 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
572
+ 50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); }
573
+ }
574
+
575
+ @keyframes spin {
576
+ to { transform: rotate(360deg); }
577
+ }
578
+
579
+ /* ── RESPONSIVE β€” SHARED BREAKPOINTS ── */
580
+ @media (max-width: 1100px) {
581
+ nav { padding: 0 32px; }
582
+ nav ul { gap: 18px; }
583
+ }
584
+
585
+ @media (max-width: 900px) {
586
+ nav {
587
+ padding: 0 20px;
588
+ }
589
+
590
+ nav ul {
591
+ display: none; /* Mobile: links hidden, brand + github only */
592
+ }
593
+
594
+ .section-divider {
595
+ margin: 0 24px;
596
+ }
597
+
598
+ .page-nav {
599
+ padding: 28px 24px;
600
+ }
601
+
602
+ footer {
603
+ padding: 28px 24px;
604
+ flex-direction: column;
605
+ text-align: center;
606
+ }
607
+ }
608
+
609
+ @media (max-width: 480px) {
610
+ nav {
611
+ padding: 0 16px;
612
+ }
613
+
614
+ .btn {
615
+ padding: 10px 18px;
616
+ font-size: 0.65rem;
617
+ }
618
+ }
619
+
620
+ /* ── PRINT ── */
621
+ @media print {
622
+ body::before { display: none; }
623
+ nav { display: none; }
624
+ .page-nav { display: none; }
625
+ footer { border-top: 1px solid #ccc; }
626
+ .scroll-reveal { opacity: 1; transform: none; }
627
+ }