> ## 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?")
```

## 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
        "https://example.com/article"  # URLs work too
    ]
)

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

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

| Category  | Formats                      |
| --------- | ---------------------------- |
| Documents | PDF, DOC, DOCX, TXT, MD, RTF |
| Data      | CSV, JSON, XML, Excel        |
| Web       | URLs, HTML pages             |
| Media     | Images (OCR), YouTube        |

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