Hoppa till innehåll

Vectors and Embeddings

Det här innehållet är inte tillgängligt på ditt språk än.

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.

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?

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.

Near in meaning, near in the index Damage claims and other messages placed by meaning, not by words, in three groups. Damage: the door of the fridge is dented, a big ding on the side, and the panel got bashed in on the stairs. Wrong place: the crew left it at the wrong house, delivered to the neighbor, and it went next door. Change the day, far from both: please move my delivery to Thursday, and can I change my window. The phrases in each group are close together in meaning with almost no words in common. Underneath: near in meaning, near in the index; a picture of the idea, not the mathematics. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.52.0", "built": "2026-10-28", "id": "DGM-DA-BR-50", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.4.0", "theme": "stevetecharc 1.4.0"} DAMAGE WRONG PLACE CHANGE THE DAY "The door of the fridge is dented" a damage claim "A big ding on the side" a damage claim "The panel got bashed in on the stairs" a damage claim "The crew left it at the wrong house" a care case "Delivered to the neighbor" a care case "It went next door" a text to the tracking page "Please move my delivery to Thursday" a reschedule request "Can I change my window?" a reschedule request Near in meaning, near in the index. A picture of the idea, not the mathematics. HOW TO READ IT close together in meaning, almost no words in common © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

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.

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.

The route to the data, and back to the source The route to the data and back to the source, on Steve Trucking's install guide. The source, highlighted: the install guide, a hundred pages, version 2026-09, classified Internal. It's split into chunks, such as the dishwasher drain-line steps, about 400 words, which carries the guide, its version and section. Each chunk is embedded as a vector, a long list of numbers standing for its meaning, in the vector index. A crew member's question, how do I hook up the drain, is turned into a vector and compared with the index. The closest vector leads back to its chunk, and the answer uses the chunk's actual text, citing the install guide, its version and section. Underneath: the vector finds the chunk; the chunk holds the information; the source gives it authority. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.52.0", "built": "2026-10-28", "id": "DGM-DA-BR-51", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.4.0", "theme": "stevetecharc 1.4.0"} THE SOURCE THE CHUNKS THE VECTOR INDEX THE QUESTION The install guide a hundred pages; version 2026-09; Internal Chunk: dishwasher drain line about 400 words; carries the guide, its version and section Its vector a long list of numbers that stands for the chunk's meaning "How do I hook up the drain?" a crew member's question, turned into a vector The answer the chunk's actual text, citing the install guide, its version and section split embedded compared points back to used, with its source The vector finds the chunk. The chunk holds the information. The source gives it authority. HOW TO READ IT where the authority stays © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

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.

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.

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.

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.

Protect the information along the whole path Delivery notes on their way to an agent's answer, five steps from left to right. The source: delivery notes, classified Confidential, with the gate code kept out of them on its own record. The copies AI makes: the extracted text, which keeps the notes' classification, and the chunks in the index, each carrying its source's access rules. The answer: retrieval, highlighted, returns only the chunks this person may read, and the agent's answer cites the source it came from. Underneath: source, text, chunk, index, retrieval, answer; if the classification drops out at any step, the index becomes a back door. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.52.0", "built": "2026-10-28", "id": "DGM-DA-BR-52", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.4.0", "theme": "stevetecharc 1.4.0"} THE SOURCE THE COPIES AI MAKES THE ANSWER Delivery notes Confidential; the gate code isn't here, it's on its own record Extracted text keeps the notes' classification Chunks in the index each chunk carries its source's access rules Retrieval returns only the chunks this person may read The agent's answer cites the source it came from extracted chunked searched answered Source, text, chunk, index, retrieval, answer: if the classification drops out at any step, the index becomes a back door. HOW TO READ IT the check that keeps the index from becoming a back door © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

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.

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.

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 above the shapes The semantic layer above the shapes, in three layers. At the top, a question in business words, from a person or an agent: what was Redrock's on-time rate last month? It's asked of the semantic layer, highlighted: business meaning made explicit, with definitions, metrics, relationships and terminology, such as completed means the crew tapped Delivered, on time means inside the window the Recipient was given, and Redrock is CUST-00492 in the ERP. The semantic layer maps the question to the data in the representations below: records and analysis (the Work Order, relational, and the delivery fact, dimensional), content and similarity (the manifest as a document and the install guide as vectors), and relationships (the claims network, a graph). Underneath: retrieval helps the agent find the evidence; semantics helps it understand what the evidence means. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.52.0", "built": "2026-10-28", "id": "DGM-DA-BR-53", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "layers 0.1.0", "theme": "stevetecharc 1.4.0"} "What was Redrock's on-time rate last month?" a question in business words, from a person or an agent The semantic layer business meaning, made explicit: definitions, metrics, relationships, terminology completed = the crew tapped Delivered on time = inside the window the Recipient was given Redrock = CUST-00492 in the ERP The representations Records and analysis the Work Order (relational); the delivery fact (dimensional) Content and similarity the manifest (document); the install guide (vectors) Relationships the claims network (graph) asked in business words mapped to the data Retrieval helps the agent find the evidence. Semantics helps it understand what the evidence means. HOW TO READ IT what the business means, above every shape © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

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.

  • 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.