Metadata-Version: 2.3
Name: aom-format
Version: 1.0.1
Summary: The interface contract of an AOM database. Schemes, version, sanity checks. Native python package.
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# aom-format

This project describes the standard for an AOM (Always On Memory) database, together with a native Python package that implements the standard.

The database is a SQLite `.db` file. It contains an instantiated **ontology**, its provenance, and **embedding vectors** to enable semantic search.

Any software can create such a database, as long as it follows the standard described in [docs/aom_format_spec_1.0.1.md](docs/aom_format_spec_1.0.1.md). The software that creates the database is the `writer`; the software that queries it is the `reader`.

> The only thing linking a `writer` to a `reader` is the format described here. **Nothing more.**

## Repository structure

- [docs/aom_format_spec_1.0.1.md](docs/aom_format_spec_1.0.1.md) : the normative contract.
- [src/aom_format](src/aom_format) : a dependency-free Python package that implements the standard.
- [tests](tests) : the reference conformance tests.
- [examples](examples) : a runnable script that writes a complete database on disk.

## Using the `aom-format` package

### Installation

```bash
pip install aom-format
```

Or clone the repository and install it locally:

```bash
git clone https://gitlab.com/hopa_aom/aom_format
cd aom_format
uv sync
```

### Check a database

```bash
uv run aom-format check memory.db            # errors and warnings
uv run aom-format check *.db --json          # one JSON line per database
uv run aom-format check memory.db --strict   # also fail on warnings
uv run aom-format version
```

### Print a summary of a database

```bash
uv run aom-format summary memory.db
uv run aom-format summary memory.db --json --examples 10
```

The summary shows the metadata, table counts, node tags and a few example nodes
with their class and degree. `--examples N` controls how many nodes are shown.

### Run the example

```bash
uv run python examples/build_example_db.py
uv run aom-format check examples/output/memory.db --strict
```

The script builds a small graph (memories, node and literal facts, provenance,
node vectors and one artifact) in `examples/output/memory.db`, then checks it.

## Migrating from 0.2.0

1.0.1 is a breaking change: `system_state` becomes `db_info`,
pivots and artifact nodes are kept through tags and the `artifacts` table.
`node_embeddings`
becomes `nodes` (with `node_class` and `node_label`), `triplets` loses
`subject_class`, `object_class`, `subject_tag` and `object_tag`, and
`object_label` becomes `object_value`. `memories.created_at` is back. Literals
must be in canonical form (`aom_format.literals.make`). See
[docs/changelog.md](docs/changelog.md).
`memory_embeddings` is folded
into `memories.embedding`, and writer tables are no longer allowed. Migration
belongs to the writer; `schema.create()` refuses a database stamped with another
schema version. See [docs/changelog.md](docs/changelog.md).
