pearl-rag is a small, working proof of concept that demonstrates the complete Retrieval-Augmented Generation (RAG) workflow for document question answering. A user uploads a PDF or plain-text file; the system extracts and chunks its text, generates embeddings with an embedding model, stores the vectors in a vector store (Chroma or a similar solution), semantically retrieves the chunks most relevant to a question, and uses an LLM to generate an answer grounded in those retrieved chunks. Every answer is returned alongside the relevant source snippets it was built from, and questions the document cannot answer are handled gracefully rather than answered with fabricated content.
The product is deliberately lightweight: it is a prototype, not a polished application, and it favors existing libraries over bespoke components. Its audience is developers and technical evaluators who want to see the retrieval pipeline work end to end and who read the retrieved source snippets as closely as the generated answer. The intent is to prove the core pipeline first; authentication, multi-user document management, advanced reranking, hybrid search, and production deployment are explicitly deferred.
pearl-rag is delivered as a single lightweight web application backed by one Python/FastAPI service. The application has three first-party pages — Landing, Documents, and Ask — all reachable without authentication. The single active human actor is the Document Q&A User, who uploads a document, waits for ingestion to complete, then asks natural-language questions and reads the grounded answer together with the retrieved source snippets.
Current accepted behavior:
Narrow exclusions (current): user authentication, multi-user document management, advanced reranking, hybrid search, and production deployment are out of scope for this prototype and may be considered separately later.
pearl-rag is a first-party prototype application with no account system. All three pages are open to any visitor; there is no login, no per-user document ownership, and no differentiated permissions. The application owns the ingestion and retrieval pipeline and the interface for driving it. The LLM provider and the embedding model are external services the backend calls; the vector store is application-managed storage. The prototype is intended to run locally with a sample document and a short demo, not as a production deployment.
The current delivery boundary is the working RAG pipeline plus a minimal interface. Everything beyond that — authentication, multi-user document management, advanced reranking, hybrid search, production deployment — is a future consideration, not part of this prototype's acceptance.
FR-1 — Upload a PDF or text document (explicit) As a Document Q&A User, I should upload a PDF or plain-text file so that its contents can be ingested for question answering.
FR-2 — Extract and chunk text (explicit) As a Document Q&A User, I should have the uploaded document's text extracted and split into chunks so that it can be embedded and retrieved.
FR-3 — Generate embeddings (explicit) As a Document Q&A User, I should have each chunk embedded with an embedding model so that semantic search is possible.
FR-4 — Store vectors in a vector store (explicit) As a Document Q&A User, I should have chunk vectors stored in Chroma or a similar vector store so that they can be searched later.
FR-5 — Semantic search for relevant chunks (explicit) As a Document Q&A User, I should have my question semantically matched against stored chunks so that the most relevant sections are retrieved.
FR-6 — Generate a grounded answer with an LLM (explicit) As a Document Q&A User, I should receive an LLM-generated answer built from the retrieved context so that the answer reflects the document.
FR-7 — Return relevant source snippets with answers (explicit) As a Document Q&A User, I should see the relevant source snippets alongside each answer so that I can verify the answer against the document.
FR-8 — Handle unanswerable questions (explicit) As a Document Q&A User, I should receive a clear refusal when the document cannot answer my question so that I am not given fabricated content.
FR-9 — Simple interface for asking questions (explicit) As a Document Q&A User, I should have a simple interface (or API) for asking questions so that I can drive the pipeline without a complex client.
FR-10 — Lightweight implementation using existing libraries (explicit) As a developer, I should have the prototype built on existing libraries rather than bespoke components so that the implementation stays small and focused.
FR-11 — Document must be ingested before questions can be answered (required_inference) As a Document Q&A User, I should be required to ingest a document before asking questions so that answers are always grounded in an available document.
Muse: Peter Saville. Headline: "Ask the document." — a single exact colour code carries the whole document.
Palette (light mode):
#F4F2ED (gallery-paper off-white, ~70% of every screen as deliberate silence)#FFFFFF (reserved for the one evidentiary surface — retrieved-chunk card and answer panel)#111111#111111#F03B1E (vermilion — used only as a code: retrieval-score bar, active pipeline stage, citation numerals, one hairline under the wordmark; never as a button fill)#8A867C (metadata labels and secondary text at 12px with wide tracking)Typography:
-0.03em tracking and sentence case; a single word or numeral per line at extreme scale.+0.16em letterspacing, like catalogue accession tags.Shape language: Sharp corners everywhere, zero border radius. Hairline 1px rules in #111111 at 100% for structural dividers and #D9D5CC for subordinate ones. Retrieved chunks are framed by a single 1px black rule with a 4px vermilion left edge — a specimen mount, not a card. Numerals set in tabular figures at large size act as ornament. No shadows, no fills except the one white evidence surface and one full-bleed vermilion band per page.
Layout: A strict 12-column grid with a persistent left metadata rail (columns 1–2) holding stage labels, chunk counts, and model names in small-caps metadata; content occupies columns 3–12. The landing page is a single centred artefact — the pipeline diagram — surrounded by silence, with metadata blocks in the four corners like a record sleeve. Documents and Ask use the same rail, so the app feels like one continuous catalogue rather than separate screens. Sections are separated by full-width hairlines, never by cards.
Imagery: The interface is the image. The hero artefact is a hand-built SVG pipeline diagram: five nodes (Upload, Extract & Chunk, Embed, Retrieve, Generate) connected by hairline rules, with tick marks and small tabular numerals beneath each node. Retrieved chunks are shown as typographic specimens with citation numerals and a thin vermilion relevance bar. No photography, no illustration, no icons beyond a minimal geometric set drawn at 1px weight.
Avoid: Filled coloured buttons; rounded corners, drop shadows, or card grids; gradient or blob backgrounds; photography, illustration, or decorative icons; vermilion as a button or large background fill on more than one band per page; animated marquees, parallax, or hover-lift effects; a chat-bubble interface; any blue, indigo, or violet in the palette.
The public entry is a full-viewport gallery mount, not a SaaS hero. Top-left holds the wordmark "pearl-rag" in 11px uppercase tracked metadata with a single vermilion hairline beneath it. Top-right holds a metadata block: "RAG · POC · v0.1". The dominant element is a centred 5-node pipeline diagram spanning roughly 60% of the viewport width, drawn in 1px black rules with vermilion marking the active node, each node labelled in 11px uppercase metadata beneath it and numbered 01–05 above it. Above the diagram, a single oversized Archivo Light line at 56–128px, "Ask the document.", set flush-left and breaking across two lines, occupying the full content width. Beneath the diagram, one line of 16px body copy and a single underlined text link "Upload a document →" in black — no filled button. The remaining space is deliberate silence on #F4F2ED.
The signature moves carry through the app: the pipeline diagram as the hero artefact with a vermilion marker that advances as ingestion runs; retrieved chunks rendered as specimen mounts with a 1px black frame, 4px vermilion left edge, large tabular citation numeral, and a hairline relevance bar encoding the retrieval score; a persistent left metadata rail on every page; one full-bleed vermilion band per page holding the answer on the Ask page; and unanswerable questions returned as a deliberate typographic refusal — "Not in this document." in large Archivo Light, with the closest retrieved chunks still shown beneath at reduced opacity.
Interaction Model: Static Motion Tempo: still Hero Dimensionality: flat
Landing Hero Motion Brief
#F4F2ED; wordmark top-left with vermilion hairline; "RAG · POC · v0.1" top-right; oversized "Ask the document." flush-left above the centred pipeline diagram; one line of body copy and the underlined "Upload a document →" link beneath.clamp()) to fit, with no other element covering them. Rationale: explicit design constraint.prefers-reduced-motion, all fades are removed and final states shown immediately. Rationale: explicit design constraint.
pearl-rag is a document Q&A prototype: upload a PDF or text file, and every answer is built from the chunks retrieved out of it.
Upload a document
pearl-rag is a document Q&A prototype: upload a PDF or text file, and every answer is built from the chunks retrieved out of it.
Upload a document
No comments yet. Be the first!