liveBook · Manning

Vector database

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

A vector database stores and indexes vector embeddings to support similarity-based retrieval.

A vector database stores and indexes embeddings so records can be retrieved by semantic similarity. In episodic memory, it supports recalling past task episodes relevant to a current query. section 7.1.2 section 7.3.2

A similarity-search workflow:

  • Represent each episode and the query as embeddings in the same space. section 7.3.2
  • Index episodes in the database, then retrieve those closest to the query; cosine similarity is one distance measure. section 7.3.2
  • With QdrantMemoryStore, write() embeds and persists an episode; search retrieves up to max_results similar episodes. section 7.3.2

Recall a related episode

A query for “Hailstone sequence starting from 6” retrieves the stored episode for computing the sequence for 6. section 7.3.2

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

Shows an episode and query represented in embedding space, with similar episodes retrieved for the query. section 7.3.2

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

How deep it goes
Trace embedding, indexing, persistence, and similarity retrieval through a QdrantMemoryStore implementation.
Examples
Use a Hailstone-sequence query to retrieve a stored episode about computing the sequence for 6.
What you can do after
Apply it via QdrantMemoryStore to embed and persist episodes, then retrieve similar episodes for a query.
How it connects
Connect episodic memory with embeddings, semantic search, and retrieval-augmented generation.

Also explained in

Compare how 34 books explain vector database →

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.