nowfound

Dev tools · January 7, 2025

Tinyhnsw – The Littlest Vector Database

In an effort to understand it, I put together a simple, pure python implementation of HNSW, an approximate nearest neighbor library. Learned a lot, and I think for anyone interested in vector search it's an exercise that's absolutely worth doing. The code is optimized (imo) for readability, and working (albeit, quite slowly) on putting together a tutorial that walks through the motivation and implementation of HNSW. There's also working code examples for using the library for text and image search with sentence transformers and CLIP!

Tinyhnsw – The Littlest Vector Database launched on January 7, 2025 with 17 votes, #835 of 6,142 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 1 year on.

Visit github.com ↗Alternativestop 14% of January 2025

In plain words

Tinyhnsw is a pure Python implementation of HNSW (Hierarchical Navigable Small World), an approximate nearest neighbor search algorithm. Designed for developers wanting to understand vector search, it prioritizes readable code over performance. The project includes a tutorial explaining HNSW's motivation and implementation, plus working examples for text and image search using sentence transformers and CLIP. It's a learning-focused tool for anyone exploring vector databases and similarity search.

written from the facts on this page · September 2026

From the sources

build your own vector database -- the littlest hnsw - jbarrow/tinyhnsw

TinyHNSW is a tiny, simple vector database. It weighs in at a measly few hundred lines of code. It's built on a straightforward (but not fast) implementation of HNSW in Python with minimal dependencies. It has an associated set of tutorials that build up to understanding how HNSW works, and how you can build your own TinyHNSW. ⚠️ The vector database part of this works, but the tutorial is not yet complete. I will update the README checklist below as chapters and code are completed. ⚠️ tinyhnsw is NOT production-quality. Compared to literally any standard implementation, it's slow and probably buggy. If you want to use an Approximate Nearest Neighbor library in a real application, consider…from github.com

Does a similar job

all alternatives →
  • A fast HNSW implementation in Rust2024 · github.com · ▲111

    HNSW implementation in Rust. Reference: https://arxiv.org/ftp/arxiv/papers/1603/1603.09320.pdf - swapneel/hnsw-rust

  • HNSW index for vector embeddings in approx 500 LOC2025 · github.com · ▲73

    Heirarchical Navigable Small Worlds. Contribute to dicroce/hnsw development by creating an account on GitHub.

  • Embeddable HNSW Library for Go2024 · github.com · ▲11

    Frustrated by the inability to play with semantic search / ANN in Go w/o a heavy-weight external DB, I created this HNSW library. I hope other gophers find it useful.

  • Fast vector similarity using Rust and Python2023 · github.com · ▲141

    I recently found myself computing the similarity between lots of very high dimensional vectors (i.e., sentence embedding vectors from LLMs), and I wanted to try some more powerful measures of similarity/dependency than just Cosine similarity, which seems to be the default for everything nowadays because of its computational efficiency. There are many other more involved measures that can detect more subtle relationships, but the problem is that some of them are quite slow to compute, especially if you're trying to do it in Python. For my favorite measure of statistical dependency,…

  • CH
    CozoDB, Hybrid Relational-Graph-Vector Database2023 · docs.cozodb.org · ▲137

    Hi HN! We're thrilled to share CozoDB v0.6, a monumental update to our FOSS database, which already unifies relational and graph features. With the addition of vector search, CozoDB becomes an even better companion for LLMs like ChatGPT. This release introduces vector search using HNSW indices within Datalog, enabling seamless integration with powerful features such as ad-hoc joins, recursive Datalog, and classical whole-graph algorithms. This update significantly broadens CozoDB's capabilities. Check out the linked release note for an in-depth look at the new features, comparisons to other…

  • Vicinity – Fast, Lightweight Nearest Neighbors with Flexible Back Ends2024 · github.com · ▲57

    We’ve just open-sourced Vicinity, a lightweight approximate nearest neighbors (ANN) search package that allows for fast experimentation and comparison of a larger number of well known algorithms. Main features: - Lightweight: the base package only uses Numpy - Unified interface: use any of the supported algorithms and backends with a single interface: HNSW, Annoy, FAISS, and many more algorithms and libraries are supported - Easy evaluation: evaluate the performance of your backend with a simple function to measure queries per second vs recall - Serialization: save and load your index for…

More dev tools this month

the category →
  • /dev/null▲483

    a social network for devs

    Dev tools · 3d ago · dev-null.sh

  • open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.

    Dev tools · 27d ago · github.com

  • Contribute to reladraw/reladraw development by creating an account on GitHub.

    Dev tools · 25d ago · github.com

  • OpenBot▲362

    Grok Bot alternative: free, local, open-source, multiplayer

    Dev tools · 23d ago · openbot.run

  • Talanoa▲345

    Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…

    Dev tools · 20d ago · talanoa.email

  • CoreSpeed▲332

    One MCP for everything your agents need: apps, memory, tools

    Dev tools · 28d ago · corespeed.io

Source: Show HN post ↗

Launched alongside, January 2025

the whole month →
  • Hello! I'm Byran. I spent the past ~6 months engineering a laptop from scratch. It's fully open-source on GH at: https://github.com/Hello9999901/laptop

    Dev tools · 2025 · byran.ee

  • TI

    I realized that the PDF engines of modern desktop browsers (PDFium and PDF.js) support JavaScript with enough I/O primitives to make a basic game like Tetris. It was a bit tricky to find a union of features that work in both engines, but in the end it turns out that showing/hiding annotation "fields" works well to make monochrome pixels, and keyboard input can be achieved by typing in a text input box. All in all it's quite janky but a nice reminder of how general purpose PDF scripting can be. The linked PDF is all ASCII so you can just open it in a text editor, or have a look at…

    Life & fun · 2025 · th0mas.nl

  • 21st.dev▲1,211

    I originally built this app to organize and reuse interesting React + Tailwind components I came across on Twitter, inspired by the shadcn/ui approach. Later, a friend started contributing their own components, and it got me thinking—this could grow into something bigger, like an NPM for design engineers to share and use components. Would love to hear your thoughts!

    Dev tools · 2025 · 21st.dev

  • Create lifelike, personalized AI avatars from text prompts

    AI · 2025 · jogg.ai

  • Turn Figma designs into full stack apps with AI

    Dev tools · 2025 · figma.com

  • CSS library based on Counter Strike 1.6 UI.

    Life & fun · 2025 · cs16.samke.me