Retrieval and knowledge

Grounding a model in your own data: embeddings, search, chunking, RAG.

Sign in to track your progress across sections.

Courses in this topic

Practice in this topic

44 articles

Jina Embeddings

Listed inJina EmbeddingsRetrieval and knowledgeon

A 32,768-token context means the encoder stops dictating your chunk size. Task types move the query-versus-passage distinction into a parameter a reviewer can see, and truncatable vectors have one way to cut them safely.

Guide
Intermediate3 min
#providers

What are Embeddings?

Listed inWhat are Embeddings?Retrieval and knowledgeon

A vector of floating point numbers whose distance from another measures how related two texts are. The same distance reads as search, recommendation, classification or anomaly depending on the question you ask it.

Guide
Beginner3 min
#concepts

Cohere Embed

Listed inCohere EmbedRetrieval and knowledgeon

`input_type` is the parameter you cannot skip: your corpus takes `search_document` and your queries take `search_query`, and getting it backwards ranks worse with no error to tell you. Binary compression takes a 1024-dimension vector to 128 bytes.

Guide
Intermediate4 min
#providers

Embedding Models

Listed inEmbedding ModelsRetrieval and knowledgeon

Vectors from two models are not comparable, so the choice comes with a migration attached from the day you make it. Dimensions, input limits, and the mixed index that fails without erroring.

Guide
Intermediate3 min
#selection

Data Classification

Listed inData ClassificationRetrieval and knowledgeon

Embed once and compare each item to a class centroid, which costs one cheap call where prompting costs an expensive one forever. The distance is also a confidence signal, so you can route the ambiguous cases and say when something fits no class at all.

Guide
Intermediate4 min
#use-cases

Sentence Transformers

Listed inSentence TransformersRetrieval and knowledgeon

Embeddings on your own hardware, which settles the question for data that cannot leave your network. `CrossEncoder` is the class most RAG systems are missing: retrieve widely with a bi-encoder, then rerank the top results with a model that reads query and document together.

Guide
Intermediate4 min
#open-source

Semantic Search

Listed inSemantic SearchRetrieval and knowledgeon

Retrieving by meaning finds the document that shares no words with the query, and loses to keyword search on identifiers, rare terms and quoted phrases. Hybrid search runs both and fuses the results.

Guide
Beginner3 min
#search

Gemini Embedding

Listed inGemini EmbeddingRetrieval and knowledgeon

Embedding 2 dropped the `task_type` parameter, so task specification moved into the prompt where a typo is a silent quality change rather than an error. It also returns one aggregated vector for multiple inputs unless each is wrapped separately.

Guide
Intermediate4 min
#providers

LanceDB

Listed inLanceDBRetrieval and knowledgeon

An embedded retrieval library rather than a server, with multimodal assets beside the vectors. Plus what the project does not actually claim.

Reference
Intermediate4 min
#vector-search

Weaviate

Listed inWeaviateRetrieval and knowledgeon

A search service rather than a vector column or an embedded library. Hybrid search fuses keyword and vector ranking, which recovers the exact identifiers embeddings lose, and the index types include a flat one suited to many small per-tenant datasets.

Reference
Intermediate6 min
#stores

Chroma

Listed inChromaRetrieval and knowledgeon

The persistent client gets a working query with no infrastructure decision, and the collection code survives the move to a server. Concurrency, the directory's lifetime and backups are the bill that arrives with traffic.

Reference
Beginner3 min
#stores

MongoDB Atlas Vector Search

Listed inMongoDB Atlas Vector SearchRetrieval and knowledgeon

`$vectorSearch` runs as the first stage of an aggregation pipeline, so retrieval composes with the joins and grouping that follow it. Exposing both ANN and exhaustive search in one system means you can measure what your recall settings actually return.

Reference
Intermediate4 min
#stores

Indexing Embeddings

Listed inIndexing EmbeddingsRetrieval and knowledgeon

Recall, latency and memory are the three quantities every index decision trades between, and knowing which one you are short of is most of the work. Each family gives you one build-time parameter and one runtime recall dial, `nprobe` for IVF and `efSearch` for HNSW.

Reference
Advanced4 min
#indexing

Qdrant

Listed inQdrantRetrieval and knowledgeon

Filters run during the search rather than after it, which is a correctness feature dressed as an implementation detail. Post-filtering silently returns fewer results than you asked for, and in a multi-tenant system it passes every test until it does not.

Reference
Intermediate4 min
#stores

FAISS

Listed inFAISSRetrieval and knowledgeon

A similarity-search library with no server, no filtering and no persistence you did not write, sitting a layer below the vector databases that use it. Right when you already have the storage and want control over the index, and wrong when you would end up rebuilding a database badly.

Reference
Advanced4 min
#stores

Pinecone

Listed inPineconeRetrieval and knowledgeon

The store where nobody on your team runs anything, and namespaces are the feature to build around. A per-tenant namespace is a hard partition rather than a filter you remembered to apply, which removes a class of leak by construction.

Reference
Beginner4 min
#stores

Text splitters

Listed inLangChainRetrieval and knowledgeon

LangChain's concept doc on the splitter family — what each one optimises for and when to reach for it.

External
LangChain · python.langchain.com
#frameworks
#pipeline

RAGFlow

Listed inRAGFlowRetrieval and knowledgeon

Parse the layout before chunking, because a flat extractor turns a pricing table into numbers with no headers and nothing downstream can repair it.

Guide
Intermediate5 min
#rag
#ingestion

LlamaIndex

Listed inLlamaIndexRetrieval and knowledgeon

Documents and Nodes, and a query stage that separates retrieval, postprocessing and response synthesis. Postprocessing is the step hand-written pipelines usually skip, and it is where reranking and filtering belong.

Guide
Intermediate4 min
#rag
#frameworks

RAG Use Cases

Listed inRAG Use CasesRetrieval and knowledgeon

Four problem shapes retrieval fits and four it does not, why counting questions fail quietly, and how a million-token window moved the threshold.

Guide
Beginner7 min
#use-cases

Retrieval Process

Listed inRetrieval ProcessRetrieval and knowledgeon

Anthropic's evaluation retrieves 150 candidates and reranks to 20. Why the two stages are good at different things, how to choose each number, and the measurement that separates retrieval from generation.

Guide
Intermediate3 min
#pipeline

Embedding Documents

Listed inEmbedding DocumentsRetrieval and knowledgeon

Prepending context to a chunk before embedding it cut Anthropic's top-20 retrieval failure rate from 5.7% to 3.7%. What to store beside the vector, and why ingest has to be safe to run twice.

Guide
Intermediate3 min
#pipeline

Haystack

Listed inHaystackRetrieval and knowledgeon

Pipelines are a declared graph, so branching a query into keyword and vector retrieval and merging the results is something you can draw and inspect. The structure pays at five stages and gets in the way at two.

Guide
Intermediate4 min
#frameworks

RAG vs Fine-tuning

Listed inRAG vs Fine-tuningRetrieval and knowledgeon

Retrieval changes what a model can see and fine-tuning changes how it behaves, which settles less than it sounds. Four questions decide the case, and the production answer is usually both, aimed at different jobs.

Guide
Intermediate4 min
#selection

LangChain

Listed inLangChainRetrieval and knowledgeon

Two things arrive together: a common interface over providers, and a framework for composing calls. The recurring complaint is not that it fails but that it obscures, since finding what actually reached the model takes longer through code that assembled it.

Guide
Intermediate4 min
#frameworks

What is RAG?

Listed inWhat is RAG?Retrieval and knowledgeon

Two pipelines rather than one: indexing when documents arrive, querying per request. Each of the four stages introduces its own failure, and retrieval always returns something even when your corpus cannot answer.

Guide
Beginner3 min
#concepts

Generation

Listed inGenerationRetrieval and knowledgeon

The last stage is where retrieval gets believed. Separating passages from instructions, citations that carry a validity guarantee rather than a plausible ID, and building refusal for the question your corpus cannot answer.

Guide
Intermediate3 min
#pipeline