RAG Biography Workflow: Retrieval, AI Drafting, and Human Approval in One Workflow
A working demo of a retrieval-augmented generation (RAG) pipeline built as a full application, not a chatbot. A recipient submits their background, the app retrieves matching reference material, an AI model drafts a biography from that context, and an operator must approve it before it reaches anyone.
- Client
- Internal Demo (Cataluma LLC)
- Year
- Service
- Applied AI Workflow Development

At a Glance
Challenges
- RAG demos usually show a slide with no working software, or a chatbot that hides retrieval inside a black box.
- Clients and hiring managers rarely see how retrieval, generation, and human review connect as one workflow.
- Most demos skip the retrieval step, so nobody can check what the model actually read before it wrote.
Benefits
- Every retrieval decision, generated draft, and human approval is logged and reviewable.
- A non-technical stakeholder can see the full retrieval-to-approval shape in under two minutes of screen time.
- The same approval-gated shape now works as a template for client projects that need a human sign-off before AI output ships.
- Tracked workflow states
- 9
- Supabase tables in the audit trail
- 4
- Approval gate before anything ships
- 1
- Next.js (Front end & routing)
- TypeScript (Type safety)
- AI SDK v5 (Model orchestration & generation)
- Supabase / PostgreSQL (Persistence & audit trail)
- Tailwind CSS (Styling)
- shadcn/ui (UI components)
A small demo that shows the whole shape of applied AI work: retrieve the right material, let the model draft from it, and never skip the human in the loop.
Founder, Cataluma LLC
The Problem
Teams that want to show what a RAG system does often end up with one of two things. A slide that says "RAG" with no working software behind it. Or a chatbot demo that hides the retrieval step inside a black box. Neither shows how retrieval, generation, and human review fit together as one real workflow.
I wanted a small, complete demo a client or hiring manager could watch end to end. A person requests a biography. The system pulls the right reference material for that person. An AI model drafts the text from it. A human signs off before anything goes out. Not a chatbot toy — a durable workflow with real state, real persistence, and a real approval gate.
What I Built
I designed and built the full application solo: the workflow, the retrieval logic, the AI integration, the UI, and the database schema.
Application layer. A Next.js app with three surfaces: an operator dashboard, a recipient-facing form, and a review screen. Each workflow moves through nine tracked states, from "link sent" to "approved" or "disapproved." Supabase (PostgreSQL) keeps that state through page reloads and server restarts.
Retrieval. Most demos skip this step. When a recipient submits the form, the app queries a bio_reference_documents table and scores each document against the submitted occupation and skills with term-overlap matching — no vector search, no embeddings. The top matches are selected and logged, so anyone can see exactly what was retrieved before generation ever runs. This scoring logic is my own code, not the model's.
Generation. The retrieved reference material and the recipient's submitted details feed a prompt template. The AI SDK (generateText, OpenAI model, 500 max tokens) writes the biography text. This is the model's one job in the pipeline — everything upstream is deterministic code I control.
Human review. The generated biography lands on the operator's dashboard as "Pending Approval." The operator reads the full text and either approves it, which sends it to the recipient, or disapproves it with a reason, which routes feedback back to the recipient instead. Nothing generated reaches the recipient without a person reading it first.
Data and integrations. Four Supabase tables — workflows, workflow_recipients, workflow_biographies, and bio_reference_documents — carry the full audit trail from request to decision. Email sending is simulated for the demo and logged to console, with the send path structured to drop in a provider like Resend without touching the workflow logic.
My Role on the Team
Solo build, start to finish: workflow design, database schema, retrieval and ranking logic, prompt construction, the Next.js UI, and the review and approval flow. No other engineers worked on this. It's a self-contained demo built to show applied-AI workflow design as a working system, not a slide.
Impact
The demo makes an otherwise invisible pipeline visible. Every retrieval decision, every generated draft, and every human approval is logged and reviewable. That's the same shape of workflow I build for clients who need AI output that a person signs off on before it ships. It's a compact way to explain retrieval-with-approval to a non-technical stakeholder in under two minutes of screen time.
A small demo that shows the whole shape of applied AI work: retrieve the right material, let the model draft from it, and never skip the human in the loop.
Founder, Cataluma LLC
9 tracked states, 4 database tables, 1 approval gate — the whole audit trail, in one workflow.