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

# Knowledge Quick Start

> Get started with knowledge-based agents in 5 minutes

# Knowledge Quick Start

Give your agent access to documents and get answers with citations.

## Installation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install "praisonaiagents[knowledge]"
```

## 1. Simplest Usage (Default)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

agent = Agent(
    name="Research Assistant",
    knowledge=["research.pdf"]  # Just pass files
)

response = agent.start("What are the key findings?")
```

<Note>
  **Where is my data stored?** By default, the Chroma store persists at `<project>/.praisonai/knowledge/chroma` (absolute, per project). Override it with `knowledge={"vector_store": {"config": {"path": "..."}}}`. See [Knowledge Storage](/docs/features/knowledge-storage).
</Note>

## 2. Multiple Sources (Array)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

agent = Agent(
    name="Research Assistant",
    knowledge=[
        "paper.pdf",
        "notes.txt", 
        "docs/",           # Entire directory
    ]
)

response = agent.start("Summarize all documents")
```

<Note>
  **`Knowledge.add(url)` — supported.** As of PraisonAI PR [#4334](https://github.com/MervinPraison/PraisonAI/pull/4334) (2026-08-25) the standalone `Knowledge.add()` fetches and ingests remote URLs via MarkItDown — the same pipeline used for local files.

  ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonaiagents import Knowledge

  kb = Knowledge(config={"vector_store": {"provider": "chroma"}})
  kb.add("https://example.com/article", user_id="user123")
  ```
</Note>

<Note>
  **`Agent(knowledge=[url])` — still skipped.** URL sources passed directly to `Agent(knowledge=[...])` are **not yet supported** in the core SDK. Since PraisonAI PR [#4004](https://github.com/MervinPraison/PraisonAI/pull/4004) any `http://` or `https://` entry is logged with a warning (`scheme://hostname` only, so tokens never leak) and skipped. This Agent-side code path lives in `agent.py` and is not touched by #4334. To ingest a URL through an agent, build a shared `Knowledge` instance, call `kb.add(url)`, then pass `knowledge=kb`:

  ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonaiagents import Agent, Knowledge

  kb = Knowledge(config={"vector_store": {"provider": "chroma"}})
  kb.add("https://example.com/article")

  agent = Agent(name="Reader", instructions="Summarise the article.", knowledge=kb)
  ```
</Note>

## 3. Custom Configuration (Dict)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

agent = Agent(
    name="Research Assistant",
    knowledge={
        "sources": ["research.pdf", "data/"],
        "chunker": {
            "type": "semantic",      # Better topic boundaries
            "chunk_size": 512
        },
        "vector_store": {
            "provider": "chroma",
            "config": {"collection_name": "my_research"}
        }
    }
)

response = agent.start("What methodology was used?")
```

## 4. With Retrieval Options

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

agent = Agent(
    name="Research Assistant",
    knowledge={
        "sources": ["research.pdf"],
        "retrieval_k": 5,            # Number of chunks
        "rerank": True               # Better relevance
    }
)

result = agent.query("What are the conclusions?")
print(result.answer)
print(result.citations)
```

## 5. Shared Knowledge (Instance)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent, Knowledge

# Create shared knowledge base
kb = Knowledge(config={
    "vector_store": {"provider": "chroma"}
})
kb.add("company_docs/")

# Multiple agents share same knowledge
analyst = Agent(name="Analyst", knowledge=kb)
writer = Agent(name="Writer", knowledge=kb)
```

## Supported File Types

`Agent(knowledge=[...])` accepts local files, directories, and raw text. `Knowledge.add(...)` additionally accepts remote URLs.

| Input                                    |  Accepted by `Agent(knowledge=[...])`  |       Accepted by `Knowledge.add(...)`      |
| ---------------------------------------- | :------------------------------------: | :-----------------------------------------: |
| Documents (PDF, DOC, DOCX, TXT, MD, RTF) |                   Yes                  |                     Yes                     |
| Data (CSV, JSON, XML, Excel)             |                   Yes                  |                     Yes                     |
| Directories                              |    Yes — every supported file inside   |                     Yes                     |
| Raw text strings                         |          Yes — stored directly         |                     Yes                     |
| Local HTML files (`.html`, `.htm`)       |                   Yes                  |                     Yes                     |
| Remote URLs (`http://`, `https://`)      | **No** — warned and skipped (PR #4004) | **Yes** — fetched via MarkItDown (PR #4334) |

## Next Steps

<CardGroup cols={2}>
  <Card title="Storage Options" icon="database" href="/docs/knowledge/storage">
    Configure vector stores
  </Card>

  <Card title="Chat with PDFs" icon="file-pdf" href="/docs/knowledge/chat-with-pdf">
    Build a PDF chat agent
  </Card>

  <Card title="Chunking Strategies" icon="scissors" href="/docs/rag/strategies/overview">
    Optimize document splitting
  </Card>

  <Card title="RAG" icon="magnifying-glass" href="/docs/rag/overview">
    Advanced retrieval
  </Card>
</CardGroup>
