> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptjuggler.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Knowledge Bases

> Upload documents, wait for indexing, and connect them to your prompts and workflows.

## Create a knowledge base

Click **+** next to **Knowledge Bases** in the sidebar. Your new KB gets a random name – rename it to something meaningful.

## Upload documents

Add documents in any of these formats: `.txt`, `.csv`, `.tsv`, `.md`, `.html`, `.pdf`, `.docx`.

PromptJuggler automatically chunks each document, generates embeddings, and indexes everything for semantic search. Each document shows a status badge that updates in real time – no need to refresh the page. When the status shows ready, that document is searchable.

## Connect to your prompts

Two ways to give your prompts access to a knowledge base:

**As a tool** – attach the [KB Search tool](/tools/knowledge-search) to a prompt. The model decides when to search and what to search for. Best for conversational use cases where context should be pulled in on demand.

**As a workflow node** – add a [KB Search node](/workflow-nodes/knowledge-search) to a workflow. The search happens at a fixed point in the pipeline with a query you wire in. Best for structured pipelines where you always want context at a specific step. Configure the **top K** (how many chunks to return) and the **format** (text or JSON).

## Manage via the API

You can also upload, inspect, and delete documents programmatically through the [API](/api/overview). Use the `knowledgedocument.finished` and `knowledgebase.finished` [webhooks](/guides/integration#webhooks) to know when uploads are ready for search.
