> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Website Knowledge

> Ingest web pages and PDFs into a PgVector knowledge base with WebsiteTools.

`WebsiteTools(knowledge=kb)` lets the agent add pages to the same PgVector-backed knowledge base it searches.

```python website_tools_knowledge.py theme={null}
"""
Website Tools Knowledge
=============================

Demonstrates website tools knowledge.
"""

from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.tools.website import WebsiteTools
from agno.vectordb.pgvector import PgVector

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------


db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"

# Create PDF URL knowledge base
kb = Knowledge(
    vector_db=PgVector(
        table_name="documents",
        db_url=db_url,
    ),
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    kb.insert_many(
        urls=[
            "https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf",
            "https://docs.agno.com/introduction",
        ]
    )

    # Initialize the Agent with the combined knowledge base
    agent = Agent(
        knowledge=kb,
        search_knowledge=True,
        tools=[
            WebsiteTools(knowledge=kb)  # Set combined or website knowledge base
        ],
    )

    # Use the agent
    agent.print_response(
        "How do I get started on Mistral: https://docs.mistral.ai/getting-started/models/models_overview",
        markdown=True,
        stream=True,
    )
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno "psycopg[binary]" beautifulsoup4 openai pgvector pypdf sqlalchemy
```

**2. Export your OpenAI API key**

```bash Mac/Linux theme={null}
export OPENAI_API_KEY="your_openai_api_key_here"
```

```bash Windows theme={null}
$Env:OPENAI_API_KEY="your_openai_api_key_here"
```

<Snippet file="run-pgvector-step.mdx" />

**3. Run the example**

Save the code above as `website_tools_knowledge.py`, then run:

```bash theme={null}
python website_tools_knowledge.py
```

Full source: [cookbook/91\_tools/website\_tools\_knowledge.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/91_tools/website_tools_knowledge.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.