04AI assistantReadyDemo project

DocuMind

An AI assistant that answers from a company's documents, shows its source, and says so plainly when the answer isn't there.

DocuMind is an AI assistant for documentation. It answers only from indexed documents, attaches a source with a quote to every answer, and declines to answer when the knowledge base doesn't hold what's needed.

WHO IT'S FOR

Teams with a large body of documentation: policies, procedures, a support knowledge base, technical docs.

01 / THE PROBLEM

What needed to change

Finding an answer in large technical documentation takes time, and a plain LLM chat with no document grounding can give a plausible but wrong answer — the model answers from its guesses, not from fact.

02 / THE SOLUTION

How the solution works

DocuMind searches by meaning inside the indexed documents and builds its answer only from what it finds. Every answer comes with a source card — document, section, quote — so it can be checked rather than taken on trust. If the knowledge base holds nothing relevant, the assistant says so plainly instead of making something up. The model can run locally, without calling any external service.

03 / THE OUTCOME

What the business gets

What changes in day-to-day work once a product like this is running.

01The answer arrives in a chat — no manual searching through folders and files.
02Every answer has a source and a quote: it can be checked rather than taken on trust.
03The model can run locally — no external services and no per-request cost.

04 / CAPABILITIES

Key capabilities

Only the capabilities that support the core user journey.

  1. 01Search by meaning, not by keywords
  2. 02Answers with source cards: document, section, quote
  3. 03An honest refusal when the documents don't hold the answer
  4. 04Answers in Russian even when the documents are in another language
  5. 05Chat history with the sources preserved
  6. 06Knowledge-base browser: documents and their sections
  7. 07Local model operation with no external services

05 / FOR TECHNICAL READERS

What happens beneath the interface

Documents are split into meaning-aware chunks (by heading, paragraph, and sentence — not an arbitrary length) and turned into embeddings, either locally via Ollama (nomic-embed-text) or via OpenAI, selected by a single setting. Chunks are stored in PostgreSQL with pgvector and an HNSW index. A user's question is embedded the same way and matched via cosine similarity inside Postgres; if nothing clears a measured similarity threshold, the language model isn't called at all. When it is called, generation is grounded in the retrieved chunks and returned in a structured, schema-validated form; the model's citations are intersected with what was actually retrieved before the answer reaches the user.

  1. 1 · DocumentsAre split into meaning-aware chunks and turned into vectorsOllama (nomic-embed-text) or OpenAI
  2. 2 · SearchFinds the chunks closest to the questionPostgreSQL, pgvector, HNSW
  3. 3 · ThresholdIf nothing is close enough, the model isn't called — an honest refusalCosine similarity
  4. 4 · AnswerThe model answers from the retrieved chunks; citations are checked against sourcesOllama (qwen3:4b), schema validation
  • Semantic search over the document corpus via pgvector with an HNSW index — real embeddings, not keyword matching.
  • Retrieval-layer refusal: if no chunk clears a measured similarity threshold, the model is never called.
  • Citation validation: a source that isn't among the retrieved chunks is dropped; an answer with no confirmed citations is shown as a refusal.
  • Prompt-injection resistant: document content is explicitly marked as untrusted data, not instructions.
  • Local inference via Ollama (qwen3:4b + nomic-embed-text); a cloud provider (OpenAI) is supported behind the same interface.
  • Reopening a past conversation never calls the model again — answers and sources are kept in the history.
Next.jsTypeScriptPostgreSQL (pgvector)OllamaSupabase

06 / VERIFICATION

A result you can verify

These figures refer to the recorded, verified version of the project.

0Lintfindings
0Typecheckerrors
32 / 32Unit tests (Vitest)passed, 11 files
SuccessfulBuild
100%Top-1/3/5 retrieval hit rate16 eval questions, real Ollama embeddings
19 / 20RAG evaluation (real generation)citation integrity 100%

07 / LIMITATIONS

Demo boundaries

  • —A demo implementation over a small, fixed synthetic document corpus — not a tool for arbitrary file uploads.
  • —Local CPU inference (Ollama) is noticeably slower than a cloud API — single-digit to tens of seconds per answer; an accepted tradeoff for free, fully local operation.
  • —The OpenAI provider is implemented behind the same interface but not live-verified (account quota during development) — the actually measured, working path is local Ollama.
Next projectLeadFlow

Website

Open case ↗
LeadFlow

NEXT STEP

Have a similar task?

Describe it in your own words — I'll reply with how I'd approach it.

Discuss a project
Copied