Skip to main content

kreuzberg-crewai

PyPI version Python versions License Docs CI
Kreuzberg Banner

Kreuzberg document extraction tools for CrewAI agents.

Extract text and metadata from 88+ document formats — PDF, DOCX, XLSX, HTML, images with OCR, and more — directly from your CrewAI agents.

Installation

pip install kreuzberg-crewai

Quick Start

from crewai import Agent, Crew, Task

from kreuzberg_crewai import KreuzbergExtractTool

tool = KreuzbergExtractTool()

agent = Agent(
    role="Document Analyst",
    goal="Extract and analyze document content",
    backstory="You are an expert at reading and understanding documents.",
    tools=[tool],
)

task = Task(
    description="Extract the content from report.pdf and summarize the key findings.",
    expected_output="A summary of the key findings in the report.",
    agent=agent,
)

crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()

Tools

KreuzbergExtractTool

Extracts text content from a document file.

Parameters:

Parameter Type Default Description
file_path str required Path to the document file
output_format "plain" | "markdown" | "html" "markdown" Output format
from kreuzberg_crewai import KreuzbergExtractTool

tool = KreuzbergExtractTool()

# The agent calls this automatically, but you can also call it directly:
content = tool._run(file_path="report.pdf", output_format="markdown")

KreuzbergExtractMetadataTool

Extracts metadata (title, authors, dates, page count, format-specific details) from a document file.

Parameters:

Parameter Type Default Description
file_path str required Path to the document file
from kreuzberg_crewai import KreuzbergExtractMetadataTool

tool = KreuzbergExtractMetadataTool()

metadata = tool._run(file_path="report.pdf")
# title: Annual Report 2025
# authors: ['John Doe']
# page_count: 42
# pdf_version: 1.7

Agent Example

Using both tools together:

from crewai import Agent, Crew, Task

from kreuzberg_crewai import KreuzbergExtractMetadataTool, KreuzbergExtractTool

extract_tool = KreuzbergExtractTool()
metadata_tool = KreuzbergExtractMetadataTool()

agent = Agent(
    role="Research Assistant",
    goal="Read documents and extract useful information",
    backstory="You help researchers by reading and analyzing documents.",
    tools=[extract_tool, metadata_tool],
)

task = Task(
    description=(
        "First, check the metadata of research-paper.pdf to find the authors and date. "
        "Then extract the full content in markdown format and list the key conclusions."
    ),
    expected_output="Authors, date, and key conclusions from the paper.",
    agent=agent,
)

crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()

Supported Formats

Kreuzberg supports 88+ file formats:

  • Documents: PDF, DOCX, DOC, XLSX, XLS, PPTX, PPT, ODT, ODS, ODP, RTF, and more
  • Text/Markup: TXT, MD, HTML, XML, JSON, YAML, LaTeX, Jupyter notebooks
  • Images (OCR): PNG, JPEG, TIFF, GIF, BMP, WEBP, SVG
  • Email: EML, MSG (with attachment extraction)
  • eBooks: EPUB
  • Archives: ZIP, RAR, 7Z, TAR, GZIP
  • Data: CSV, DBF

Development

# Install dependencies
uv sync

# Run tests
uv run pytest

# Run linting
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/

# Run type checking
uv run mypy src/

License

MIT

Metadata

Release files for kreuzberg-crewai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kreuzberg-crewai 0.1.0
File Size Uploaded
kreuzberg_crewai-0.1.0.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kreuzberg-crewai 0.1.0
File Interpreter ABI Platform
kreuzberg_crewai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / kreuzberg_crewai-0.1.0.tar.gz

Download URL kreuzberg_crewai-0.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
82036953ba59eca32a4a3cca939a2d81ca5a2b269db57861acc6fb7c66f353b0
BLAKE2b-256 checksum
How to use checksums
32053d84b6fe6ec321ec282dd96f05e07a65185b6444f4f45fec93c4d3ef1fec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 21, 2026.

Transparency log

Release files / kreuzberg_crewai-0.1.0-py3-none-any.whl

Download URL kreuzberg_crewai-0.1.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70704ca6f23f5fad65b47d90abeb1ef667aeb229d65be36be02906aa373e2c20
BLAKE2b-256 checksum
How to use checksums
4d8a73a05408d977ccca930d2079de41c051714cde80bf72ac0af900b45621fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page