liveBook · Manning

Embedding

As explained in Build a Multi-Agent System (from Scratch)

An embedding is a numerical vector representation of an item that encodes properties or relationships relevant to machine learning.

An embedding is a numerical vector representing an item. For memory recall, episodes and queries are projected into the same embedding space; smaller distances indicate greater similarity. Cosine similarity is one common distance measure. section 7.3.2

QdrantMemoryStore uses embeddings to index stored episodes and retrieve those most similar to a query. Qdrant can supply the embedding model, avoiding a separately managed model-service call. Choosing a model remains a design decision that can be evaluated with benchmarks and system-specific datasets. section 7.3.2 section 7.3

Recalling a similar episode

Store episodes for Hailstone sequences starting at 6 and 8, then query for a sequence starting at 6. Similarity search can return the episode for 6, including its recorded result and step count.

Figure 7.5 Recording an Episode as a point in the embedding space and recalling the most similar Episode objects to a given query

The diagram shows episodes and a query represented in one embedding space, with the closest episodes selected for recall. section 7.3.2

How Build a Multi-Agent System (from Scratch) covers it

How deep it goes
Defines shared-space vectorization and distance-based similarity, then demonstrates Qdrant indexing and retrieval without detailing embedding internals.
Examples
Uses Hailstone episodes and a matching query to demonstrate retrieval by similarity.
What you can do after
Apply embeddings through Qdrant to persist episodes and retrieve the most similar matches for a query.
How it connects
Connects embeddings to episodes, similarity search, vector databases, and retrieval-augmented generation.

Also explained in

Compare how 72 books explain embedding →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Multi-Agent System (from Scratch). The section links point to the parts of the book it draws on.