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

# Docling Reader

> Convert Docling-supported documents, images, audio, and video into knowledge documents.

Pass `DoclingReader` to `Knowledge.insert()` to parse supported formats with Docling.

```python docling_reader.py theme={null}
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.knowledge.reader.docling_reader import DoclingReader
from agno.models.openai import OpenAIResponses
from agno.vectordb.pgvector import PgVector

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

knowledge = Knowledge(
    vector_db=PgVector(
        table_name="docling_documents",
        db_url=db_url,
    ),
)

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    knowledge=knowledge,
    search_knowledge=True,
)

if __name__ == "__main__":
    knowledge.insert(
        name="Thai Recipes",
        url="https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf",
        reader=DoclingReader(output_format="markdown"),
    )
    agent.print_response(
        "How do I make chicken and galangal in coconut milk soup?",
        markdown=True,
    )
```

## Supported Input Groups

| Group | Examples |
| - | - |
| Documents | PDF, DOCX, PPTX, Markdown, HTML, AsciiDoc, and LaTeX |
| Data | CSV, XLSX, XML, and Docling JSON |
| Images | PNG, JPEG, TIFF, BMP, and WebP |
| Audio | WAV, MP3, M4A, AAC, OGG, and FLAC |
| Video | MP4, AVI, and MOV |

## Run the Agent

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

**1. Install dependencies**

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

Audio and video conversion also require:

```bash theme={null}
uv pip install -U openai-whisper
```

Install `ffmpeg` with your operating system's package manager. See [FFmpeg downloads](https://ffmpeg.org/download.html) for platform packages.

**2. Export the API key**

```bash theme={null}
export OPENAI_API_KEY=your_openai_api_key_here
```

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

**3. Run the agent**

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

## Reader Parameters

<Snippet file="docling-reader-reference.mdx" />

> [!WARNING]
>
> In v2.7.2, `Knowledge.insert(url=..., reader=DoclingReader(allowed_hosts=...))` downloads extension-bearing URLs before calling the reader. Validate the URL before ingestion because the reader's allowlist does not guard this path.

`DoclingReader.async_read()` runs the synchronous conversion in a worker thread.

## Next Steps

| Task | Guide |
| - | - |
| Compare available readers | [Readers Overview](https://agno-v2.mintlify.site/knowledge/concepts/readers/overview.md) |
| Configure chunking | [Chunking](https://agno-v2.mintlify.site/knowledge/concepts/chunking/overview.md) |
| Parse PDFs with pypdf | [PDF Reader](https://agno-v2.mintlify.site/knowledge/concepts/readers/pdf-reader.md) |


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