Anointed Knowledge AI
Ask your documents, verify every answer
Original build, RAG Document Intelligence (browser-stored vector search)
Upload your own documents, ask questions, and click straight through to the exact passage behind every answer.
Opens knowledge-ai.anointedcoder.com in a new tab
What it is
A working Retrieval Augmented Generation application built on Next.js 15 and React 19. Documents (PDF, DOCX, TXT, MD, CSV, HTML) are extracted and chunked in the browser, embedded through the OpenAI embeddings API, and stored as vectors in IndexedDB; questions are then embedded and ranked against those vectors using real cosine similarity plus a lexical keyword score before the top passages are sent to the model. The bundled sample knowledge bases load a pre-generated embedding index so visitors are not each re-embedding the same content, and fall back to live client-side indexing when no seed index is present; your own uploads always go through the live pipeline. It has a genuine OpenAI integration (embeddings and the Responses API with Zod-validated structured output) and genuine transactional email via Resend for lead capture. It deliberately has no user authentication, no server-side database and no payments: all visitor data lives in that browser's IndexedDB, which is documented in the app as a demo boundary rather than hidden.
Worth knowing
The model is never given real chunk IDs, so it cannot fabricate a citation: passages are relabelled C1, C2 and so on per request, and the server discards any citation marker that does not map back to a passage it actually supplied.
What is inside
- Client side document ingestion for PDF, DOCX, TXT, MD, CSV and HTML, plus pasted text and single page URL import, with file bytes never leaving the browser
- Heading and paragraph aware chunking (750 token target with 100 token overlap), embedded via the OpenAI embeddings API and stored in a browser IndexedDB vector store behind a swappable VectorStore interface
- Hybrid retrieval combining real cosine similarity with a local lexical keyword score, with configurable semantic/keyword weights, top K and minimum score threshold (defaults 0.8/0.2, top K 5, min score 0.2)
- Grounded answers through the OpenAI Responses API returning structured JSON (answer, confidence, cited passages, missing information, follow ups) validated with Zod, with citation labels resolved and sanitised server side
- Retrieval Lab and Chunks inspector for running a query and reading the ranked passages with their individual semantic, keyword and combined scores
- Evaluations page that measures Hit@1, Hit@3 and Hit@5 by actually re-running retrieval against expected documents, alongside a knowledge gaps table
- Analytics page aggregating stored query, latency and feedback records from IndexedDB into charts
- API layer protections: Zod validated request bodies on every route, rate limiting keyed by client IP and session cookie, a 25 answer per session cap, and SSRF protection on URL import that blocks loopback, private, link local and cloud metadata ranges and revalidates every redirect hop
Built with
Want something like Anointed Knowledge AI?
We built this one end to end: schema, backend, frontend, admin and deployment. We can build yours in 2 to 6 weeks.
