Architecture

RAG Pipeline

Retrieval-Augmented Generation using LangChain LCEL, ChromaDB vector store, and 5 local OSO models (Llama 3.1, Mistral, DeepSeek, Gemma, Qwen).

Data Curation Pipeline

4-Tier Classifier: Option A (Binary Grep), Option B (Embedding Similarity), Option C (LLM Judge), Option D (Hybrid).

Source: phase5_benchmark_report.json

Vector Database

123,538 chunks embedded with nomic-embed-text via Ollama. Chunk size: 500 / Overlap: 100 / Batch: 250.

Source: vector_store_metadata_phase5.json

Zero Trust Security

100% local execution. No proprietary data leaves the machine. Frontier cloud AI deferred to Phase 5B.

Data & Workflow

Data Curation Benchmark

18,074
Files Indexed
9,046
Candidates Identified
5,233
Option A Pass (Binary Grep)
6,592
Option B Pass (Embedding)
6,520
Files Copied to Corpus
2,360
Files Embedded
123,538
Chunks Created

Corpus Breakdown

  • DOCX: 2,697 files
  • EXCEL: 1,470 files
  • OTHER (PPT, HTML, VSD, MPP, TXT): 1,888 files
  • PDF: 447 files
  • IMAGES: 18 files

Runtime & Hardware

  • 5-Model Test on 1,000 Files: 5.51 hours
  • GPU: NVIDIA RTX 5070 — 50% utilization, 66°C, 8.8/27.6 GB memory
  • CPU: 8 cores / 16 threads — 7% utilization
  • RAM: 12.6/31.1 GB used

Lessons

Data Is the Bottleneck

22 years of unstructured consulting data required a multi-tier classifier. Binary grep alone is fast but crude; embeddings add semantic depth.

Binary Files Pollute Corpora

Extensions like .rmt, .execution, .class produced false positives. Filtering by extractable formats improved precision.

Threshold Tuning via HIL

The 0.35 embedding threshold was validated by Human-In-The-Loop review — 5 of 5 human-readable files passed.

7B–11B Models Deliver Entry-Level Analysis

Local OSO models produced Junior-to-Entry-level Q&A on 6,520 documents with 100% zero-trust privacy.

Deduplication by Hash

MD5 hashing in SQLite deduped files with identical content, even when filenames differed across client folders.

Retry Logic

Connection failures during embedding recovered with automatic retry (10s wait, 3 attempts).

Results

11 GRC Questions — Quality Scores (HIL)

#QuestionScore (5 = best)
1Top 5 compliance risks3.0
2Security controls documents5.0
3Segregation of duties3.5
4Regulatory compliance5.0
5GRC framework summary5.0
6Common conclusions3.5
7Strengths & weaknesses3.0
8Improvement recommendations3.0
9Buzz words & frequencies3.0
10Document usefulness tiers2.5
11HML scorecard by PPP1.0
Average3.45

Model Comparison

5 OSO models tested on 1,000 stratified files. Raw judgments: llm_raw_judgments.json (818 pages).

HIL-VV sample (81 pages): ~75% agreeable/useful · ~25% require file-level double-check.

Source: rag_results_phase5.json · phase5_benchmark_report.json · llm_raw_judgments.json

Success Criteria

  • ✅ 18,074 files indexed (target was 919+)
  • ✅ 6,520 files curated into structured corpus
  • ✅ 123,538 chunks embedded in ChromaDB
  • ✅ 11 GRC questions answered with structured IRCSC format
  • ✅ 5 OSO models benchmarked on 1,000 files
  • ✅ Zero-trust, local-only execution
  • ⏸️ OCR, Docker, Cloud AI deferred to Phase 5A/5B/5C