Skip to content
View petfold's full-sized avatar

Block or report petfold

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
petfold/README.md

Peter Foldiak

I build a small stack of tools for representing knowledge as a category lattice and keeping it on content-addressed storage — no server to trust, no database to run.

The thread running through all of it: the internal structure of a sparse neural code is a good way to represent semantic structure, and Formal Concept Analysis makes that correspondence exact. That turns the interesting questions into engineering ones — how do you learn a good lattice from data, how do you persist one without a server, and what is it actually like to use one as everyday infrastructure?

The same page, without the GitHub chrome: foldiak.online.

The stack

mdl-fca produces a DAG for ontodag, which persists through recordstore; ontodag-fs uses ontodag and swarmfs; swarmlite uses swarmfs; ucomm uses recordstore; recordstore and swarmfs each talk to a Bee node directly.

recordstore and swarmfs are siblings, not a stack: each talks to a Bee node directly. recordstore's own /bytes client is its byte path, and it borrows swarmfs only optionally, to compute Swarm-native content addresses and to validate postage batches.

Knowledge

  • ontodag — a subsumption-only ontology kept in transitively reduced form, with one query primitive: the intersection of descendant cones. Because that reduction is unique, the structure has a canonical form, which is what makes it content-addressable, diffable and mergeable. Categories can also carry typed values — odag get Flight 'time(2026-06-01..2026-08-31)' answers from exact rational arithmetic over SI anchors, with no edge ever stored between the dates. An answer can travel on its own: an is_below certificate is checkable by anyone holding only the root — no store, no network, no trust in the prover. Agents get the same read-only surface over MCP.
  • mdl-fca — plain FCA invents a concept for every random coincidence, so its lattice explodes. This builds the DAG that best compresses the data instead: a concept exists only if it pays for its own description length. (prototype running: the greedy learner recovers planted three-level hierarchies — extents, and the order between them — in the test suite)
  • ontodag-fs — the lattice as a real, mountable filesystem, and a descendant of Gifford's Semantic File System (SOSP '91) with a concept lattice instead of flat attributes. Directories are concepts and paths are queries, so one object has several true names and no copies or symlinks. --as-of browses any past version of a store, because a version is a root. (v0 read-only browsing complete and FUSE-mountable; v0.1 — filing through the mount — in progress)

Storage

  • recordstore — the missing layer between an immutable blob store and an application that wants records and versions: atomic commits and snapshot isolation. Equal content gives an equal root reference regardless of history, so versions compare with ==, and a store remembers the roots it has passed through, which makes undo() a matter of pointing back rather than replaying a diff. Concurrent writers need no lock server: a pointer that moved under a commit three-way merges and retries.
  • swarmfs — Ethereum Swarm as an ordinary filesystem to the Python data stack: bzz:// URLs for pandas, dask, zarr, xarray, pyarrow and DuckDB. Writes are transactional copy-on-write, so every commit is a snapshot; feeds give mutable bzzf:// mounts; and in local-first mode offline is the normal case — commits land on disk instantly and sync in the background, with fs.sync() as the certainty barrier.
  • swarmlite — a read-only SQLite VFS over Swarm, so a published database needs no server. A point lookup in a 134.5 MB database fetched five 4 KB pages, each one verifiable against the file's 32-byte content address. The browser reader (SQLite-WASM) needs no install, no wallet and no extension.

Communication

  • ucomm — chat, mail, forums and feeds differ in a handful of parameters, not in principle. Factors out the common core — one channel kernel, one inbox — with receiver sovereignty over attention. Bridges put protocols that already exist behind the same envelope schema and the same policy engine, so the attention layer covers the IMAP mailbox you are stuck with too. (M0–M1 done, M2 — notification daemon and universal inbox — in progress)

A note on trust

"No server to trust" has a matching option for "no host to trust". swarmfs encrypts node-side on request and swarmlite publishes that way, where the 128-hex reference carries the decryption key — the URL is the secret. ontodag encrypts rs: stores at rest under a key of your own, records and trie structure alike, and deterministically, so two devices holding the same key still converge on the same root.

Elsewhere

Earlier research on sparse coding, neural population decoding, and information theory in neuroscience — including the formal concept analysis work these projects grew out of: publications, 1987–2018.

Pinned Loading

  1. ontodag ontodag Public

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

    Python 5 1

  2. mdl-fca mdl-fca Public

    Learning compact concept DAGs from binary data by minimum description length — a probabilistic take on Formal Concept Analysis

    TeX 2

  3. swarmfs swarmfs Public

    fsspec backend for Ethereum Swarm: bzz:// URLs for pandas, dask, zarr and FUSE mounts, backed by a Bee node

    Python 1

  4. recordstore recordstore Public

    Versioned key→record store over a content-addressed blob store: atomic commits, snapshots, lock-free three-way merge

    Python

  5. swarmlite swarmlite Public

    Verifiable serverless SQLite hosting on Ethereum Swarm: read-only VFS for lazy SELECT + a publisher for the write path over swarmfs

    Python 1

  6. loopmarket loopmarket Public

    A universal, permissionless, combinatorial marketplace for products and services based on canonical offers.

    Python 1