How this guide works
The assistant in the corner is a small retrieval-augmented generation (RAG) pipeline over this site. It answers only from the site's own text, cites where each answer comes from, and says "I don't know" when nothing fits.
At build time
- 01 / Chunk
At build time, every case study section, project, the intro, availability, QA record and this page become one chunk each. Missing content is skipped, never indexed.
- 02 / Embed
Each chunk is embedded with gte-small, a 384-dimension open model that runs locally through Transformers.js. No embedding API.
- 03 / Ship
Chunks and vectors are written to a JSON file in the repository, so the index always deploys with the content it was built from.
For each question
- 01 / Limit
Each visitor gets 10 questions per 10 minutes, and the whole site 90 a day, to stay inside the Groq free tier. When a limit is reached, or Groq is unavailable, the guide says it is busy and lists the parts of the site that match the question instead, found by search alone.
- 02 / Embed
The question is embedded with the same model, inside the serverless function.
- 03 / Retrieve
Keyword search (BM25) and vector search (cosine) each rank the chunks; reciprocal rank fusion merges them, and the top 4 become the sources.
- 04 / Generate
GPT-OSS 120B on Groq answers in a few sentences, only from the numbered sources, and cites them.
- 05 / Cite
Source links come from the chunks themselves, never from the model's text.
The details
When nothing fits
If no chunk shares a keyword with the question and none is close in meaning, the model isn't called at all; the guide says "I don't know". When sources are found but don't answer the question, the model is told to say "I don't know" too.
Model
GPT-OSS 120B (openai/gpt-oss-120b) on Groq, with low reasoning effort and a short answer limit. The model ID is one value in the code, so swapping it is a one-line change.
Evaluation
About 20 recruiter questions run against the real route every night: the expected source must be retrieved, the answer must cite a source and contain the key facts, and out-of-scope questions must get "I don't know". A few answers are checked for faithfulness by a second model call.
At scale
A few dozen chunks fit easily in memory, so there is no vector database. With many more documents, the same index format would move to Postgres with pgvector.