AI Systems
Retrieval-augmented generation: permissions before similarity
General knowledge, your specifics
Language models know a lot in general and nothing about your business in particular. Retrieval-augmented generation gives a model the relevant passages from your own approved sources when it answers, so responses reflect your policies, documents and records, with citations a person can check.
Most of the quality is decided before the model writes a word: how documents were split, what each passage records about itself, and whether the reader was allowed to see it. A semantically perfect passage from someone else's private source is still the wrong answer.
Chunk by structure, not by size
Pricing policy v6 · §4 After-hours pricing
Split every 500 characters
chunk 1
§4 After-hours pricing
Work started after 18:00 or on Sundays is charged at after-hours rates. Members keep their discount.
ServiceStandardAfter 18:00
chunk 2
Call-out$89$149
Hourly labour$130$165
chunk 3
Members' call-out$69$99
Retrieved alone, this row has no heading and no column names.
Split by structure
chunk 1 · §4 · text · v6 · all staff
§4 After-hours pricing
Work started after 18:00 or on Sundays is charged at after-hours rates. Members keep their discount.
chunk 2 · §4 · table · v6 · all staff
§4 After-hours pricing › rates
ServiceStandardAfter 18:00
Call-out$89$149
Hourly labour$130$165
Members' call-out$69$99
Two pipelines, one index
Ingestion · when sources change
- 01
Sources
documents, wikis, tickets
- 02
Extract
text, headings, tables
- 03
Chunk
by structure
- 04
Tag
source, version, access
- 05
Embed
meaning as vectors
Index
passages + metadata
Answering · every question
- 01
Question
plain language
- 02
Filter
by permission, first
- 03
Retrieve
closest passages
- 04
Rerank
when tests show it helps
- 05
Assemble
passages + instructions
- 06
Answer
with citations
What every passage carries
Source and position
Where it came from
The document, section and place in it, so a citation lands on the right paragraph.
Type
What kind of content
Policy, procedure, table, ticket. A procedure answers “how”; a policy answers “may I”.
Version
Which edition
So the current policy outranks last year's, and superseded passages can be excluded.
Access scope
Who may see it
Mapped from the source's own permissions and applied before ranking.
What retrieval hands off
In
Out
Worth building when the answers are in documents
Good fit
- The answers live in a body of documents that changes over time.
- There's too much to read or paste in full.
- People need to check where an answer came from.
Not the right fit
- The answer is a calculation over structured data, such as orders or account balances. A query does that better.
- The sources are unreliable. Retrieval will faithfully surface bad content.
Questions about retrieval-augmented generation
Is our data used to train the model?
RAG doesn't train anything. Passages are sent to the model as context when a question is asked. Whether a provider may keep or train on inputs depends on its terms and your agreement, and we choose and configure providers with that in mind.
What happens when two documents disagree?
Retrieval may surface both. Version and status on each passage let the system prefer the current one, and conflicts are flagged to the document's owner to resolve at the source.
Do we need a vector database?
Usually not a separate one. PostgreSQL with pgvector handles most business knowledge bases next to your other data. A dedicated store such as Qdrant comes in when scale or advanced hybrid retrieval justifies it.
How do you know it finds the right passages?
We test retrieval on its own, with real questions and the passages that should answer them, before judging the written answers. A good answer from the wrong passage is luck.