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

# JSON KnowledgeBase

## Example

```python knowledge_base.py theme={null}
from phi.knowledge.json import JSONKnowledgeBase
from phi.vectordb.pgvector import PgVector

from resources import vector_db

knowledge_base = JSONKnowledgeBase(
    path="data/json",
    # Table name: llm.json_documents
    vector_db=PgVector(
        table_name="json_documents",
        db_url=vector_db.get_db_connection_local(),
    ),
)
```

## JSONKnowledgeBase Params

| Parameter | Type               | Default        | Description                                                                              |
| --------- | ------------------ | -------------- | ---------------------------------------------------------------------------------------- |
| `path`    | `Union[str, Path]` | -              | Path to `JSON` files.<br />Can point to a single JSON file or a directory of JSON files. |
| `reader`  | `JSONReader`       | `JSONReader()` | A `JSONReader` that converts the `JSON` files into `Documents` for the vector database.  |

## AgentKnowledge Params

`JSONKnowledgeBase` is a subclass of the `AgentKnowledge` class and has access to the same params

<Snippet file="kb-base-reference.mdx" />
