AbesBot

Builder intelligence

Project Blueprint · $19
All build recipes
Knowledge product

Build a document Q&A app that cites its work

A retrieval-first recipe for uploading documents, finding relevant passages, answering with citations, and refusing when the evidence is weak.

Updated November 2, 202610 min build planOriginal AbesBot analysis

Built for: Builders creating a private knowledge assistant, policy finder, research workspace, or customer document portal.

Not for: A general chatbot, an unsupervised legal or medical decision system, or a product that promises perfect answers from poor source material.

The outcome

Know what “built” means.

A user can upload an allowed document, ask a question, inspect the supporting passages, and see an honest “not enough evidence” response.

01 · Upload & answer UI

Lovable

Official site

Build document management, ingestion status, questions, answers, and citation views.

Why this layer
The interface is conventional; the difficult work belongs in retrieval quality and permissions.
The catch
Do not present a streaming answer before the app has identified and displayed the evidence.

02 · Documents & vectors

Supabase

Official site

Store files, document metadata, text chunks, embeddings, and row-level access rules.

Why this layer
Postgres plus pgvector keeps product records and retrieval filters in one understandable system.
The catch
Every vector query must preserve tenant and document permissions.

03 · Extraction & answers

OpenAI API

Official site

Extract or normalize text, create embeddings, and compose an answer from retrieved evidence.

Why this layer
One API can cover the first version of the retrieval and answer pipeline.
The catch
The model should receive only the passages needed for the question, not the entire private library.

04 · Ingestion worker

Railway

Paid link

Process uploads, split text, create embeddings, retry failures, and report progress.

Why this layer
Document ingestion is job-shaped work and should not depend on an open browser request.
The catch
Make every stage idempotent so a retry does not duplicate chunks or charges.

05 · Web deployment

Vercel

Official site

Host the customer-facing application and fast question endpoints.

Why this layer
The web layer benefits from previews and a straightforward frontend deployment loop.
The catch
Keep bulk ingestion and re-indexing on the worker.

06 · Workspace access

Clerk

Official site

Manage organization membership and invitations when document libraries are shared.

Why this layer
Team membership is easier to reason about when it is a first-class account concept.
The catch
It does not replace database authorization; map every account to explicit data ownership.

Links marked Paid link may earn Angry Abes Apps, LLC a commission. Compensation never changes the selected stack or verdict. Full disclosure.

How the pieces move

Upload
Malware/type check
Extract & chunk
Embed with ownership
Retrieve evidence
Answer with citations

Build order

Do the risky work first.

01

Start with an evaluation set

Collect 30 real questions: answerable, ambiguous, and impossible. Record the exact passages a careful human would use.

Proof before moving on: The test set includes refusals, not only easy successes.
02

Build visible ingestion

Show uploaded, processing, ready, and failed states. Save the parser version and a content checksum so reprocessing is deliberate.

Proof before moving on: A failed file can be retried without creating duplicate document records.
03

Retrieve before generating

Filter by owner and document, fetch a small set of passages, and score whether the evidence clears a useful threshold.

Proof before moving on: The interface can display the retrieved text before an answer is generated.
04

Make citations navigable

Attach document, page or section, and quoted passage references to each answer. Let users open the source around the cited text.

Proof before moving on: A reviewer can verify an answer without searching the document from scratch.
05

Tune refusal behavior

When evidence is missing or contradictory, say so and suggest the next useful question or document.

Proof before moving on: Impossible questions do not produce invented citations.

Change the stack when the constraint changes

Tiny document set and fastest prototype

Supabase pgvector pipeline Use hosted file search

A managed retrieval tool reduces ingestion code while you validate the experience.

Complex parsers or large files

Single Railway worker Split parsing and embedding jobs

Separate queues make retry cost and failure ownership clearer.

Single-user private prototype

Clerk organizations Use Supabase Auth only

Avoid team-account complexity until shared libraries are a real requirement.

Non-negotiable guardrails.

01

Authorize before retrieval

Filtering after vector search can leak the existence or content of another customer’s document.

02

Treat uploads as untrusted

Validate file type and size, isolate parsing, and never execute embedded content.

03

Separate evidence from prose

Store retrieved passages and generated answers independently so citations can be audited and answers can be regenerated.

Quick answers

Questions before you commit.

Do I need a separate vector database?+

Not for most first versions. If the rest of the product already fits Postgres, pgvector keeps permissions, metadata, and retrieval close together. Add specialized infrastructure only when measured scale or retrieval requirements demand it.

How large should document chunks be?+

There is no universal size. Start from the structure of your documents and evaluation questions, preserve headings and page references, and test whether each retrieved chunk contains enough context to support a citation.

Can citations still be wrong?+

Yes. A citation may be real but not support the claim. Evaluate whether the cited passage actually entails the answer, and make source inspection easy for the user.

Official sources checked

Feature, pricing, policy, and compatibility details can change. We link the primary sources used for the factual foundation; the sequence, tradeoffs, and verdict are original AbesBot analysis.

The weekly builder brief

New tools. Changed recipes. No hype.