Skip to main content

OpenDMA Haystack

Integrate Haystack with Enterprise Content Management systems such as Alfresco, CMOD, Documentum, FileNet P8, OnBase, SharePoint, and other platforms.

OpenDMA is a vendor-neutral abstraction layer for Enterprise Content Management. It provides a common API for repositories allowing developers to build applications that access content stored on different platforms, including federating across multiple repositories.

This package connects that API to Haystack with components to retrieve and fetch OpenDMA documents as part of pipelines.

A convenient Toolset allows agentic applications to browse through complex repository layouts to retrieve information.

See our examples and tutorials to learn how to build RAG pipelines and tool-calling agents.

Features

  • Tools to browse an ECM repository, e.g. to enable agents to discover relevant documents.
  • Tools for reading text chunks of documents, e.g. to allow agents to read sections of documents.
  • Fetch binary content streams by document ID or folder ID, e.g. to build a knowledge base.
  • Search repositories with metadata-only Haystack retrievers, e.g. to use an existing repository as knowledge base.
  • Preserve full metadata on every Haystack ByteStream and Document, e.g. to scope RAG retrieval to a subset of relevant items.

Installation

Install OpenDMA and this integration from PyPI:

pip install opendma-haystack

Install the optional examples dependencies when using the documented converter pipelines for PDF, HTML, or Microsoft Office formats:

pip install "opendma-haystack[examples]"

Quickstart

from opendma_haystack import OpenDMAFetcher

fetcher = OpenDMAFetcher(
    endpoint="http://localhost:8080/opendma",
    username="admin",
    password="admin",
    repository_id="my-repository",
)

result = fetcher.run(targets=["some-document-id"])
streams = result["streams"]

for stream in streams:
    print(stream.meta.get("opendma_id"))
    print(stream.meta.get("opendma:Title"))
    print(stream.mime_type)
    print(len(stream.data))

OpenDMAFetcher returns Haystack ByteStream objects. Connect it to Haystack converters such as TextFileToDocument, PyPDFToDocument, HTMLToDocument, or DoclingConverter when you need text Document objects for indexing or RAG.

Use OpenDMARetriever when you want to search in an ECM system via OpenDMA:

from opendma_haystack import OpenDMARetriever

retriever = OpenDMARetriever(
    endpoint="http://localhost:8080/opendma",
    username="admin",
    password="admin",
    repository_id="Alfresco",
    query_language="opendma:sfts",
)

result = retriever.run(query="needle keyword")
documents = result["documents"]

Retriever results are metadata-only locator Document objects. They identify matching repository documents and can be passed to OpenDMAFetcher to fetch the actual content.

The OpenDMAToolset provides various tools to allow agents to browse repository layouts and read sections of text documents:

from opendma_haystack import OpenDMAToolset
from haystack.components.agents import Agent
from haystack.components.generators.chat import OpenAIChatGenerator
from haystack.utils import Secret
from haystack.dataclasses import ChatMessage

toolset = OpenDMAToolset(
    endpoint="http://localhost:8080/opendma",
    username="ignored",
    password="ignored",
    repository_id="sample-repo",
)

agent = Agent(
    chat_generator=OpenAIChatGenerator(
        api_key=Secret.from_env_var("OPENAI_API_KEY"),
        model="gpt-4o-mini",
    ),
    tools=toolset,
    system_prompt="You are...",
)

result = agent.run(messages=[ChatMessage.from_user(
  "Where can I find the latest meeting notes of project orion?")])

print(result.get("last_message").text)

Documentation

  • Tutorials: guided Haystack application tutorials
  • Documentation: component usage, fetcher options, and retriever behavior
  • Examples: runnable examples using the tutorial repository

Development

This project uses uv for dependency management.

uv sync --all-extras
uv run pytest
uv run ruff check src tests
uv run mypy -p opendma_haystack
uv run mypy --follow-imports=skip tests

Related Projects

Metadata

Release files for opendma-haystack 0.3.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 opendma-haystack 0.3.0
File Size Uploaded
opendma_haystack-0.3.0.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opendma-haystack 0.3.0
File Interpreter ABI Platform
opendma_haystack-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.6 kB

Release files / opendma_haystack-0.3.0.tar.gz

Download URL opendma_haystack-0.3.0.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
efdb54c47c84420a4c5dce159b3f04c16c444ee2ea451dd8fd0beed49adb5982
BLAKE2b-256 checksum
How to use checksums
80d059662697af4263a923f9c8b5fd58590ba06bbf0490394a0f9ac9503202a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / opendma_haystack-0.3.0-py3-none-any.whl

Download URL opendma_haystack-0.3.0-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55ca91f9d43070414800ea31b8c176e2d046cf809bb13478a0f728e278905983
BLAKE2b-256 checksum
How to use checksums
218c3a48989170ef881037db84758bfcf5ebbace1beb2d15d604e2a3808a555d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

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