Skip to content
Glossary

Vector embedding

Graphify glossary

A list of numbers representing the meaning of a piece of text, used to measure similarity — answers 'what looks like this?', not 'what calls this?'

A vector embedding is a list of numbers representing the meaning of a piece of text, produced by a model trained so that similar texts land near each other in the vector space. Comparing two embeddings — usually by cosine similarity — gives you a resemblance score, which is what powers semantic search and the retrieval step of RAG pipelines.

Embeddings answer one question: what looks like this? For prose, that's often the right question. For code, the important questions are different in kind — what calls this function, what reads this table, what breaks if this signature changes. Those are questions about relationships, and resemblance is a poor proxy for relationship: a function and its callers can share almost no vocabulary, while two unrelated functions with similar names embed nearly identically. Nearness in embedding space is a statistical artifact; an edge in a graph is a fact about the code.

This is why Graphify extracts structure instead of embedding it. A calls edge exists because tree-sitter found the call in the AST, not because two chunks landed near each other in a vector space — and it carries a tag saying exactly how it was established. Embeddings and graphs aren't enemies; they answer different questions, and the honest comparison is knowing which question you're asking. For codebase reasoning, the structural question is usually the one that matters.

Related terms

  • RAG (retrieval-augmented generation)A pipeline that chunks documents, embeds them as vectors, and retrieves the most similar chunks at query time — lookup by resemblance, not structure.
  • EdgeA typed, directed relationship between two nodes — calls, imports, defines, references — each carrying a provenance tag.
  • Token reductionThe context-window savings from answering with graph structure instead of pasting whole files into an assistant's context.

Go deeper

← All glossary terms