Vectors and Embeddings
Dette indhold er ikke tilgængeligt i dit sprog endnu.
The question this module answers: What are vectors and embeddings, and how do they change the way we prepare data to be found by meaning?
This chapter has added shapes one at a time: tables for transactions, documents and key-value stores, time-ordered readings, structured and unstructured content, facts and dimensions for analysis. Each time, the shape came from what are you going to do with the data? This module adds one more answer: find it by meaning. Not because it contains the same words, but because it means something similar.
Search Has Always Been About Words
Section titled “Search Has Always Been About Words”Steve Trucking’s care team gets damage claims written by people in their own words: “the door of the fridge is dented,” “there’s a big ding on the side,” “the panel got bashed in on the stairs.” Three claims, nearly the same damage, almost no words in common. A keyword search for “dent” finds one of them.
We can patch that with synonyms (dent, ding, bashed), and keyword search gets a lot better that way. But language is bigger than any synonym list. “The crew left it at the wrong house,” “delivered to the neighbor,” “it went next door”: the same meaning again, different words. What if search could work on the meaning itself?
Meaning as Numbers
Section titled “Meaning as Numbers”That’s what an embedding does. An embedding model takes a piece of content, usually text, and turns it into a long list of numbers: a vector. Real ones have hundreds or thousands of numbers. You don’t read them, and you don’t need the mathematics. What you need is the idea: content with similar meaning gets vectors that sit close together, and content with different meaning lands far apart.
So “the door is dented” and “a big ding on the side” end up near each other, and both end up far from “please move my delivery to Thursday.” Now a search can ask: what’s closest in meaning to this question? That’s semantic search.
The Vector Is the Route, Not the Data
Section titled “The Vector Is the Route, Not the Data”Here’s the one sentence I want you to keep from this module: vectors can be the route to the data, but not the data itself.
A vector helps you find the right piece of content. It isn’t the content. When a search says “this passage is close to the question,” I still want the passage itself: its words, which document it came from, which version, whether it’s still current, and how it’s classified. The vector got me there. The source is what I use, and what I trust or don’t.
From Document to Chunks to Vectors
Section titled “From Document to Chunks to Vectors”Make it concrete. Steve Trucking’s crews carry an install guide, a hundred pages: dishwashers, washers and dryers, wall-mounted TVs, haul-aways, stairs, safety. One vector for the whole guide would mean “appliances, roughly.” Not much use.
So the guide is split into chunks: the dishwasher drain-line steps in one, the TV wall-mount steps in another, the stair-carry procedure in a third. Each chunk gets its own vector. When a crew member asks “how do I hook up the drain on this dishwasher?”, the question becomes a vector too, and the closest chunk is the drain-line section. The agent answers from that chunk’s actual text, and cites the guide.
How big should a chunk be? Salesforce’s own starting point is to “Chunk knowledge articles, product docs, case history into semantically meaningful 250-750 word segments,” and then to “Validate chunk size against agent query patterns,” balancing “precision (smaller chunks) versus context completeness (larger chunks)” (Salesforce Well-Architected, Resource and Cost Optimization - Agentic Patterns (opens in a new tab), checked 2026-11-28). Treat that range as where you start, then measure with real questions. A chunk that splits the drain-line steps in half helps nobody.
Keep three roles straight: the vector finds the chunk; the chunk holds the information; the source document gives it authority.
Three Ways to Ask
Section titled “Three Ways to Ask”Chapter 8 taught us that every query has an access pattern. Vectors add a third kind of question:
- Structured: “every delayed delivery at the Dallas DC today.” Fields and filters. No embedding needed.
- Keyword: “claims mentioning REDROCK-8472914-1.” An exact string.
- Semantic: “claims like this one.” Meaning.
Don’t turn every question into vector search because AI is involved. What are you going to do with the data? Choose the retrieval that matches the question.
And sometimes exact words matter enormously: model numbers, error codes, tracking numbers, partner keys. Steve Trucking delivers a washer WASHER-27-W and a nearly identical WASHER-27-G with a different drain fitting. In meaning, their install sections are almost the same. In practice, the difference is a leak. That’s why retrieval systems often combine semantic and keyword search, called hybrid search: exact where exactness matters, meaning where meaning matters. Vector search doesn’t replace search. It adds a way to find things.
One Source, One More Representation
Section titled “One Source, One More Representation”Count the shapes of that install guide: the published PDF, its extracted text, its chunks, the metadata about each chunk, the vectors, and maybe a usage report of which sections crews ask about. Which one is the real guide? The wrong question, as always in this chapter. The PDF is the authoritative published document. The others each have a job. One source can legitimately have many representations. The difference with AI is that these copies are made automatically, and at a scale no person would.
Keep the Route Back to the Source
Section titled “Keep the Route Back to the Source”If the vector is the route to the data, the route back has to be kept. Suppose the agent tells a crew: “photograph a damaged TV before you remove it from the home.” Where did that come from? The current install guide? Last year’s version? A case comment? A draft? Something another AI wrote? Those aren’t equal sources, and the vector can’t tell you which it was. The architecture around it has to.
So every chunk carries enough to get back: the source, the document, the version, the section, its classification, its effective date, its owner, when it was indexed. Similarity tells you something may be relevant. Provenance tells you whether to trust it.
When the Source Changes, the Vectors Go Stale
Section titled “When the Source Changes, the Vectors Go Stale”Now the guide is updated: the TV procedure changes. What happens to the old chunks and their vectors? If they’re still in the index, the agent can still find them, and give crews last year’s instructions. That’s stale replicated data, in a new form: the source changed, the copy didn’t.
So vector architecture isn’t just “create embeddings.” It’s a lifecycle, tied to the source. When is content indexed? When is it re-indexed? What happens when it changes, when it’s deleted, when it expires, when who-may-see-it changes? The vector is derived data. Its life has to follow its source.
Security Doesn’t Stop at the Vector Index
Section titled “Security Doesn’t Stop at the Vector Index”This brings us straight back to chapter 12. Two examples at Steve Trucking.
First: suppose someone decides the delivery notes would make a helpful search index, so the agents can find “deliveries like this one.” The notes say things like “side gate, code 4417, dog in the yard.” Chunk and embed them, and the gate code is now inside the index. Chapter 12 put the gate code on its own temporary record, shared with one crew for one day. An index built from the notes just undid that.
Second: a confidential complaint about a crew sits with HR, readable only by a few people. It gets indexed with everything else. A care agent asks the assistant, “has anyone complained about crew 12?” The search does exactly what it was built to do: it finds something very relevant. The retrieval worked. The architecture failed.
That’s what I mean when I say AI will scour the data looking to respond, and it will find the edges of what it has access to. Turning content into vectors doesn’t remove its classification. Splitting it into chunks doesn’t. Moving it to another index doesn’t. If a person couldn’t read the source, semantic search mustn’t become a back door to it.
And don’t let “zero retention” lull you. Salesforce is precise about what it covers: “Zero-data retention means data sent to the model isn’t retained by the model provider after inference completes,” while “Data in Salesforce records, vector stores, and Data 360 remains subject to your retention, access control” and “encryption decisions” (Salesforce Well-Architected, Trust for the Agentic Enterprise (opens in a new tab), checked 2026-11-28). The model provider forgets. Your vector index doesn’t, unless you design it to.
Chunking Can Make Security Harder
Section titled “Chunking Can Make Security Harder”One more subtlety. A long document can hold sections of different sensitivity: most of an operations manual is Internal, one section on how depots are secured at night is Restricted. Chunk it all the same way and those chunks need different treatment. Or the source system grants access by folder or by document, while the index stores chunks. How do those permissions follow each chunk?
You don’t secure AI by putting a login in front of the chat window. You protect the information along the whole path: source, extracted text, chunk, index, retrieval, response. If access control drops out at any step, the agent can show what the original system protected correctly.
Similar Doesn’t Mean Correct
Section titled “Similar Doesn’t Mean Correct”Vector search finds similarity, and similarity isn’t truth. The closest chunk is just the closest thing in the index. The WASHER-27-G question can retrieve the WASHER-27-W instructions: very similar, and wrong. A person might catch the one-letter difference; an agent may answer with confidence unless the design gives it the exact identifier, the metadata and the instruction to check. Retrieval quality, source quality and exact identifiers all matter. Similarity is a strong signal for finding things. Don’t mistake it for authority.
Vectors Don’t Replace the Data Model
Section titled “Vectors Don’t Replace the Data Model”None of this turns the enterprise into vectors. “Which Work Orders belong to Redrock?” is a relationship. “Which deliveries are scheduled today?” is a structured query. “What share of deliveries were late last quarter?” is analysis. “Which install steps match what the crew is describing?” is where semantic search earns its place. Different questions, different shapes: the theme of this whole chapter.
AI Architecture Still Starts With Data Architecture
Section titled “AI Architecture Still Starts With Data Architecture”It’s tempting to treat embeddings and vector indexes as a separate AI specialty. They do bring new technology. But look at the questions we asked: where did this come from, who owns it, what does it mean, how is it identified, who may see it, how current is it, what happens when it changes, can it be trusted? Those are data architect questions. AI didn’t replace them. It made them more visible, and it raised the cost of getting them wrong, because an agent retrieves and combines at a scale no person ever would.
From Representation to Meaning
Section titled “From Representation to Meaning”We’ve built a full set of shapes now. Relational models for transactions. Dimensional models for analysis. Documents for content kept whole. Vectors for similarity of meaning. Graphs for relationships you walk. One idea remains before we leave the chapter: the semantic layer.
A semantic layer isn’t another database family. It sits above the shapes and makes business meaning explicit. Three systems have fields called Customer, Account and SoldToParty: are they the same business concept? Two reports both show Revenue: do they calculate it the same way? A relationship says one company is connected to another: as its parent, its supplier, its distributor? Someone who has worked at the company for ten years knows. An agent doesn’t get that knowledge for free. The architecture has to make it explicit: governed definitions, shared metrics and dimensions, relationships between business concepts, classifications, synonyms, the rules that map each concept to the physical data, and in more advanced designs, ontologies and knowledge graphs.
The semantic layer doesn’t replace any of the shapes beneath it. A graph doesn’t replace a dimensional model. A vector doesn’t replace a document. One company may use them all. Seen as a journey, this chapter went from records, to analysis, to content, to similarity, to relationships, to meaning, and AI raises the importance of that last step. An agent can retrieve exactly the right record and still misread the business concept. Retrieval helps the agent find the evidence. Semantics helps it understand what the evidence means.
Chapter 15 applies this to Salesforce and Data 360, and chapter 16 takes retrieval into how agents are grounded in enterprise data.
What an Architect Decides Here
Section titled “What an Architect Decides Here”- Whether a question needs semantic search at all, or fields, relationships and analysis.
- What content is chunked and embedded, how, and with what metadata on every chunk.
- How each vector keeps its route back to the source, the version and the owner.
- How changes, deletions and expiry in the source reach the index.
- How classification and access follow content through extraction, chunking, indexing and retrieval, and what never gets indexed.
- Where exact matching must join semantic search, for identifiers and codes.
- How retrieval quality is measured, separately from whether the answer is true.
Beyond the exam: vectors let an agent find what people describe in their own words, and that’s genuinely new. But the vector isn’t the truth, the document or the business record. It’s the route to the data, and the architect still has to know where that route leads, who may travel it, and when it closes.
Explore
Section titled “Explore”- Modules 1 to 4 of this chapter; chapter 8, Search Is Not Query; chapter 12, Treat an Agent Like a Curious Human.
- Salesforce Well-Architected: Resource and Cost Optimization - Agentic Patterns (opens in a new tab) and Trust for the Agentic Enterprise (opens in a new tab), checked 2026-11-28.
