Skip to main content

OntoDAG

tests PyPI license

Associative memory and categories based on a directed acyclic graph data structure

Documentation

  • User Guide — installation, tutorial, Python API, command line, web app/REST, file formats, AI agents, troubleshooting. Start here.
  • How It Works Inside — the design in plain language (canonical form, query planning, content-addressed persistence, verifiable answers).
  • Roadmap — delivered, queued, parked, and research horizon.
  • Changelog — what each release added, with registry migration notes.
  • The contract — what programs (and AI agents) built on OntoDAG may rely on: the guarantees, versioned.
  • docs/SWARM_DESIGN.md, docs/SEMANTIC_CODES.md, docs/AGENT_SURFACE.md — engineering design documents.

See also ontodag-fs: any OntoDAG store can be browsed as a filesystem — paths are category queries, files are classified objects stored on Swarm, FUSE-mountable (odag-fs, which shares odag's store settings).

Specification

A Directed Acyclic Graph (DAG) associative storage and category manager in Python. You can store items into a ontodag and recall items from it. To store or "put" an item into a ontodag, you give it a name and a set of other names of already existing items that are its supercategories. To recall or "get", you specify a set of item names to get all items that are subcategories of all these items; alternatives are one word away (odag get Flight Japan or Hotel, get_any in Python).

File a flight confirmation under both Flight and Japan, the boarding pass under the flight itself, and odag get Japan returns the whole trip — including the boarding pass you never filed under the trip. No folder had to be chosen.

Categories can also carry typed values: declare time as a dimension and time(2026-08-15) becomes an ordinary category whose ordering OntoDAG computes — odag get Flight 'time(2026-06-01..2026-08-31)' finds last summer's flights with no edge ever stored between them, at any range, with exact arithmetic — values are rationals of the SI anchor units, so every exactly defined unit works: all of SI, pounds and psi, TB and TiB, even Celsius and Fahrenheit (mapped exactly onto the kelvin scale: temperature(24C)) built in, and unit packs one merge away (odag pack crypto-core for BTC/ETH/BZZ, fiat-iso4217 for ~150 national currencies, crypto-majors for the market's top coins — or declare your own: vocabulary is graph data that travels with the store, no release needed). odag prelude declares the everyday dimensions in one command. Weights and sizes (weight(..5kg)), hierarchical codes like geohash cells, and does-it-fit tuples all work the same way. See User Guide §4.7 and the design record docs/DIMENSIONS.md.

Values are stored in an exact canonical form and shown to you in a friendly one: on a terminal odag prints time(2026) and weight(3kg), while pipes and files always get the exact bytes, so odag get ... | odag round-trips (--render/--raw override; odag canon TERM shows what any spelling actually stores). The same split governs how much you get: a terminal stops at 50 results with a note saying how many were withheld, a pipe is never truncated. A query with no terms at all is the empty intersection — no constraints, so every item (odag count gives just the size).

For AI agents

Serve any store to an agent over MCP with odag-mcp (claude mcp add odag -- odag-mcp): query, fits-within, overlap candidates, per-item description, canonical echo, and an about tool that says what the store contains — read-only by default; --write adds a propose→confirm write surface where every change carries a signed provenance record (who asserted what, against which state) and a review tool computes each claim's standing under your trust list: claims merge, acceptance is policy. Every answer cites the root — a fingerprint of the store's entire content — and is_below answers can carry a certificate that anyone holding only that fingerprint can verify, with no access to the store (ontodag.certificates.verify_below). Equal knowledge yields an equal fingerprint, so two parties can prove they agree — and a disagreement shows up as structure, not prose. The guarantees an agent (or any program) may rely on are written down and versioned in docs/CONTRACT.md; the tool shapes in docs/AGENT_SURFACE.md.

Roadmap

The roadmap — what is done, what is queued next, what is parked and why — is in docs/ROADMAP.md. Longer-term goals for the database direction (and the features deliberately not built yet) are in docs/DATABASE_DIRECTION.md; the day-to-day task list is in CLAUDE.md.

Potential Applications

  • Using the ontology graph for content categorization instead of folders
  • Replace content tags with a more structured ontology
  • Access control (ACT) groups
  • Memberships in organizations and gate content based on membership
  • Communication channel groups defined by the ontology
  • Fostering deals within a universal marketplace for services and goods

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ontodag-0.12.0.tar.gz (187.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ontodag-0.12.0-py3-none-any.whl (107.1 kB view details)

Uploaded Python 3

File details

Details for the file ontodag-0.12.0.tar.gz.

File metadata

  • Download URL: ontodag-0.12.0.tar.gz
  • Upload date:
  • Size: 187.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ontodag-0.12.0.tar.gz
Algorithm Hash digest
SHA256 719f0825d56a2820de27de940e14950d717651282608bfbc1aea1978b2af22c7
MD5 08fa5bcccae91a8372f1d7614d37288b
BLAKE2b-256 2afec5f044cb1c3d77df082b62aa10ee2e56f86aac67be2ce224ba7df9711c1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ontodag-0.12.0.tar.gz:

Publisher: publish.yml on petfold/ontodag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ontodag-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: ontodag-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 107.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ontodag-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4a3510c45de09731324abc8d478994c9f6c1b6da43c85bb39bd5c4fd0cf1dfd
MD5 c3f18adee30101c7c9118e6e3ebb3ca3
BLAKE2b-256 6e87c2e1cac079db0558ea1b6e28b99c5307f182e42f8a6228821e399bd14ce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ontodag-0.12.0-py3-none-any.whl:

Publisher: publish.yml on petfold/ontodag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.26.2

2 files

0.26.1

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

2 files

0.22.1

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.1

2 files

0.19.0

2 files

0.18.1

2 files

0.18.0

2 files

0.17.1

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.1

2 files

0.14.0

2 files

0.13.0

2 files

This release

0.12.0 This release

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 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