frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Show HN: I built a game where you are an LLM's subagent

https://github.com/gulivan/worker755
105•ivantgam•2h ago•24 comments

Show HN: Zero C# – C# without a runtime or GC

https://onurgumus.github.io/zero-csharp/index.html
166•reverseblade2•1d ago•118 comments

Show HN: The Riemann Proof Handbook

https://github.com/tamnd/riemann-handbook
79•tamnd•11h ago•54 comments

Show HN: NestDaddy Memory, one memory shared by ChatGPT, Claude and Cursor

https://nestdaddy.com/memory
3•nestdaddy•4h ago•2 comments

Show HN: An ASCII cell aquarium for your terminal

https://github.com/kborer/cells/
63•kborer•4d ago•22 comments

Show HN: A Lichess client for playing chess and puzzles on Kobo e-readers

https://github.com/BandarLabs/Cobalt/tree/main/apps/lichess
4•thepoet•5h ago•0 comments

Show HN: I made a PS1 style racing game

https://outpostracer.com
40•shash7•1d ago•29 comments

Show HN: Foolscap – a writing app that reads your book and never writes for you

https://foolscap.works/
129•atugard•3d ago•94 comments

Show HN: Tinnitus frequency finder and audio notch tool

https://trynotched.com/find
227•brianrhea•4d ago•134 comments

Show HN: Fast deterministic natural language search for OpenStreetMap data

https://hippomaps.ch/?q=cafes+by+the+Limmat+100+m+from+the+lake+in+zurich#map=15.02/47.36708/8.54935
137•vihren•3d ago•46 comments

Show HN: OpenComputer – an open source alternative to Devin

https://github.com/diggerhq/opencomputer
122•iacguy•1d ago•36 comments

Show HN: I built a newspaper for white-collar crime that paints every portrait

https://financialcrimes.fyi/
3•veryduhass•8h ago•1 comments

Show HN: Mastra Factory, the open-source software factory we use to build Mastra

157•codekarate•3d ago•44 comments

Show HN: agent-mcts – Monte Carlo tree search on top of Claude Code

https://github.com/natsu0529/agent-mcts
15•natsu529•1d ago•2 comments

Show HN: Npx.tools, a keyboard-friendly index of developer tools

https://npx.tools/
2•hasnainkhagan•11h ago•0 comments

Show HN: LZ0 -An asymmetric LZ compressor with ultra minimal, 0-alloc decoder

https://github.com/seb3773/lz0
25•seb3773•2d ago•6 comments

Show HN: Hikari.ImGui, a pure C# re-implementation of Dear ImGui

https://github.com/LeastActionTech/Hikari.ImGui
2•charm137•13h ago•2 comments

Show HN: A modern take on the Go language

https://github.com/telgatech/gpp
4•u89012•13h ago•0 comments

Show HN: Lifetime Black Friday Deals (Mega List)

https://www.blackfridaydeals.directory/black-friday-lifetime-deals
2•bfdd•14h ago•0 comments

Show HN: Cornhole News – A Hacker News inspired site for news across the Midwest

https://cornholenews.news
237•cornholemedia•3d ago•121 comments

Show HN: Type Fighter 2

https://typefighter2.com/
149•torumitch•4d ago•73 comments

Show HN: Mount your iPhone as a filesystem on Linux over WiFi

https://github.com/Amirjon06/iphone-linux
3•Amirjon_Abd•15h ago•0 comments

Show HN: Security Watch – alerts when a new vulnerability affects your stack

https://github.com/ShieldaAI/security-watch
3•VDudaG-A•17h ago•0 comments

Show HN: Hearthen, an app for building and keeping strong relationships

https://hearthenapp.com
3•mamorales•17h ago•1 comments

Show HN: It's now easy to install Linux on an Android Phone – Android2linux

https://github.com/android2linux/android2linux
5•brazukadev•19h ago•2 comments

Show HN: Open-Source Vulnerability Scanner

https://waffuru.ai/products/pantry
6•ekryski•19h ago•1 comments

Show HN: Take Voyager 1 apart, down to a single memory chip

https://rshekhar.com/voyager/
238•raj-shekhar•4d ago•60 comments

Show HN: ExitPath – Open-source ways out of Slack, Notion and Microsoft 365

https://exitpath-ruddy.vercel.app/
251•zerocool0101•4d ago•94 comments

Show HN: Watch weight-space programming in action with WebGPU

https://tabbyml.github.io/weight-space-playground/
40•wsxiaoys•3d ago•6 comments

Show HN: Pencil – LLM writes whiteboard lessons as JSON, a browser draws them

https://github.com/VBS2004/pencil
3•VBS2004•22h ago•0 comments
Open in hackernews

Show HN: HNSW index for vector embeddings in approx 500 LOC

https://github.com/dicroce/hnsw
73•dicroce•1y ago

Comments

oersted•1y ago
I particularly appreciated the concise and plain explanation of the data-structure, it really demystifies it.

> HNSW is a graph structure that consists of levels that are more sparsely populated at the top and more densely populated at the bottom. Nodes within a layer have connections to other nodes that are near them on the same level. When a node is inserted a random level is picked and the node is inserted there. It is also inserted into all levels beneath that level down to 0.

> When searches arrive they start at the top and search that level (following connections) until they find the closest node in the top level. The search then descends and keeps searching nearby nodes. As the search progresses the code keeps track of the K nearest nodes it has seen. Eventually it either finds the value OR it finds the closest value on level 0 and the K nearest nodes seen are returned.

imurray•1y ago
Looks neat. It would be useful to compare to other implementations: https://ann-benchmarks.com/ -- potentially not just speed, but implementation details that might change recall.
swyx•1y ago
i think with small codebases like this is less about speed and more about education of essentials - i actually often encourage juniors to do small clones like this, feel proud, and then study the diffs with the at-scale repros and either feel humbled or feel like they have a contribution to make.
oersted•1y ago
I see they are still using GloVe word embeddings for the first benchmark. Ah good ol' days! Nothing wrong with it, should still yield a realistic distribution of vectors. Just brings a lot of memories :)
antirez•1y ago
Yes, HSNWs are not so complex, and they work great. I wrote an implementation myself, it's 2500 lines of code (5x the one of dicroce!), but inside there is binary and int8 quantization and many advanced features (include true deletions), and I commented it as much as possible. I hope you may find it useful to read alongside the one proposed by OP:

https://github.com/redis/redis/blob/unstable/modules/vector-...

Still, to be honest, I'm reading the 500 lines of code with great interest because I didn't thought it was possible to go so small, maybe part of the trick is that's in C++ and not in C, as for instance you don't have the queue code.

Also the strategy used by my implementation in order to re-link the orphaned nodes upon deletion adds complexity, too. (btw any feedback on that part is especially appreciated)

EDIT: Ok after carefully inspection this makes more sense :D

1. Yes, C++ helps, the vector class, the priority queue, ...

2. I forgot to say that I implemented serialization other than quantization, and this also includes quite some code.

3. Support for threads is another complexity / code-size price to pay.

And so forth. Ok, now it makes a lot of sense. Probably the 500 LOC implementation is a better first-exposure experience for newcomers. After accumulating all the "but how to..." questions, maybe my C implementation is a useful read.

mertleee•1y ago
I guess I'm too simple to understand why this is useful? Just because it's been implemented in so few lines or?
cluckindan•1y ago
It makes it possible to approximate k-nearest neighbor vector search without having to calculate cosine similarity, dot product or euclidean distance for all stored vectors on the fly.
jasonjmcghee•1y ago
Implementations like these are incredibly useful for understanding how something like HNSW works, and being able to make derivative work.

I put together a tiny little implementation a while ago, the key thing being, it writes the index as a few parquet files, so you can host the index on a CDN and read from it via http range requests (e.g. via duckdb wasm).

Definitely isn't beating any benchmarks, but free (or wildly cheap) to host, as you serve it directly from a CDN and processing is done locally.

https://github.com/jasonjmcghee/portable-hnsw

kamranjon•1y ago
This is incredibly cool, I’m surprised more people haven’t contributed to this - it seems like it’s only a few optimizations away from being performant enough for a pretty broad set of use cases.
jasonjmcghee•1y ago
Appreciate the kind words! Obviously feel free to hack on it.

When I first built it, I spent some time trying to tackle the issue of needing to update the entire file (and create an invalidation) if you want to update the database, which might be fine, but closes a lot of doors. I kind of hit a wall on finding a convincing approach to solving it, given the constraints of the setup.

aboardRat4•1y ago
I almost read it as NSFW.
vismit2000•1y ago
A very nice intro to HNSW that previously appeared on HN[1]: https://github.com/brtholomy/hnsw/blob/master/README.md

[1] https://news.ycombinator.com/item?id=41694631