LocalRAG Browser Edge AI
WebGPU: {{ webGpuStatusLabel }}

1. Ingest Document

Dynamic Chunks: {{ textChunks.length }} Model: all-MiniLM-L6-v2 (~45MB)

2. Browser-Native LLM Config

WebGPU not supported. You can still use Transformers.js below for local semantic search!

Generate the semantic index first on the left to activate search matching.

Type a search query above to extract contextual paragraphs based on semantic embeddings.

Chunk #{{ match.id }} Similarity: {{ (match.score * 100).toFixed(1) }}%

{{ match.text }}

Local Chat Workspace

Once your index is built and local LLM is loaded, ask questions. The engine will retrieve context blocks and synthesize answers offline.

{{ msg.role === 'user' ? 'You' : 'Local AI' }}

{{ msg.content }}

How Browser-Native RAG works

STAGE 1: EMBEDDINGS

Transformers.js downloads a 384-dimensional mathematical model directly to your browser's persistent cache. Chunks of your document text are parsed and mapped to dense float arrays locally.

STAGE 2: SEMANTIC SEARCH

When you query, your question is mapped into the exact same mathematical vector space. The cosine angles of all chunks are computed locally, identifying the best match items in miliseconds.

STAGE 3: GENERATION

The highest-rated match blocks are injected directly into WebLLM as prompt contexts. WebGPU schedules model compilation inside your GPU, streaming synthesized answers instantly.

{{ toast.message }}