Skip to main content

Overview

When multiple KnowledgeBase instances share the same vector database collection, isolate_search controls whether queries are scoped to only the documents belonging to that KnowledgeBase or whether they can return results from any document in the collection.

How It Works

When isolate_search=True:
  1. During indexing — every chunk is tagged with the KnowledgeBase’s unique knowledge_id in the vector database metadata
  2. During search — a knowledge_base_id filter is automatically injected into every query, so only chunks belonging to this KnowledgeBase are returned
When isolate_search=False, chunks are stored without a knowledge_base_id tag, and no filter is applied at query time.

Example: Two Isolated KnowledgeBases

Two KnowledgeBases share the same Chroma collection but return only their own documents:
With isolate_search=True, querying the HR KnowledgeBase about deployment will never return engineering docs, and vice versa — even though they share the same underlying collection.

Example: Shared Search Across KnowledgeBases

Set isolate_search=False to allow queries to match documents from any KnowledgeBase in the collection:

When to Use Each Mode