logoalt Hacker News

Show HN: HelixDB – Open-source vector-graph database for AI applications (Rust)

223 pointsby GeorgeCurtislast Tuesday at 5:26 PM102 commentsview on HN

Hey HN, we want to share HelixDB (https://github.com/HelixDB/helix-db/), a project a college friend and I are working on. It’s a new database that natively intertwines graph and vector types, without sacrificing performance. It’s written in Rust and our initial focus is on supporting RAG. Here’s a video runthrough: https://screen.studio/share/szgQu3yq.

Why a hybrid? Vector databases are useful for similarity queries, while graph databases are useful for relationship queries. Each stores data in a way that’s best for its main type of query (e.g. key-value stores vs. node-and-edge tables). However, many AI-driven applications need both similarity and relationship queries. For example, you might use vector-based semantic search to retrieve relevant legal documents, and then use graph traversal to identify relationships between cases.

Developers of such apps have the quandary of needing to build on top of two different databases—a vector one and a graph one—plus you have to link them together and sync the data. Even then, your two databases aren't designed to work together—for example, there’s no native way to perform joins or queries that span both systems. You’ll need to handle that logic at the application level.

Helix started when we realized that there are ways to integrate vector and graph data that are both fast and suitable for AI applications, especially RAG-based ones. See this cool research paper: https://arxiv.org/html/2408.04948v1. After reading that and some other papers on graph and hybrid RAG, we decided to build a hybrid DB. Our aim was to make something better to use from a developer standpoint, while also making it fast as hell.

After a few months of working on this as a side project, our benchmarking shows that we are on par with Pinecone and Qdrant for vectors, and our graph is up to three orders of magnitude faster than Neo4j.

Problems where a hybrid approach works particularly well include:

- Indexing codebases: you can vectorize code-snippets within a function (connected by edges) based on context and then create an AST (in a graph) from function calls, imports, dependencies, etc. Agents can look up code by similarity or keyword and then traverse the AST to get only the relevant code, which reduces hallucinations and prevents the LLM from guessing object shapes or variable/function names.

- Molecule discovery: Model biological interactions (e.g., proteins → genes → diseases) using graph types and then embed molecule structures to find similar compounds or case studies.

- Enterprise knowledge management: you can represent organisational structure, projects, and people (e.g., employee → team → project) in graph form, then index internal documents, emails, or notes as vectors for semantic search and link them directly employees/teams/projects in the graph.

I naively assumed when learning about databases for the first time that queries would be compiled and executed like functions in traditional programming. Turns out I was wrong, but this creates unnecessary latency by sending extra data (the whole written query), compiling it at run time, and then executing it. With Helix, you write the queries in our query language (HelixQL), which is then transpiled into Rust code and built directly into the database server, where you can call a generated API endpoint.

Many people have a thing against “yet another query language” (doubtless for good reason!) but we went ahead and did it anyway, because we think it makes working with our database so much easier that it’s worth a bit of a learning curve. HelixQL takes from other query languages such as Gremlin, Cypher and SQL with some extra ideas added in. It is declarative while the traversals themselves are functional. This allows complete control over the traversal flow while also having a cleaner syntax. HelixQL returns JSON to make things easy for clients. Also, it uses a schema, so the queries are type-checked.

We took a crude approach to building the original graph engine as a way to get an MVP out, so we are now working on improving the graph engine by making traversals massively parallel and pipelined. This means data is only ever decoded from disk when it is needed, and parts of reads are all processed in parallel.

If you’d like to try it out in a simple RAG demo, you can follow this guide and run our Jupyter notebook: https://github.com/HelixDB/helix-db/tree/main/examples/rag_d...

Many thanks! Comments and feedback welcome!


Comments

rohanrao123last Tuesday at 9:34 PM

Congrats on the launch! I'm one of the authors of that paper you cited, glad it was useful and inspiring to building this :) Let me know if we can support in any way!

show 1 reply
quantikeyesterday at 5:36 AM

I spent a bit of time reading up on the internals and had a question about a small design choice (I am new to DB internals, specifically as they relate to vector DBs).

I notice that in your core vector type (`HVector`), you choose to store the vector data as a `Vec<f64>`. Given what I have seen from most embedding endpoints, they return `f32`s. Is there a particular reason for picking `f64` vs `f32` here? Is the additional precision a way to avoid headaches down the line or is it something I am missing context for?

Really cool project, gonna keep reading the code.

show 1 reply
srameshcyesterday at 1:04 AM

I was thinking about intertwining Vector and Graph, because I have one specific usecase that required this combination. But I am not courageos or competent enough to build such a DB. So I am very excited to see this project and I am certainly going to use it. One question is what kind of hardware do you think this would require ? I am asking it because from what I understand Graph database performance is directly proportional to the amount of RAM it has and Vectors also needs persistence and computational resources .

hbcondo714last Tuesday at 6:28 PM

Congrats! Any chance Helixdb can be run in the browser too, maybe via WASM? I'm looking for a vector db that can be pre-populated on the server and then be searched on the client so user queries (chat) stay on-device for privacy / compliance reasons.

show 1 reply
iannaclyesterday at 5:40 PM

Looks really interesting. A couple of questions: Can you explain how helix handles writes? What are you using for keys? UUIDs? I'm curious if you've done, or are thinking about, any optimizations here.

Feel free to point me to docs / code if these are lazy questions :)

show 1 reply
tmpfslast Tuesday at 9:47 PM

This is very interesting, are there any examples of interacting with LLMs? If the queries are compiled and loaded into the database ahead of time the pattern of asking an LLM to generate a query from a natural language request seems difficult because current LLMs aren't going to know your query language yet and compiling each query for each prompt would add unnecessary overhead.

show 1 reply
huevosabiolast Tuesday at 7:13 PM

Can I run this as an embedded DB like sqlite?

Can I sidestep the DSL? I want my LLMs to generate queries and using a new language is going to make that hard or expensive.

show 1 reply
youdontlast Tuesday at 10:41 PM

Looks very interesting, but I've seen these kind of multi-paradigm databases like Gel, Helix and Surreal and I'm not sure that any of them quite hit the graph spot.

Does Helix support much of the graph algorithm world? For things like GrapgRAG.

Either way, I'd be all over it if there was a python SDK witch worked with the generated types!

show 1 reply
ckugblenuyesterday at 1:45 PM

Very interesting project. Would be curious of a comparison with memgraph. Will definitely give it to try for my knowledge graph use case.

show 1 reply
esafaklast Tuesday at 6:14 PM

How does it compare with https://kuzudb.com/ ?

show 1 reply
no1youknowzyesterday at 3:27 PM

> In-house graph-vector storage engine (to replace LMDB)

Not sure if it's possible. But why not use fjall, if it is? [0]

[0]: https://github.com/fjall-rs/fjall/

show 1 reply
bogzzyesterday at 2:04 PM

This is very cool, and right up my alley. Hesitant to try it out because of the bespoke query language for now.

I wonder if you'd like to share your thoughts on GQL becoming an ISO standard? Also, have you looked into how Neptune Analytics handles vector embeddings?

show 1 reply
sitkackyesterday at 2:19 AM

Excellent work. Very exited to test this out. What are the limits or gotchas we should be aware of, or how do you want it pushed?

What other papers did you get inspiration from?

show 1 reply
breneyesterday at 6:20 PM

How does this scale horizontally across multiple regions. Is this something on your roadmap?

show 1 reply
iamdanieljohnsyesterday at 2:42 PM

How does it compare to SurrealDB and ChromaDB?

show 1 reply
dietr1chlast Tuesday at 10:54 PM

Graph DB OOMing 101. Can it do Erdős/Bacon numbers?

Graph DBs have been plagued with exploding complexity of queries as doing things like allowing recursion or counting paths isn't as trivial as it may sound. Do you have benchmarks and comparisons against other engines and query languages?

rationablyyesterday at 4:13 AM

The fact that it's "backed by NVIDIA" and licensed under AGPL-3.0 makes me wonder about the cost(s) of using it in production.

Could you share any information on the pricing model?

show 1 reply
carlhjerpelast Tuesday at 6:54 PM

Nice "I'll have this name" when there's already the helix editor :)

show 2 replies
J_Shelby_Jlast Tuesday at 6:36 PM

How do you think about building the graph relationships? Any special approaches you use?

show 1 reply
anonymousDanyesterday at 4:40 AM

What would be a typical/recommended server setup for using this for RAG? Would you typically have a separate server for the GPUs and the DB itself?

show 1 reply
Attummmlast Tuesday at 9:01 PM

It sounds very intriguing indeed. However, the README makes some claims. Are there any benchmarks to support them?

> Built for performance we're currently 1000x faster than Neo4j, 100x faster than TigerGraph

show 1 reply
SchwKatzelast Tuesday at 6:24 PM

Super cool!!! I'll try it this week and go back to give a feedback.

show 1 reply
javierluraschilast Tuesday at 6:59 PM

What is the max number of dimensions supported for a vector?

show 1 reply
wiradikusumayesterday at 3:46 AM

"faster than Neo4j" How does it compare to Dgraph?

show 1 reply
elpaleklast Tuesday at 7:55 PM

What method/model are you using for sparse search?

show 1 reply
lleymrl651yesterday at 10:42 AM

Congrats on the launch!

show 1 reply
raufakdemirlast Tuesday at 9:47 PM

How can I migrate neo4j to this?

show 1 reply
basonjournelast Tuesday at 8:24 PM

why not surrealdb?

show 1 reply
lennertjansenlast Tuesday at 10:08 PM

how did you get it 3 OOMs faster than neo4j?

show 2 replies
michaelsbradleyyesterday at 3:42 AM

Can you do a compare/contrast with CozoDB?

https://github.com/cozodb/cozo

show 1 reply
synclast Tuesday at 6:04 PM

Looks nice! Are you looking to compete with https://www.falkordb.com or do something a bit different?

show 1 reply
riku_ikilast Tuesday at 10:55 PM

How scalable is your DB in your tests? Could it be performent on graphs with 1B/10B/100B connections?

mdaniellast Tuesday at 7:56 PM

> so much easier that it’s worth a bit of a learning curve

I think you misspelled "vendor lock in"

show 1 reply