Build1 distinct publisher3 min readUpdated
A dev.to build log for KnowBase AI publishes the load-bearing parts: retrieval scoped by workspaceId, chunks that keep a pointer home, and citations you can click. The retriever is the swappable half.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
A developer has published the build log for KnowBase AI, a multi-tenant SaaS knowledge base where businesses upload documents and an assistant answers from their own content with clickable source citations [1]. The useful part is not the retrieval trick; it is that the two things holding the product up, tenant scoping and chunk provenance, are both decided at schema and ingestion time.
The author's framing is blunt: the standard tutorial embeds a few paragraphs, calls similaritySearch, prints an answer, and that gets you a demo rather than a product [2]. In production the same idea splits into four separate small products: ingestion, retrieval, grounding, and trust [3]. The writeup argues that a single-user RAG app and a multi-tenant SaaS share almost no code after the demo stage, because every query, chunk, and conversation has to be scoped to a workspace [12].
The published retrieve function takes a workspaceId and a query, pulls document chunks whose document.source.workspaceId matches, and takes five [8]. It also filters chunk text with a contains match, which is a substring scan rather than vector search [9], while the comment directly above it talks about a tenant never retrieving another tenant's chunks even if the embedding matches [10]. That gap between comment and code is the clearest evidence for the angle: the ranking function is the replaceable half of retrieval, and the workspace predicate travelling through document to source is a property of the schema, not of the query. The data model carries it: Workspace as tenant container, WorkspaceMember with Owner, Admin, and Member roles via NextAuth.js v5, KnowledgeSource plus Document plus DocumentChunk always under a workspace, Conversation and Message scoped per workspace, and ApiUsage tracking tokens per workspace [11].
Ingestion is where citations are won or lost. Documents arrive as files, URLs, or manual entries [19], and the chunker slices text at 800 characters with 200 characters of overlap [4], which means a stride of 600 [5] and roughly 1.33 characters stored and embedded for every character of source [6]. Each chunk is tied to its source document so retrieval can always trace back to where the information came from [7]. Keep that pointer and citations are a rendering problem later; drop it and you re-ingest the corpus.
The answer path streams tokens over SSE and attaches the chunks that grounded them, so a user can click through to the source document [16]. The author's claim is that this single feature separates a gimmick from a support tool, because support teams do not trust "trust me", they trust an answer they can verify in two clicks [17].
The genuinely deferrable decisions are the ones the writeup treats lightly. A thin AIProvider interface lets the app run on OpenAI, Gemini, or Claude by configuration and fall back to a MockProvider when no keys are set [13], which is how a public demo shipped with no signup and no leaked keys [14][15]. SQLite via @prisma/adapter-libsql was chosen first, with PostgreSQL held in reserve [18].
Three things to check if you copy this. The take of five caps each answer's evidence at about 4,000 characters of retrieved text [21], which is a grounding limit, not a retrieval one. The live demo returns mock responses [15], so answer quality is not observable from it. And ApiUsage per workspace [11] is the seam where metering becomes billing.
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
The published retrieve function signature is retrieve(workspaceId, query) and queries prisma.documentChunk.findMany with where document: { source: { workspaceId } } and take: 5.
The same retrieve function filters chunks with text: { contains: query }, a substring match.
The code comment above retrieve reads that every AI retrieval is scoped by workspaceId and a tenant can never retrieve another tenant's chunks, even if the embedding matches.
A dev.to writeup describes KnowBase AI, a multi-tenant SaaS knowledge base where businesses upload documents and an AI assistant answers questions grounded in their own content, with source citations you can click.
The author writes that every "build a RAG chatbot" tutorial ends the same way: embed a few paragraphs, call similaritySearch, print the answer, and that this gets you a demo, not a product.
The post says RAG in production means four steps: ingestion (upload, chunk intelligently, store), retrieval (find chunks that answer the question), grounding (build a prompt from retrieved context, no hallucinated answers), and trust (show source citations); each step is a small product on its own.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Verifiable code excerpts, single self-reported source
The mechanical claims are unusually checkable for a build log: the chunker, the retrieve() query, the provider registry, and the SSE chat handler are all pasted, and arithmetic claims follow directly from them. But the cluster has exactly one self-published source, and the interpretive claims — citations as the trust differentiator, SQLite as production-sufficient — carry no measurement, test, or third-party confirmation.
Demo plus MIT repo, no disclosed users
Observable adoption stops at a self-hosted artefact: one Netlify demo that answers with mock responses and one MIT-licensed repository. No tenants, customers, installs, stars, traffic, or production workloads are disclosed, and no third party is reported using the pattern.
Production framing outruns the shipped retriever
The post positions itself against tutorials that merely 'call similaritySearch' and claims to show what production RAG requires, yet the retrieval stage it publishes is a workspace-filtered SQL substring match returning five chunks, and its isolation comment reasons about embedding matches the code never computes. Grounding, provenance, and tenant scoping are genuinely implemented, which keeps the gap moderate rather than severe, but 'production' is doing more work than the evidence supports given the demo is mock-mode and nothing is measured.
Disclosed employer promotion and series marketing
The author states he is a full-stack developer at RA Technologies and twice promotes that firm as building SaaS and AI products 'like this' for startups and businesses worldwide, closing with a cross-link to his own Building AI Products series. The promotional interest is openly disclosed and the code is MIT-licensed, which limits concealment, but the piece functions as capability marketing and that shapes the confident 'right call' framing of unmeasured decisions.
High on code facts, low on outcomes
Confidence is high that the described pipeline exists as published, because the code is reproduced and the derived figures follow from it. Confidence is low that any claim about product behaviour, retrieval quality, tenant-isolation robustness, or datastore suitability generalises, since there is one self-interested source, a mock-mode demo, and no measurements or corroboration.
invest
Nearly half of ChatGPT's advisor citations were advisors' own websites1 distinct publisher
build
The demo-best voice engine finished last: 12,247 calls argue for buying on completion rate1 distinct publisher
build
A 14,000-star watermark remover, and no detector to test it against1 distinct publisher
build
DoiT buys Attribute, and AI cost attribution moves from billing tags to the kernel1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 15, 2026