HANAWI SYSTEMS / WORK / RETRIEVAL LAYER
04/05Case

A recruitment email system whose retrieval actually retrieves

The obvious fix for repetitive candidate email is a language model. The obvious failure is a model that confidently invents answers to questions it has no source for. In hiring, a wrong answer about a role, a process or a policy is not a small problem.

COMPLETE-OR-FLAGGED DESIGN · ANSWERS TRACE TO A SOURCE

Sector
HR and recruitment
Basis
Own build
Stack
n8n · Supabase pgvector · Edge Function · Cohere rerank · OpenAI embeddings
Surface
Six n8n workflows
Design
Retrieval-grounded, self-cleaning index

The problem: a model that answers questions it has no source for

Recruitment email handling meant answering the same candidate and process questions over and over, by hand. Automating that with a bare language model trades a time problem for a trust problem: a chatbot bolted onto an inbox will answer everything, including the questions it has no business answering.

The approach

A retrieval-grounded email system rather than a chatbot. Every design decision exists to keep answers traceable to a source:

  1. Hybrid search, then rerank

    Answers are pulled from a curated FAQ knowledge base in a Supabase vector store, retrieved through a hybrid function that combines semantic and keyword matching, then reranked so the strongest source wins rather than the first plausible one.

  2. Chunked per FAQ, not per token window

    A retrieved passage is a complete answer, not a fragment torn mid-thought.

  3. Complete or flagged, never partial

    Multi-question emails are parsed question by question. If the system can answer all of them from sources, it replies. If it cannot, the email escalates to a person. A partial answer never goes out dressed as a full one.

  4. A record manager keeps the index honest

    Indexing tracks what has been ingested, so re-indexing updates and deletes cleanly instead of silently accumulating stale duplicates. This is the part most RAG builds skip and then quietly rot on.

The system

RETRIEVAL LAYER / SYSTEM MAP DIAGRAM
CLASSIFY EMAIL FRONT DOOR PARSE QUESTIONS ONE OR MANY HYBRID SEARCH SEMANTIC + KEYWORD RERANK BEST SOURCE WINS ANSWER RATIO GATE ALL OR ESCALATE SEND REPLY SOURCE ATTACHED ESCALATE A PERSON ANSWERS COMPLETE PARTIAL
FIG. 01 The answer path. The gate in the middle is the design: complete grounded answers ship, anything less waits for a person.
RETRIEVAL LAYER / INDEXING DIAGRAM
FAQ SOURCE CURATED FAQS CHUNK PER FAQ FULL ANSWERS EMBED VECTOR STORE RECORD MANAGER NO STALE DUPES RE-RUNS UPDATE AND DELETE CLEANLY. INDEXING IS AN OPERATION, NOT AN EVENT.
FIG. 02 The indexing pair. Re-indexing is self-cleaning, so the knowledge base can be maintained without accumulating rot.

How it fails safely

FailureWhat happens instead
Question with no sourceFlagged to a person. The model never invents an answer to cover the gap.
Email with five questions, four answerableThe whole email escalates. Complete or flagged, never partial.
FAQ content changesRe-indexing updates and deletes through the record manager. No stale duplicate ever outranks the current answer.
Wrong answer discoveredIt traces to a specific FAQ record, so it is a fixable content problem rather than a mystery inside a model.

Result

  • Repetitive recruitment email answering automated without giving up source grounding.
  • Answers trace back to a specific FAQ record, auditable end to end.
  • Indexing is re-runnable and self-cleaning, which is what keeps a RAG system trustworthy six months in.

Built by Hisham Hanawi. This is an AI in the workflow.

Related, but a different build: AutoRecruit moves candidates through a hiring pipeline. This system answers their questions from a grounded knowledge base.

AI that knows what it does not know.

100% JOB SUCCESS · TOP RATED PLUS · 583 HOURS / 6 ENGAGEMENTS

Source: Upwork profile, verified 2026-08