The search index is made of the same blocks as the data
3 months ago
You have searched your own email for a message you could see, and it wasn’t there. This is LatticeDB, and one question runs three kinds of search. It finds paragraphs that mean what you asked for, even without your words in them. It finds the paragraphs that do contain your words.
Ask about this presentation
Chapters
0:00LatticeDB · one file holding your data and everything built to search it
0:19There is no server to run and nothing to configure
0:29A search index is a second structure built from your data
0:50The search index is made of the same blocks as the data
1:23One numbered list says where every structure starts
1:45Open a file and start working
2:11There is no second copy to keep in step
Show transcriptHide transcript
You have searched your own email for a message you could see, and it wasn’t there. This is LatticeDB, and one question runs three kinds of search. It finds paragraphs that mean what you asked for, even without your words in them. It finds the paragraphs that do contain your words. Then the question walks from a paragraph to its document, and on to the author. All three are in one file.
You open LatticeDB the way you open a file. Every part of LatticeDB reads and writes through one patch of memory, and underneath that, one file. Everything you store ends up in that one file.
Here is your data: your things, and the links between them. To search it quickly, LatticeDB builds two more structures out of it. The meaning index is layers of links between your items: a few long jumps at the top, every item at the bottom. The word index is a dictionary from each word to the items containing that word. Change your data, and both indexes change too.
Here is the part worth knowing. This whole file is nothing but blocks, four kilobytes each. The meaning index keeps one record for each item, and that record is twenty-one bytes. Eight bytes name the item. One byte says how high it sits in those layers. And the last twelve bytes are two addresses: which block holds its numbers, and which block holds its links to its neighbours. The links are in blocks too. The project calls a block a page, and its own comment says the connections for many items get packed into shared pages. Every block carries a tag saying what it holds. The tags for the two search indexes sit in the same list as the tags for your data.
The very first block of the file holds one numbered list. Your things are number zero. Your links are number one. Five, six and seven are the word index, and eight is the meaning index. The list is sixteen slots long, and each slot holds the block where one structure starts. Every one of those blocks also carries the same kind of checksum, so one routine can tell whether any block in the file is intact.
All of that has a name. LatticeDB is an embedded graph database: your things and their links, in a file your own program opens. One line installs the command line tool, and three languages have libraries: Python, TypeScript and Go. LatticeDB is open source under the MIT licence, and it depends on nothing else. Version zero point thirteen has builds for Linux and macOS, on both Intel and ARM. It is built for one program on one machine owning the file.
Searching means building a second structure out of your data. Here that second structure is made of the same blocks as the data, in the same file. That is jeff hajewski slash latticedb, on GitHub. New repo tomorrow.
Up next
6:49Hide the tests from your coding agent? StrongDM's holdout idea, tested on Claude Code
@github-trending
3 weeks ago
0:51Claude Code built a machine to explain prompt caching
@github-trending
1 month ago
10:10reladraw draws your diagram from where you say the boxes go
@github-trending
1 month ago
7:27Lap photo manager finds photos by what's in them, offline
@github-trending
2 months ago
9:04Spirula Studio does Gaussian splatting on any graphics card
@github-trending
2 months ago
8:50Univer puts a spreadsheet, document editor and slides in your app
@github-trending
2 months ago
18:13i-have-adhd, ponytail, and 7 more skills that make your agent stop explaining itself
@github-trending
2 months ago
7:57Homebrew BrewUI runs every brew command in a clean shell
@github-trending
2 months ago
8:35fugleramme draws the birds in your garden on an e-ink frame
@github-trending
2 months ago
9:01Open Code Review: Alibaba open-sourced the code reviewer it validated on a million real tasks
@github-trending
2 months ago
3:03Portless refuses to touch eight shapes of command, and says why for each
@github-trending
2 months ago
2:52The measurement file says 1.571. The stylesheet says 1.57.
@github-trending
2 months ago