Skip to content

00. Evidence Map

Repository areas inspected

Area Path Status
Product docs README.md, AGENTS.md, index.html Read
Manifests package.json, pnpm-lock.yaml, vite.config.ts, tsconfig*.json, components.json Read
CI .github/workflows/deploy.yml Read
App entry src/main.tsx, src/App.tsx Read
RAG src/rag/* Read (orchestrator, retrieval, indexing, chunking, embeddings, extractors)
LLM src/llm/* Read (runtime, models, parsers, AI SDK stream)
DB src/db/client.ts, src/db/migrations.ts Read
Workers src/workers/* Read
Routes / UI src/routes/*, src/components/*, src/context/*, src/hooks/*, src/lib/* Sampled + targeted reads
Tests *.test.* / *.spec.* None found

Key evidence files

File Why it matters
README.md Product claims and feature list
package.json Dependencies; scripts; no test runner
vite.config.ts base: '/browser-rag/', COOP/COEP headers
src/rag/orchestrator.ts End-to-end ask path
src/rag/retrieval.ts Hybrid search + RRF
src/rag/indexing.ts Index pipeline
src/db/migrations.ts Schema v1
src/db/client.ts PGlite IDB persistence, export/import
src/llm/llm-runtime.ts Engine adapters; stubbed tools
src/llm/llm-models.ts Model catalog and defaults
src/workers/embedding.worker.ts ONNX embedding off main thread
src/lib/document-files.ts Separate file blob store
.github/workflows/deploy.yml Pages deploy only

Commands run during inspection

git clone https://github.com/Hari31416/browser-rag.git repos/browser-rag
rg --files   # source tree listing
rg -n "Characters|dangerouslySetInnerHTML|ocrRequired|..." src

No pnpm install / pnpm build was run in this dossier pass (inspection was static).

Intentionally skipped

  • node_modules / .pnpm-store (not present in clean clone beyond store dir metadata)
  • Generated dist/
  • Full contents of large bundled kernels src/lib/gemma-4-e2b.js, src/lib/lfm2_5.js (treated as opaque engine bundles)
  • Exhaustive line-by-line review of every shadcn UI primitive

Confirmed / inferred / unknown

Confirmed

  • Frontend-only SPA; no application API server
  • PGlite + pgvector on idb://browser-rag
  • Hybrid retrieval with RRF (reciprocalRankFusion)
  • Query rewrite before retrieval when history exists
  • Dual workers for indexing parse/chunk and embeddings
  • Four LLM engine types behind LLMEngineAdapter
  • RAG path sets toolsEnabled: false; tool loop caps at 0
  • CI: install → build → deploy dist to gh-pages
  • Chat/history HTML via marked.parse + dangerouslySetInnerHTML
  • Settings labels chunk size as “Characters”; chunkText uses token estimates (×4 chars)

Inferred

  • Model weights download from Hugging Face / MLC CDNs via Transformers.js and WebLLM
  • LLM inference may use library-internal workers not owned by this repo
  • GitHub Pages production may lack COOP/COEP unless configured outside this repo

Unknown

  • Whether production Pages serves isolation headers
  • Intended future for tool calling vs permanent disable
  • License/provenance details of bundled Gemma/LFM kernels
  • Manual QA process outside the repository

Confidence by subsystem

Subsystem Confidence Notes
Product purpose High README + routes align
RAG indexing/retrieval High Core modules read end-to-end
LLM multi-engine runtime High Catalog + runtime + hooks inspected
Data model High Single migration file
Frontend UX details Medium Chat/settings/documents sampled
Production security headers Low Only Vite config evidenced
Tool-calling product intent Low Stubbed code only