Cyberpediaby Brain

Embeddings and vector databases

How text becomes coordinates, how a vector database stores them, and what to know before adding a document to one.

On this page
  1. 1In 30 seconds
  2. 2What it is
  3. 3Straight answers
  4. 4How it works
  5. 5What you do
  6. 6Pitfalls
  7. 7Real cases
  8. 8Sources
  9. 9Cite this article

In 30 seconds

Where it happens
In an assistant that answers from indexed documents. Microsoft lists this use, retrieval-augmented generation (RAG), among those of a vector database[2].
What happens
Depending on the configuration, the document is split up, converted into vectors, then stored in an index that is queried by meaning[2].
The reflex
Before adding a document, ask who will be able to get it through the assistant, and treat the indexed version as the document itself.
If it is already done
Tell the assistant's owner or the security team so that the document is removed from the index.

What it is

An embedding is a series of numbers, coordinates, that represents a piece of content. Two pieces of content with similar meaning receive similar coordinates. For words, the idea builds on the work of Tomas Mikolov and his coauthors, submitted on 16 January 2013, which proposes two architectures for computing continuous vector representations of words from very large datasets[1].

A vector database stores these coordinates so that the content closest to a query can be found. Microsoft describes vector search as matching based on the vectors closest to the query vector. It can bring "dog" and "canine" together, two words that are conceptually close but different in form[2].

For an employee, the common case is the assistant connected to company documents. This page explains the principle, then what to know before adding a document to such an assistant.

Straight answers

What is an embedding?

It is a numerical representation of a piece of content. The Skip-gram model, presented by Mikolov and his coauthors, learns word vectors that capture a large number of precise syntactic and semantic relationships[3]. The authors note a limit: these representations ignore word order and cannot represent idiomatic phrases. The meanings of "Canada" and "Air" do not combine easily to give "Air Canada"[3].

BERT, presented in October 2018, learns text representations by taking into account both the left and right context of a word[4]. Sentence-BERT, published in August 2019, derives from it sentence embeddings that are compared by cosine similarity[5].

What is a vector database?

It is a system that stores vectors and finds the ones closest to a query vector. In Azure AI Search, a nearest-neighbor algorithm places similar vectors close to one another in the index, and a query returns the k nearest neighbors[2]. The service can serve as a pure vector index, as long-term memory, as a knowledge base, or as grounding data for a RAG architecture[2].

Can the original text be recovered from an embedding?

As a precaution, the indexed version of a document is treated like the document.

A related risk is known for language models. In December 2020, Nicholas Carlini and his coauthors show that an adversary can recover training examples by querying a language model[6]. The authors find that larger models are more vulnerable than smaller ones[6].

Do access rights follow the documents?

Microsoft presents Foundry IQ as a knowledge layer that turns enterprise content into "permission-aware knowledge bases" for agents[2]. The same page describes filtered queries: a filter applies to text or numeric fields, is used for metadata filters, and makes it possible to include or exclude results[2]. Whether the rights of an original document follow its indexed passages remains open: the question goes to the assistant's owner before any document is added.

Can booby-trapped content, once indexed, influence the answers?

In a RAG architecture, the model combines its own memory with an external memory[7]. The authors of the original RAG use a dense vector index of Wikipedia, queried by a neural retriever[7]. One of their formulations conditions the whole answer on the same retrieved passages[7]. What is indexed therefore becomes part of what the model reads in order to answer.

For the risks of applications built on language models, the OWASP project maintains a list of the "most critical security vulnerabilities in LLM applications", of which a 2025 version is mentioned[8].

How it works

The chain has three steps: making the vectors, storing them, then querying them.

Making the vectors

An embedding model turns text into a vector. The name BERT comes from an architecture, the Transformer: Bidirectional Encoder Representations from Transformers[4]. This architecture, proposed in June 2017, relies solely on attention mechanisms[9].

The advantage of Sentence-BERT is speed. With BERT alone, finding the most similar pair among 10,000 sentences requires about 50 million inference computations, or about 65 hours. With Sentence-BERT, the effort drops to about 5 seconds, with accuracy maintained[5].

Storing the vectors

Azure AI Search describes two routes. In internal processing, the service splits documents into chunks and vectorizes them in an indexer pipeline. The customer provides the resources, such as the endpoints and connection details of Azure OpenAI[2]. In external processing, the embeddings are produced outside the service, then pushed into the vector fields of the index[2].

Querying

An encoding step can turn the user's query into a vector before it is sent to the index[2]. Hybrid search runs vector search and keyword search in parallel, and merges the results into a single response. Microsoft writes that it often gives better results than either one alone[2].

What you do

Before adding a document to an assistant or an index:

  • Ask who can query the assistant and whether the rights of the original document are applied to the answers.
  • Check where the texts go. In an integrated configuration, the service calls an embedding model, for example the one from Azure OpenAI[2].
  • Consider that the indexed copy has the same sensitivity as the original, as long as no one has established otherwise.
  • Do not add a document whose origin you do not know. In a RAG architecture, retrieved passages condition the answer[7].
  • If the document has already been added by mistake, report it right away to the person who administers the assistant.

Pitfalls

  • Search by meaning brings together content with similar meaning, not only content that contains the same words. Microsoft cites the match between "dog" and "canine", between two languages, or between a text and an image[2].
  • An embedding can be multimodal: text and images can share the same search space[2].
  • A vector database is a search engine. Azure AI Search offers metadata filters and underpins Foundry IQ[2]; check who can query it.
  • Reference frameworks evolve. NIST describes its AI RMF as intended for voluntary use, released on 26 January 2023 and under revision. A profile devoted to generative AI, NIST-AI-600-1, was released on 26 July 2024[10].

Real cases

Extraction of GPT-2 training data, December 2020

Carlini and his coauthors attack GPT-2, a model trained on public Internet pages. They extract hundreds of verbatim text sequences from it: public personal information (names, phone numbers, email addresses), IRC conversations, code, and 128-bit UUIDs[6]. The attack works even when each sequence appears in only one training document[6]. This case concerns a language model, not a vector database.

Sources

  1. arXiv, “Efficient Estimation of Word Representations in Vector Space”, 16 January 2013. https://arxiv.org/abs/1301.3781 (accessed 10 November 2026)
  2. Microsoft, “Vector Search Overview - Azure AI Search”. https://learn.microsoft.com/en-us/azure/search/vector-search-overview (accessed 10 November 2026)
  3. arXiv, “Distributed Representations of Words and Phrases and their Compositionality”, 16 October 2013. https://arxiv.org/abs/1310.4546 (accessed 10 November 2026)
  4. arXiv, “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding”, 11 October 2018. https://arxiv.org/abs/1810.04805 (accessed 10 November 2026)
  5. arXiv, “Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks”, 27 August 2019. https://arxiv.org/abs/1908.10084 (accessed 10 November 2026)
  6. arXiv, “Extracting Training Data from Large Language Models”, 14 December 2020. https://arxiv.org/abs/2012.07805 (accessed 10 November 2026)
  7. arXiv, “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”, 22 May 2020. https://arxiv.org/abs/2005.11401 (accessed 10 November 2026)
  8. OWASP, “OWASP Top 10 for Large Language Model Applications | OWASP Foundation”. https://owasp.org/projects/top-10-for-large-language-model-applications (accessed 10 November 2026)
  9. arXiv, “Attention Is All You Need”, 12 June 2017. https://arxiv.org/abs/1706.03762 (accessed 10 November 2026)
  10. NIST, “AI Risk Management Framework”. https://www.nist.gov/itl/ai-risk-management-framework (accessed 10 November 2026)