MaximeRivest

attachments: Turn Files Into LLM-Ready Context

attachments is a Python library and CLI that turns documents, images, audio, and other inputs into structured text and image artifacts for LLM workflows. It supports local processing, optional service fallback, and adapters for prompts, chat APIs, and RAG chunks.

View on GitHub Compare
Stars
368
Forks
31
Stars, last 30 days
+1

Our take

Health score

16/100

How it is scored
Activity
19
Community
4
Issues
21
Pull requests
20

+1 stars in the last 30 days

  • Fewer contributors than 91% of the projects we track

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

369

Forks

31

Change since Nov 16, 2026: 0 stars·0 forks

Overview

attachments gives Python applications and AI tools one interface for turning files and other sources into text and images suitable for LLM context. It aims to remove the need to write separate ingestion code for each file format or source.

The project is a fit when you need flexible document ingestion, such as for an LLM app, an agent, or a retrieval pipeline. Processing can run locally with optional format-specific dependencies, or through a configured service. See the project homepage and README for the full format and integration details.

Key Features

  • Process local files, directories, glob patterns, archives, HTTP(S) URLs, and GitHub repositories through a common att() interface.
  • Extract text and images from formats including PDF, Office documents, HTML, spreadsheets, images, notebooks, and audio.
  • Configure format-specific processing with inline options or Python keyword arguments.
  • Return structured artifacts with source metadata, segmentation, warnings, and typed errors.
  • Convert artifacts into text prompts, Claude or OpenAI message formats, and segment-aware RAG chunks.
  • Use local processors, a remote service, or a self-hosted server, depending on available dependencies and configuration.
  • Expose ingestion and option discovery through a CLI or an MCP server.

Use Cases

  • Python developers building LLM applications can ingest varied user-provided documents without implementing a separate parser for every format.
  • RAG developers can turn structured documents into chunks while retaining page or other segment boundaries.
  • Agent builders can expose file and URL ingestion to MCP-capable agents, especially when users need to supply local files or repository content.
  • Teams can centralize heavier processing on a self-hosted server when client environments should avoid installing large optional dependencies.

Getting Started

Install the core package:

pip install attachments

Then try from attachments import att and process an input with att("document.pdf"). Some formats require optional extras. See the README for format-specific installs, service setup, and examples.

Alternatives

  • RAG-Anything: RAG-Anything combines multimodal document parsing with retrieval and querying, while attachments focuses on producing artifacts for downstream LLM workflows.
  • opendataloader-pdf: OpenDataLoader PDF specializes in structured PDF parsing and tagging, while attachments handles a wider range of input types and output adapters.
  • PaddleOCR: PaddleOCR focuses on OCR and document layout parsing for images and PDFs, while attachments supports broader input types and LLM-oriented artifacts.
ProjectLanguageLicenseStarsStatus
attachmentsPythonMIT368Not checked yet
RAG-AnythingPythonMIT23.5kActive
opendataloader-pdfJavaApache-2.029.5kActive
PaddleOCRPythonApache-2.090.6kActive

Considerations

  • The core install has no required dependencies, but support for formats such as PDF, Office files, OCR, and audio transcription requires optional packages.
  • OCR and audio extras are described as large installs. If those dependencies are unsuitable for a client machine, processing can instead use a configured service.
  • Service fallback requires configuration, including an API key where applicable; self-hosting requires installing the server extra and running a server.
  • The repository describes this as version 1.0 and a complete rewrite of the earlier 0.25.x series. Some source types and formats, including video and several cloud integrations, are listed as future work rather than shipped support.

Found this useful?

Share it with someone who would like attachments.

Comparisons