> ## 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 Source Types

> What Agent(knowledge=...) accepts today — file paths, plain text, and why URLs are skipped

`Agent(knowledge=...)` accepts local file paths and plain text — URLs are not ingested and are skipped with a warning.

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

agent = Agent(
    name="Reader",
    instructions="Answer from the provided notes.",
    knowledge=["notes.pdf", "Key fact: launch is in March."],
)
agent.start("When is the launch?")
```

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "Agent(knowledge=[...])"
        File[📄 File path] --> Add[Knowledge.add path]
        Text[📝 Plain string] --> Store[Knowledge.store text]
        URL[🌐 URL] --> Skip[⚠️ Warn and skip]
    end

    classDef ok fill:#10B981,stroke:#7C90A0,color:#fff
    classDef warn fill:#F59E0B,stroke:#7C90A0,color:#fff

    class File,Text,Add,Store ok
    class URL,Skip warn
```

## What Each Source Does

`_process_knowledge` inspects every item and routes it by type.

| Source          | Example                 | Behaviour                                |
| --------------- | ----------------------- | ---------------------------------------- |
| Local file path | `"notes.pdf"`           | `Knowledge.add(path)` — read and indexed |
| Plain string    | `"Key fact: ..."`       | `Knowledge.store(text)` — stored as text |
| URL             | `"https://example.com"` | **Warns and skips** — not ingested       |

<Warning>
  `Agent(knowledge=["https://..."])` does not fetch the URL. It logs:

  ```
  Knowledge source 'https://example.com...' is a URL; URL knowledge ingestion is not yet implemented in the core SDK. This source will be skipped. Fetch and pass the content as text, or a local file path, instead.
  ```

  Only the scheme and host are logged — credentials and query strings are redacted.
</Warning>

## Fetch, Then Pass Text

Fetch the page yourself and pass the text as a knowledge source.

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

text = requests.get("https://example.com/article").text
agent = Agent(name="Reader", instructions="Summarise the article.", knowledge=[text])
agent.start("Summarise it.")
```

<Note>
  `Knowledge.add(url)` used directly also does not fetch URLs — it raises `NotImplementedError("URL processing not yet implemented")`. Use the fetch-then-text recipe above for both the `Agent` and direct-`Knowledge` paths.
</Note>

## Best Practices

<AccordionGroup>
  <Accordion title="Convert web content to text before ingesting">
    Fetch pages with `requests`, `httpx`, or a scraper, then pass the extracted text as a knowledge string.
  </Accordion>

  <Accordion title="Prefer local files for documents">
    Save PDFs and docs locally and pass the path — `Knowledge.add(path)` reads and chunks them for you.
  </Accordion>

  <Accordion title="Check logs if a source seems missing">
    A skipped URL logs a warning; if answers lack a source you expected, confirm it was a file or text, not a URL.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card icon="book-open" href="/docs/knowledge/features" title="Knowledge Base">
    Chunking, embedding, and search options.
  </Card>

  <Card icon="magnifying-glass" href="/docs/features/rag" title="RAG">
    Retrieval-augmented generation patterns.
  </Card>
</CardGroup>
