Inspiration

LLMs write fluently, and that is exactly the problem. A confident paragraph with one invented statistic is worse than no paragraph, because it’s hard to spot. While writing reports and project documentation, I kept wondering which sentences were actually backed by my sources and which the model had made up. I wanted a tool that treats evidence as the first-class citizen, not an afterthought. That became Evidentia: write or ask first, and have every claim traced back to a source you provided.

What it does

Evidentia is a RAG (Retrieval-Augmented Generation) platform with two modes:

Ask: Upload your documents and ask questions. Answers are generated only from retrieved passages, with inline citations like [1], and the exact evidence is shown next to the answer. If the sources don’t contain the answer, it says what’s missing instead of guessing. Verify Draft: Paste any text and Evidentia checks it sentence by sentence against your sources, labeling each claim supported, partial, or unsupported, with a short reason and the closest matching passage.

How we built it

Stack: Next.js 14 (App Router), NVIDIA NIM API, deployed on Vercel.

Chunking: Documents are split into roughly 800-character passages along paragraph boundaries so each chunk stays semantically coherent. Embedding: Chunks are embedded with NVIDIA’s nv-embedqa-e5-v5 model through a serverless API route. The model is asymmetric, so documents use passage mode and questions use query mode. Retrieval: For a query embedding $q$ and chunk embedding $d_i$, chunks are ranked by cosine similarity: $$\text{sim}(q, d_i) = \frac{q \cdot d_i}{\lVert q \rVert \, \lVert d_i \rVert}$$

and the top $k$ chunks are passed forward ($k = 5$ for questions, $k = 2$ per sentence for verification).

  1. Grounded generation: llama-3.1-70b-instruct receives only the numbered passages and is instructed to cite each statement and refuse to go beyond them. A low temperature ($0.1$) keeps outputs consistent.
  2. Verification: Each sentence of a draft is a claim. Claims and their evidence are sent in a single batched call that returns structured JSON verdicts, which keeps latency and API cost low.

Challenges we ran into

Serverless has no persistent storage. Vercel functions are stateless, so a traditional in-memory or file-based vector store wouldn’t survive between requests. I moved the vector store into the browser and run similarity search client-side. Only the top few passages travel to the server, which also keeps request payloads small. Asymmetric embeddings. Early on, retrieval quality was poor until I realized the embedding model needs different input_type values for documents and queries. Using the wrong one quietly degrades results without any error. Rate and batch limits. Embedding a large document in one call fails, so ingestion is batched in groups of 32 chunks. Making LLM output machine-readable. The verifier must return strict JSON, but models sometimes wrap it in extra text. I constrained the prompt and extract the JSON array defensively before parsing. Preventing “helpful” hallucination. Models want to answer. Getting one to say “the sources don’t cover this” required explicit prompt rules, and it’s the behavior that matters most for a trust-focused tool.

What we learned

Retrieval quality matters more than model size. Good chunking and correct embedding modes improved answers more than any prompt tweak. Designing around platform constraints, like stateless serverless, can lead to simpler architectures. Trust in AI products comes from showing the evidence, not from sounding confident. Calling an LLM to judge a claim is itself fallible, so the UI always shows the source passage so a human can make the final call.

What's next for Evidentia

Supabase pgvector for persistent, multi-user knowledge bases PDF and web-page ingestion Streaming responses A rich editor with inline highlighting of unsupported claims Reranking with an NVIDIA reranker model for sharper retrieval

Built With

Share this project:

Updates

Submission history