Skip to main content

AI how-to guides Knowledge and documents

How to manage company documents with RAG

Short answer

Retrieval-augmented generation (RAG) indexes your documents so an AI model first finds the relevant passages and then answers or extracts data from them, citing where each answer came from. People own the sources, the permissions and the review of low-confidence results. Start with one document type and one question set, measure accuracy, then add more.

Updated: · Thinkia

What AI does

  • Reads PDFs, Word files, scans and emails and splits them into searchable passages with their metadata.
  • Finds the passages relevant to a question or a task, respecting who is allowed to see each document.
  • Answers questions or fills structured fields from those passages, citing the source document and section.
  • Classifies documents and routes them to the right workflow or system.
  • Flags inconsistencies between documents and low-confidence results for a person to check.

What stays with people

  • Deciding which documents are the source of truth and keeping them current.
  • Reviewing answers and extractions the system marks as uncertain.
  • Owning access rules: who can query which documents.

How to put it in place

  1. Choose one document set and the questions it must answer

    Pick a set with real demand, such as procedures, contracts or supplier files. List the questions people ask about it or the fields a process needs, and gather a representative sample, including messy scans and old versions.

  2. Clean up the sources and the permissions

    Remove duplicates and outdated versions, or mark which one is valid. Map who can see each document today, because the RAG system must apply the same rules when it retrieves.

  3. Index the documents with structure and metadata

    Split documents into passages that keep their headings, tables and context, and store them with metadata such as type, date, owner and version. Combine semantic and keyword search so exact terms like references and codes are not lost.

  4. Build a test set and agree accuracy thresholds

    Write down real questions and expected answers, or expected values per field, and measure retrieval and answers against them. Agree with the business what accuracy is acceptable for each use before anyone relies on it.

  5. Put it in the workflow with a review queue

    Connect answers and extracted data to the tools people already use, with the source cited. Send low-confidence results to a review queue and use the corrections to improve the index and instructions.

  6. Monitor and expand in waves

    Track unanswered questions, corrections and outdated sources. Add new document types one at a time, re-testing each before it goes live.

What you need

  • Access to the document repositories (SharePoint, file shares, document management) through their APIs.
  • A representative sample of documents and real questions to test against.
  • The existing permission model, so retrieval respects it.
  • A business owner per document set who decides what is valid and reviews exceptions.
  • A place for the output: the chat, intranet, ERP, CRM or case tool where people work.

When it is not worth it

  • Few documents that a handful of people already know well.
  • Document sets that nobody maintains: RAG will faithfully repeat outdated content.
  • Questions that really need live system data rather than documents: connect the system instead.

Risks and how to control them

  • Invented answers: require citations, answer only from retrieved passages and say "not found" when there is no support.
  • Data leaks across permissions: filter retrieval by the user's access rights, never only in the interface.
  • Outdated or contradictory documents: keep versions and owners in the metadata and remove what is no longer valid.
  • Instructions hidden in documents (indirect prompt injection): treat document content as data and limit what the system can do with it.
  • Poor scans and complex layouts: test with real files and route low-quality documents to review.

How Thinkia does it

We start from a representative sample of your documents and fields, so extraction targets the real variety and not a demo. Accuracy thresholds per field are agreed with you, and human review loops close the gaps before scaling; low-confidence results go to a review queue with context instead of being discarded.

Structured outputs reach your ERP, CRM or case tools with lineage and error handling, and every extraction, classification and routing decision is logged. We expand document types in waves, with monitoring and exception handling owned by your teams.

The Thinkia solution behind this guide

Thinkia products involved

Frequently asked questions

What is RAG in simple terms?

It is a way of making an AI model answer from your documents. The system first retrieves the passages relevant to the question and then the model writes the answer using only those passages, citing where they came from.

Is RAG better than fine-tuning for company documents?

For documents that change and must be cited, usually yes. RAG reads the current version every time and shows its source; fine-tuning bakes knowledge into the model and is better suited to teaching a style or a task.

Does RAG respect document permissions?

Only if you design it to. The retrieval step has to filter by the user's access rights, using the same permissions as the source repository, so nobody gets answers from documents they cannot open.

Can RAG read scanned PDFs and tables?

Yes, with text recognition and layout-aware processing, but quality depends on the scans. Test with your real files and send poor-quality documents to human review.

How do you know the answers are right?

With a test set of real questions and expected answers, measured before go-live and after every change. In use, citations let people check the source and the review queue catches uncertain results.

Related guides

Related decisions

Key terms

Thinkia articles

Sources

Want to do this in your organisation? Let's talk.

Talk to an AI Expert