AiDiwasAiDiwas
AI Agents

Mini RAG Demo

See retrieval-augmented search rank documents live, entirely in your browser.

Every keystroke re-ranks a tiny 5-document corpus by cosine similarity over word-frequency vectors — entirely in your browser. This is the retrieval half of RAG, without a real embedding model or server call.

Retrieval-Augmented Generation
RAG retrieves relevant text chunks from a knowledge base and feeds them to a language model as context before it generates an answer, grounding responses in real documents.
19%
Pydantic structured output
Pydantic models define a typed schema for LLM output, so responses can be validated and parsed reliably instead of relying on regex over free text.
10%
Postgres and pgvector
pgvector is a Postgres extension that adds a vector column type and similarity search operators, letting a single Postgres database handle both relational data and vector search.
0%
AI agent approval loops
An AI agent can draft content on a review branch, then a bot posts an approve or reject prompt to a human before anything is promoted to production.
0%
Text embeddings
An embedding maps a piece of text to a vector of numbers such that semantically similar text produces vectors that are close together, measured by cosine similarity.
0%
Skills demonstrated:RAG conceptsVector similarityTypeScript