Lam NguyenProjects

Open source

I build in the open to learn a topic all the way down: a database engine to understand recovery, a reasoner to understand description logics, a framework port to understand training.

You'll see that I particularly like databases, knowledge graphs, language agents, and machine learning systems. If something here is useful to you, I'd love to hear about it.

The Agentic Ontologist

0 Python Agents

Turn two ontologies into one. Agents match, extract, reason, and repair, and every decision goes to the cheapest model that can settle it.

The Agentic Ontologist orchestrates memory-augmented agents for ontology engineering. Each decision is routed by cost: cheap retrieval and small models settle most of them, and only the hard ones reach a large model.

OntoDB

1 C++ Databases

A database management system for ontologies. Data is RDF and the query language is SPARQL.

The shell answers a SPARQL subset over B+ tree indexes with a cost-based optimizer, runs statements under strict two-phase locking, and recovers pages with ARIES after a crash, from a checksummed write-ahead log.

I wrote it to learn database internals end to end, and the book explains each layer as it is built.

The engine also compiles to WebAssembly, so the playground runs OntoDB itself in the page: SPARQL, its query plans, the B+ tree indexes and the semantic search, on a Gene Ontology slice.

It also finds terms close in meaning: the class hierarchy is stored as intervals a B+ tree can range-scan, and vector indexes search one embedding per term, with the search limited to the terms under a class. The paper measures it on the Gene Ontology.

MemCommit

0 Python Agents

A transactional memory layer for agents. Memories live in an append-only log with provenance, so what was built on a bad premise goes stale together.

Agents that remember need the full record of what happened and short notes of what matters. MemCommit keeps both in one log: sessions as they happen, and notes at paths with an index an agent reads first and five tools it can call. An offline pass finds what the agent did not think to save, and every edit is a transaction that can be previewed, audited, or undone.

I built it to treat agent memory the way a database treats data, with transactions, a log, and rollback. The code, manual, and paper are public.

KROMA

7 Python Knowledge Graphs

Ontology matching with knowledge retrieval and large language models.

KROMA matches concepts across two ontologies. For each candidate pair it retrieves the concepts’ context (from the ontology graph, ConceptNet and SPARQL endpoints), asks a language model whether the two refer to the same thing, and refines the alignment as answers arrive, so later pairs are settled without asking.

It was published in the Research Track of ISWC 2025, and grew out of my M.S. thesis.

OntoCheck

4 Python Knowledge Graphs

Query-driven ontology assessment for scientific domain applications.

OntoCheck asks whether an ontology can answer the questions its users need answered, and scores it on those queries. I contributed to it at the Center for Materials Data Science.

Hermes

0 Python Databases

Verified query planning over the SPARQL algebra with language agents.

Hermes treats a natural-language question as a planning problem over a typed SPARQL algebra: agents build the query from operators that are checked as they are composed, instead of writing query text and hoping it parses.

It answers questions against a local ontology, an in-memory graph, or a live endpoint such as DBpedia, and reports results on public text-to-SPARQL benchmarks.

Aegis

Python Security

Transactional defense of ontology-grounded agents against counterfactual attacks.

Agents that answer questions over a knowledge graph lean on its ontology, and on a few of its concepts far more than the rest. An attacker who edits those few can make answers wrong without touching the graph. Aegis defends the ontology the way a database defends its data: every edit is a logged transaction, health checks run on each commit, forensics measure the damage over a query workload, and recovery rolls back to the last healthy state while keeping honest edits.

Work in progress; the code will be public soon.

LeetMath

JavaScript Education

Open a problem, write a proof in Markdown and LaTeX, and get a 0–7 grade against that problem's rubric.

LeetMath is practice for proofs the way LeetCode is practice for code, from AIME through USA(J)MO to early Putnam. Each problem has its own 7-point rubric in the style of USAMO grading.

The site is static and has no grading server. Proofs are graded by a model you choose, with your own key, in your own browser, or for free by a model that runs on your GPU inside the tab.

keras-js

0 TypeScript Machine Learning

The Keras 3 API for JavaScript. Build, train and fine-tune neural networks in the browser, on WebGPU and WebAssembly.

keras-js is Keras 3 written in TypeScript on top of jax-js, the way Keras 3 runs on JAX in Python: a model is a pure function of its weights, and every training step is differentiated with grad and compiled with jit into WebGPU or Wasm kernels. It has the same layers, compile() and fit(), masking, recurrent states, sample weights and optimizer checkpoints.

It reads and writes real .keras files, so a model trained in Python can be fine-tuned in a browser tab and sent back. A parity suite checks predictions and optimizer steps against Keras 3.15, and five examples from keras.io run unchanged in the page.

art-viz

0 JavaScript Education

Step through insert, search and range scans in an Adaptive Radix Tree and watch the code, the key bytes, the tree and the locals change line by line.

An Adaptive Radix Tree stores keys in a trie whose nodes grow from 4 to 256 children, skips shared prefixes with path compression, and keeps a long unique tail in a single leaf (lazy expansion). The Python source is shown with the current line highlighted and its result written inline, the way a debugger does.

Each slide shows the key bytes with the depth pointer, the tree with every node’s type and slots, nodes that are built but not yet linked, the locals and the call stack. Presets cover node growth, prefix keys and duplicates, and you can type your own words.

revu

0 Rust Developer Tools

Read your code changes before you ship them.

revu is a small terminal diff reader for reviewing a branch, drafting inline comments, and publishing them to a GitHub pull request.

toolbox

0 Python Machine Learning

An extensible toolbox for machine learning research.

Every model, layer, loss, reward and training loop is a component you select by name, so trying an idea is a config change and comparisons stay fair. Standard libraries (Hugging Face, TRL, PyTorch Geometric, SGLang, vLLM) plug in as backends instead of being rewritten.

Algorithm and Data Structure Library

0 C++Python Algorithms

C++ and Python implementations of the algorithms and data structures I use for competitive programming and interviews, with contest templates.

44 entries, from segment trees and Fenwick trees to rolling hashes, graph algorithms, caches and probabilistic sketches. Each comes from my notebook, where it has unit tests, and has its own page with the code and a copy button. The blog explains many of the ideas behind them.

hermitpy

0 Python Knowledge Graphs

A Python OWL reasoner, with no JVM.

hermitpy checks whether an ontology is consistent and builds its class hierarchy for a documented fragment of OWL, using the hypertableau calculus of Motik, Shearer and Horrocks. Constructs outside the fragment raise an error instead of being dropped silently.