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

# Storage

> Manage knowledge bases and run semantic retrieval with the Python SDK.

Knowledge base APIs live under `client.storage.knowledge_base`. See the [Storage API reference](/api-reference/endpoint/storage/introduction).

## Create a knowledge base

```python theme={null}
from pawa_ai import PawaAI

client = PawaAI()

kb = client.storage.knowledge_base.create(
    name="Pawa Knowledge Base",
    description="Product docs and FAQs for customer support agents.",
)

print(kb)
```

## List, retrieve, update, delete

```python theme={null}
bases = client.storage.knowledge_base.list(page=1, limit=20, search="support")
print(bases)

kb = client.storage.knowledge_base.retrieve(knowledge_base_id=159)
print(kb)

updated = client.storage.knowledge_base.update(
    159,
    name="Support KB",
    description="Updated description for the support knowledge base.",
)
print(updated)

deleted = client.storage.knowledge_base.delete(159)
print(deleted)
```

## List files in a knowledge base

```python theme={null}
files = client.storage.knowledge_base.list_files(knowledge_base_id=159)
print(files)
```

## Semantic retrieval

```python theme={null}
from pawa_ai import PawaAI

client = PawaAI()

results = client.storage.knowledge_base.semantic_retrieval(
    knowledgeBaseId=159,
    query="What is the refund window?",
    topK=5,
)

print(results)
```

Use retrieved chunks in chat via the `rag` parameter — see [Chat](/python-sdk/chat#rag-with-a-knowledge-base).
