> ## 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.

# Website KnowledgeBase

## Example

<Note>
  Install `beautifulsoup4` using [this guide](/how-to/install)
</Note>

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

from resources import vector_db

knowledge_base = WebsiteKnowledgeBase(
    urls=["https://docs.phidata.com/introduction"],
    # Number of links to follow from the seed URLs
    max_links=10,
    # Table name: ai.website_documents
    vector_db=PgVector(
        table_name="website_documents",
        db_url=vector_db.get_db_connection_local(),
    ),
)
```

## WebsiteKnowledgeBase Params

| Parameter   | Type                      | Default | Description                                                                                       |
| ----------- | ------------------------- | ------- | ------------------------------------------------------------------------------------------------- |
| `urls`      | `List[str]`               | `[]`    | URLs to read                                                                                      |
| `reader`    | `Optional[WebsiteReader]` | `None`  | A `WebsiteReader` that reads the urls and converts them into `Documents` for the vector database. |
| `max_depth` | `int`                     | `3`     | Maximum depth to crawl.                                                                           |
| `max_links` | `int`                     | `10`    | Number of links to crawl.                                                                         |

## AgentKnowledge Params

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

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