> For the complete documentation index, see [llms.txt](https://docs.karini.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.karini.ai/prompt-management/dynamic-knowledge-base.md).

# Dynamic Knowledge Base

**Dynamic Knowledge Base (Dynamic KB)** allows a workflow to determine which knowledge base sources should be used during execution rather than relying on sources fixed during workflow design.

At runtime, the workflow can attach, switch, or filter knowledge base sources based on contextual information such as the user’s intent, session metadata or outputs from previous workflow nodes. Before retrieval is performed, Dynamic KB evaluates the configured selection logic and resolves the most relevant knowledge base or a specific subset of indexed content.

This capability enables a single workflow to support multiple domains, customers, or use cases without requiring duplicate retrieval or agent node configurations. Dynamic KB works with existing retrieval and agent nodes and preserves core capabilities such as vector search, reranking, and guardrails, while adding runtime control over the retrieval scope for each request.

Use the following sample prompt to configure Dynamic KB behavior:

```
If the input you receive is "HR_RECRUITMENT", query Resume dataset with dataset_id = 68a85f10582e3b34ff808b64 and Candidate Response dataset with dataset_id = 68a85bd9582e3b34ff804c47.

If the input you receive is "CUSTOMER_SUPPORT", query Product Documentation dataset with dataset_id = 69843c0b95631e5ad1a5aa9c and Support Response dataset with dataset_id = 6984410195631e5ad1a5b79b.

Run this: Query format: "Find detailed experience and certifications for Emily Carter" for Resumes.

Your output should be the query response.
```
